Question

I have a series of latitude/longitude coordinates that I'm trying to project onto a map as x,y coordinates.

I'm using the https://code.google.com/p/pyproj/ library to convert the coordinates, I can't seem to find anywhere that explains what the output of the functions mean though?

import PyProj

def ConvertToMapProjection(Coordinates):
    ''' Projects a mapped pair of coordinates onto a map '''

    # Define the projection
    RobinsonProjection = pyproj.Proj("+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs")

    East, North = RobinsonProjection(Coordinates[0],Coordinates[1])

    return [East,North]

ConvertToMapProjection([51.5072,0.1275])

returns:

[4866232.474090106, 13636.369990048854]

It's not clear what the units are? What's the best way to map this onto a 900 x 1100 rectangle?

Was it helpful?

Solution

Default units of proj are meters (you even specify it in the command).

The referential ellipsoid you're using is WGS84, which has mean radius 6356752.3142 meters (see proj -le)

You can scale it down by this factor to get "unit ellipsoid":

$ proj +proj=robin +ellps=WGS84 -m 1:6356752.3142

Even easier, but not so precise, would be projecting using the unit sphere:

$ proj +proj=robin +a=1

The answer to second part of your question is outlined in this post.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top