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

Nelson, Dean dean.nelson at eecradar.com
Thu Jul 26 10:18:45 EDT 2007


Frank, et al,

I agree - its not a datum issue here.

I have tried the solution suggested by Frank with no change in the
results. However, in delving deeper into the data for this particular
project, it appears that all of this data is off about 10 min in Lat. I
can't explain it - so I'll ask the source: USGS - which may prove to be
a daunting task for a whimp like me.

In the mean time I would like to know a few techniques to get me through
the day:

1. If I have a shape file that is 10 min off in lat, how can I shift it
to the right spot with the GDAL/OGR tools? Or do I need to write a
little code?

Since I am dealing with 1km resolution hydrology basins, accuracy is not
a huge concern.

2. When I reproject with ogr2ogr, the data come out 0-360 longitude. How
can I make it +-180?

You all have been so helpful, Thanks!

Regards,

Dean Nelson   
Enterprise Electronics Corp




-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: Wednesday, July 25, 2007 9:55 AM
To: Nelson, Dean
Cc: Dylan Beaudette; gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] Measured Values for Shapefile read & write


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_INF
O",
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