[gdal-dev] help for comparing two WKT

Frank Warmerdam warmerdam at pobox.com
Fri Oct 7 20:49:40 EDT 2011


Etienne,

You should in theory just use OGRSpatialReference::IsSame() method to
see if two coordinate systems are essentially equivelent, but it is not
really all that perfect.

Best regards,


On Fri, Oct 7, 2011 at 4:36 PM, Etienne Tourigny
<etourigny.dev at gmail.com> wrote:
> Hi all,
>
> I would appreciate any hints as to how I can compare 2
> WKT/OGRSpatialReference objects.
>
> My goal is to make sure that a more detailed WKT (with authority codes
> and explicit datum) corresponds (numerically) to a simpler one, such
> as in the following examples.
>
> I understand that the oSRSGDAL.exportToPrettyWkt() function can remove
> AXIS, AUTHORITY and EXTENSION nodes, but how can I guarantee that the
> PARAMETER nodes are in the same order? Does FixupOrdering() solve that
> problem?
>
> Furthermore, How could I compare the datums?
>
>
>
>
> CF=[PROJCS["unnamed",
>    GEOGCS["unknown",
>        DATUM["unknown",
>            SPHEROID["Spheroid",6378137,298.2572221010002]],
>        PRIMEM["Greenwich",0],
>        UNIT["degree",0.0174532925199433]],
>    PROJECTION["Lambert_Conformal_Conic_2SP"],
>    PARAMETER["standard_parallel_1",-18],
>    PARAMETER["standard_parallel_2",-36],
>    PARAMETER["latitude_of_origin",0],
>    PARAMETER["central_meridian",134],
>    PARAMETER["false_easting",0],
>    PARAMETER["false_northing",0]]]
>
> GDAL=[PROJCS["GDA94 / Geoscience Australia Lambert",
>    GEOGCS["GDA94",
>        DATUM["Geocentric_Datum_of_Australia_1994",
>            SPHEROID["GRS 1980",6378137,298.2572221010002,
>                AUTHORITY["EPSG","7019"]],
>            TOWGS84[0,0,0,0,0,0,0],
>            AUTHORITY["EPSG","6283"]],
>        PRIMEM["Greenwich",0],
>        UNIT["degree",0.0174532925199433],
>        AUTHORITY["EPSG","4283"]],
>    PROJECTION["Lambert_Conformal_Conic_2SP"],
>    PARAMETER["standard_parallel_1",-18],
>    PARAMETER["standard_parallel_2",-36],
>    PARAMETER["latitude_of_origin",0],
>    PARAMETER["central_meridian",134],
>    PARAMETER["false_easting",0],
>    PARAMETER["false_northing",0],
>    UNIT["metre",1,
>        AUTHORITY["EPSG","9001"]],
>    AUTHORITY["EPSG","3112"]]]
>
>
>
> Another option is exporting to PROJ.4 strings, but there are the
> +towgs84 that shows up , plus some differences in +datum vs. +ellps.
>
> e.g.
>
> CF=[+proj=utm +zone=55 +ellps=WGS84 +units=m +no_defs ]
> GDAL=[+proj=utm +zone=55 +datum=WGS84 +units=m +no_defs ]
>  or
> CF=[+proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0=0 +y_0=0
> +ellps=GRS80 +units=m +no_defs ]
> GDAL=[+proj=lcc +lat_1=-18 +lat_2=-36 +lat_0=0 +lon_0=134 +x_0=0
> +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs ]
>
>
>
> many thanks,
> Etienne
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
---------------------------------------+--------------------------------------
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    | Geospatial Software Developer


More information about the gdal-dev mailing list