Using GEO coordinates in C # to draw a map

Is he,

I want to draw a location map in C # with LAT / LNG coordinates. I have to translate lat / lng to pixels, which would be best? I can draw a "map", but it is very small and it is not in the center of the window.

Can anyone help? I have this code:

    void draw(Graphics g, PointF[] points, Pen p)
    {            
        Graphics gfx = g;
        gfx.PageUnit = GraphicsUnit.Point;

        GraphicsPath gpath = new GraphicsPath();
        gpath.StartFigure();
        gpath.AddLines(points);
        gpath.CloseFigure();

        Matrix m = new Matrix();
        m.Scale(5, 5);

        gfx.Transform = m;
        gfx.DrawPath(p, gpath);            
        gfx.Dispose();
        gpath.Dispose();

        return;
    }
+3
source share
1 answer

You will need to select a map projection (for example, Mercator, Cylindrical Equal Area or Mollweide), and then convert the coordinates from geographic lat, LNG to use this projection.

- proj.4. , #, OGR ogrsharp. OGR proj.4 , , (, prj).

0

Source: https://habr.com/ru/post/1776438/


All Articles