[gdal-dev] OGRSpatialReference justify

atubar atubar at 126.com
Tue Jun 22 05:35:31 EDT 2010


hello, everyone.
I need to justify whether one geotiff and one shapefile are in the same projection with IsSame  function from OGR,  which will compare the wkt info of OGRSpatialReference ,  like below.

bool CompareWktIsUniform(const char* pszWkt1, const char* pszWkt2) 
{ 
 OGRSpatialReference SR1(pszWkt1); 
 OGRSpatialReference SR2(pszWkt2); 

 int IsSame = SR1.IsSame(&SR2); 

 if (IsSame == TRUE) 
  return  true; 
 else 
  return false; 
} 

And  I have two  OGRSpatialReference, one is from shapefile and the other is from Geotiff. 

PROJCS["Albers Conical Equal Area",GEOGCS["GCS_Krasovsky_1940",DATUM["Krasovsky_1940",SPHEROID["Krasovsky_1940",6378245.0,298.3]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["longitude_of_center",105.0],PARAMETER["Standard_Parallel_1",25.0],PARAMETER["Standard_Parallel_2",47.0],PARAMETER["latitude_of_center",0.0],UNIT["Meter",1.0]] 


PROJCS["IMAGINE GeoTIFF Support 
Copyright 1991 - 2005 by Leica Geosystems Geospatial Imaging, LLC. All Rights Reserved 
@(#)$RCSfile: egtf.c $ IMAGINE 9.0 $Revision: 10.0 $ $Date: 2005/07/26 15:10:00 EST $ 
Projection = Albers Conical Equal Area",GEOGCS["Krasovsky",DATUM["Krasovsky",SPHEROID["Krasovsky",6378245,298.3000003760163]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]],PROJECTION["Albers_Conic_Equal_Area"],PARAMETER["standard_parallel_1",25],PARAMETER["standard_parallel_2",47],PARAMETER["latitude_of_center",0],PARAMETER["longitude_of_center",105],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]] 

In fact they should be same, as both are 
Projection = Albers Conical Equal Area",  
GEOGCS["Krasovsky 
DATUM["Krasovsky

but in details are a little different, how to avoid that?

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20100622/cc196e87/attachment-0001.html


More information about the gdal-dev mailing list