[Gdal-dev] simple OGR/python projection question

John C Cartwright John.C.Cartwright at noaa.gov
Tue Oct 4 18:16:05 EDT 2005


Hello All,

I'm using the OGR python bindings to convert Plate 
Carree(Equirectangular) coordinates in meters to geographic coordinates 
in WGS84.  I'm getting an answer like:

(-104.99999999546829, 38.999751150159064, 8426.3269814412379)

I understand that the first two values are longitude and latitude, but I 
don't understand the third term. Can some one explain?

Code fragment listed below.

Thanks!

-- john




wkt = 'PROJCS["World_Plate_Carree", GEOGCS["WGS 84", DATUM["WGS_1984", 
SPHEROID["WGS_1984", 6378137.0, 298.257223563]], PRIMEM["Greenwich", 
0.0], UNIT["degree",0.017453292519943295]], 
PROJECTION["Equirectangular"], PARAMETER["false_easting",  0.0], 
PARAMETER["false_northing", 0.0], PARAMETER["Central_Meridian", -180.0], 
UNIT["Meter",1.0]]'

sourceSrs = osr.SpatialReference()
targetSrs = osr.SpatialReference()
sourceSrs.ImportFromWkt(wkt)
targetSrs.ImportFromEPSG(4326)
transform = osr.CoordinateTransformation(sourceSrs,targetSrs)
coords = transform.TransformPoint(x,y)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: John.C.Cartwright.vcf
Type: text/x-vcard
Size: 269 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20051004/377046e3/John.C.Cartwright.vcf


More information about the Gdal-dev mailing list