[Gdal-dev] Measured Values for Shapefile read & write

Frank Warmerdam warmerdam at pobox.com
Wed Jul 25 10:55:16 EDT 2007


Nelson, Dean wrote:
> Yes, I was projecting to a WSG84 from a Lambert_Azimuthal_Equal_Area
> projection (as far as I can tell) See the "[Gdal-dev] Is ogr2ogr the
> tool to use?" thread.

Dean,

The issue isn't nad grid files.  That won't account for 17km offsets.
Datum shift problems are normally in the 10-300m range.

The problem is that your source coordinate system uses a spherical
earth, but WGS84 is elliptical.  The *default* mechanism used by
PROJ.4 for such transformation is to convert your location on the
spherical earth to an absolute (geocentric) location, and then to
translate that onto the ellipsoid. But what people almost always
want is to assume that a given lat/long position on the sphere should
be treated as identical to the same lat/long on the ellipsoid.

My suggestion is to create a d_sphere.prj file with the following
contents:

GEOGCS[
"GCS_Sphere_ARC_INFO",DATUM["D_Sphere_ARC_INFO",SPHEROID["Sphere_ARC_INFO",
6370997.0,0.0]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]

Then do:

   ogr2ogr -t_srs d_sphere.prj -f "ESRI Shapefile" outfile.shp infile.shp

After that you can delete the outfile.prj file, and replace it with the
WGS84 equivelent (such as was produced by your earlier -t_srs WGS84
translation).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list