[gdal-dev] SDTS

Frank Warmerdam warmerdam at p...
Mon Jul 9 09:07:07 EDT 2001


Ben Discoe wrote:
> 
> Some more feedback on loading SDTS DEM with GDAL.
> 
> My previous code which used an old version of "libsdts++" did the following,
> to get the datum out of a SDTS DEM:
> 
> sb_ExtSpatialRef *pXREF;
> pXREF = new sb_ExtSpatialRef(record);
> // Find Datum type...
> const char * strDatum = pXREF->getHorizDatum().c_str();
> if (!strcmp(strDatum, "NAS") )
> m_Datum = NAD27;
> else if (!strcmp(strDatum, "WGC") )
> [....]
> 
> When i now use GDALOpen() and GetProjectionRef(), i get a string:
> 
> "+proj=utm +zone=10 +ellps=clrk66 "
> 
> .. which doesn't contain the datum. Shouldn't it be contained in this
> string?

Ben,

I appologise. The SDTS projection support is very old (by GDAL standards)
and predates my introduction of OGC WKT support. I have rewritten my 
SDTS projection code and you should now get back something like:

PROJCS["UTM Zone 12, Northern Hemisphere",
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke 1866",6378206.4,294.978698213898,
AUTHORITY["EPSG",7008]],
TOWGS84[-3,142,183,0,0,0,0],
AUTHORITY["EPSG",6267]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG",8901]],
UNIT["DMSH",0.0174532925199433,
AUTHORITY["EPSG",9108]],
AXIS["Lat","NORTH"],
AXIS["Long","EAST"],
AUTHORITY["EPSG",4267]],
PROJECTION["Transverse_Mercator"],
PARAMETER["latitude_of_origin",0],
PARAMETER["central_meridian",-111],
PARAMETER["scale_factor",0.9996],
PARAMETER["false_easting",500000],
PARAMETER["false_northing",0]]

This would normally be parsed using the OGRSpatialReference. After
converting it into an OGRSpatialReference (With importFromWkt()), 
you would call GetAttrValue("DATUM") to get the datum name 
(North_Americian_Datum_1927) and GetUTMZone() to get the zone. 

The changes haven't been committed back to CVS but should as soon as
cvs.remotesensing.org is working properly again. 

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at p...
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list