0

I'm trying to figure out where a given latitude, longitude coordinate should appear on a particular shape file. The shape file was generated by the US government and I doubt it has any peculiar definitions (details below).

As an example, a point in Miami, Florida has real lat,long of 25.77,-80.21. Looking at the contents of the shape file this region is roughly at a y,x coordinate of 292000, 8930000. I have tried a python based utm conversion of my lat,longs which goes something like this:

 utm.from_latlon(25.77,-80.21)

that returns the following:

 (579216.2480487269, 2850450.638436528, 17, 'R')

The utm converted latitude number looks roughly close but the longitude number is way off. Is there some way to convert the longitude to an absolute number by adjusting it with the utm zone value of 17 or am I headed down the wrong path?

The shapefile in question is here: https://catalog.data.gov/dataset/usda-rural-development-property-eligibility-sfh-mfh

which has projection file description of:

PROJCS["WGS_1984_Web_Mercator_Auxiliary_Sphere",
  GEOGCS["GCS_WGS_1984",
    DATUM["D_WGS_1984",
      SPHEROID["WGS_1984",6378137.0,298.257223563]],
    PRIMEM["Greenwich",0.0],
    UNIT["Degree",0.0174532925199433]],
  PROJECTION["Mercator_Auxiliary_Sphere"],
  PARAMETER["False_Easting",0.0],
  PARAMETER["False_Northing",0.0],
  PARAMETER["Central_Meridian",0.0],
  PARAMETER["Standard_Parallel_1",0.0],
  PARAMETER["Auxiliary_Sphere_Type",0.0],
  UNIT["Meter",1.0]]

1 Answer 1

1

I solved this problem by converting the lat lon coordinates to an EPSG:3857 WGS 84 / Pseudo-Mercator projection. Thanks to python and the pyproj module it was easy, like this:

from pyproj import Proj, transform
P3857 = Proj(init='epsg:3857')
P4326 = Proj(init='epsg:4326')
lon = 25.77
lat = -80.21
x,y = transform(P4326, P3857, lon, lat)

returns an x,y pair of -8928936,2970622 which matches up with the shapefile values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.