Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have discovered a problem related to the output of an ogr2ogr command line call. My resulting polygon features are 12 miles (.18 degrees) due north of where they should be, but the longitude is correct. The polygon dimensions are also preserved.

The desired output is a shapefile that has been projected using EPSG 4326. The input comes from a postgres database with postgis where the polygon were digitized in EPSG 900913 (the Google Web Mercator prj).

Below is the command line call that I am using:

ogr2ogr -where " gid = 3 " -f "ESRI Shapefile" E:\Web_Data_Storage\dfr_map_shapes\DFRmap_Tract_3_4326.shp -t_srs EPSG:4326 PG:"user=dfr_webmap dbname=denr host=ipaddress password=xxx port=5433" Tracts2

If I convert the coordinates of a corner of a polygon using gdaltransform I get the correct coordinates.

gdaltransform -s_srs EPSG:900913 -t_srs EPSG:4326 -8853154 4197094.5

Why is this happening and how do I fix it?

Thanks.

share|improve this question
    
Why don't you add the -s_srs EPSG:900913 parameter in your ogr2ogr command? –  mrg Sep 12 '11 at 8:36

1 Answer 1

I had a similar problem which I solved by replacing the 900913 SRID definition in the spatial_ref_sys table of the originating database with this one (to which I was directed by the TileStache.Vector documentation).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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