[gdal-dev] Re: org2ogr, KML, and srs definition

Hermann Peifer peifer at gmx.eu
Sat Feb 18 14:53:06 EST 2012


On 18/02/2012 20:11, Brent Fraser wrote:
> I have some shapefiles I thought I would look at in Google Earth, so I
> used ogr2ogr (v1.8.1) to convert them to KML:
>
> ogr2ogr -f "KML" Lines_OGR.kml Lines.shp
>
> but they appeared about 100 meters Northeast of my expectation, leading
> me to believe there was a Datum problem.
>

OGR interprets your .prj file like this:
+proj=utm +zone=35 +ellps=intl +units=m +no_defs

...and the EPSG code like this:
+proj=utm +zone=35 +ellps=intl +towgs84=-87,-98,-121,0,0,0,0 +units=m 
+no_defs

As there is no +towgs84 parameter in the 1st case, you end up with the 
100m shift. In trunk, there is some code that should enable some sort of 
EPSG code auto-detection, but this is still experimental...

Hermann



More information about the gdal-dev mailing list