D
D
Dmitry Fondomakin2015-06-05 23:37:39
WordPress
Dmitry Fondomakin, 2015-06-05 23:37:39

Method of translating geo-coordinates into relative canvas coordinates (draw) for drawing a diagram?

Hello.
There was a need to draw up a diagram, without a cartographic substrate (white background). The scheme is drawn up on a canvas 300x300 mm or pixels, to choose from.
There is an object - a road - which has two coordinates, the beginning and the end of the section. Point A (45.006977, 39.117587) and point B (45.008380, 39.122297).
The site itself should be located in the center of the canvas. In this case, the object cannot exceed 2/3 of the width or height of the canvas, and be located in the center of the drawing canvas.
I draw a diagram in PIL (Python), but this is not important, because drawing principles are standard - the upper left corner has coordinates (0,0), the lower right corner has coordinates (300,300).
It turns out that you need to convert the geo-coordinates into relative ones. Here, while with thoughts tight. I'd be happy if someone could point me in the direction.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
O
Orkhan Hasanli, 2018-08-10
Enotov @defenot

Take a bunch
Take custom fields carbon fields or ACF
And also scripts flexslider2 or owl carousel
And then lay out the layout based on flexbox or CSS grid. And integrate it all.

A
Alexander Grimashevich, 2018-08-10
@jams

Look towards OWL. A good thing that can be easily customized for any project.

M
Moskus, 2015-06-06
@defond

Judging by the numbers, you have geographic coordinates. If you don't want your objects to be horizontally stretched in proportion to how far from the equator your object is, you'll first need to reproject the geographic coordinates on an ellipsoid or sphere (I don't know where you got them so there are options here) into rectangular, and then just normalize the resulting numbers so that they fit into your screen and rotate the axes.
The choice of rectangular coordinate systems is wide, but you will probably find it easiest to work with the Mercator projection. Everything you need for reprojection is contained in the PROJ4 library (see here ).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question