[Gdal-dev] OGRSpatialReference WKS question

Chapman, Martin MChapman at sanz.com
Thu Aug 26 12:44:43 EDT 2004


Given the well known string for a spatial reference, what is the OGR
syntax that will always return the expected node?  For example, what is
the syntax that will always return all the GEOGCS|AXIS nodes for the
following WKS?
 
PROJCS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PROJCS> ["OSGB 1936 / British National Grid",
        GEOGCS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#GEOGCS> ["OSGB 1936",
            DATUM
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#DATUM> ["OSGB_1936",
                SPHEROID
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#SPHEROID> ["Airy
1830",6377563.396,299.3249646,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","7001"]],
                TOWGS84
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#TOWGS84> [375,-111,431,0,0,0,0],
                AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","6277"]],
            PRIMEM
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PRIMEM> ["Greenwich",0,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","8901"]],
            UNIT
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#UNIT> ["DMSH",0.0174532925199433,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","9108"]],
            AXIS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AXIS> ["Lat",NORTH],
            AXIS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AXIS> ["Long",EAST],
            AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","4277"]],
        PROJECTION
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PROJECTION> ["Transverse_Mercator"],
        PARAMETER
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PARAMETER> ["latitude_of_origin",49],
        PARAMETER
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PARAMETER> ["central_meridian",-2],
        PARAMETER
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PARAMETER> ["scale_factor",0.999601272],
        PARAMETER
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PARAMETER> ["false_easting",400000],
        PARAMETER
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#PARAMETER> ["false_northing",-100000],
        UNIT
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#UNIT> ["metre",1,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","9001"]],
        AXIS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AXIS> ["E",EAST],
        AXIS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AXIS> ["N",NORTH],
        AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","27700"]],
    VERT_CS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#VERT_CS> ["Newlyn",
        VERT_DATUM
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#VERT_DATUM> ["Ordnance Datum Newlyn",2005,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","5101"]],
        UNIT
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#UNIT> ["metre",1,AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","9001"]],
        AXIS
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AXIS> ["Up",UP],
        AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","5701"]],
    AUTHORITY
<http://geoapi.sourceforge.net/snapshot/javadoc/org/opengis/referencing/
doc-files/WKT.html#AUTHORITY> ["EPSG","7405"]]
 
I know I can use something like
OGRSpatialReference->GetAttrValue("UNIT", 0), but that will only return
the first UNIT child node depending on where the root is.  Does anyone
have this worked out.  Code would be much appreciated.
 
Thanks,
 
Martin Chapman
Cell 303-885-1936
Office 303-495-6300 x326
mchapman at sanz.com
http://www.sanz.com <http://www.sanz.com/> 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20040826/0351d326/attachment.html


More information about the Gdal-dev mailing list