[GRASS-user] WKT format in setting a location

Markus Neteler neteler at osgeo.org
Sun Sep 2 03:34:29 PDT 2012


On Sun, Sep 2, 2012 at 7:48 AM, RichardC <richtcooper at hotmail.com> wrote:
> Hi,
>
> When creating a LOCATION, a WKT definition can be used to set a coordinate
> reference system.
>
> WKT formats come in a number of formats (as listed through the command
> gdalsrsinfo -o all EPSG:n): OGC, OGC-simple, OGC-no CT, and ESRI (e.g., a
> shapefile's PRJ file).
>
> Is any format preferred or all are equally acceptable? The differences
> include omitting AUTHORITY details.

For such cases of self-composing WKT files, I always use this tool:
gdal/apps/testepsg.cpp

(needs compilation of course)

Example:


testepsg swiss_ch1903.prj
Validate Succeeds.      <-------- :-)
WKT[swiss_ch1903.prj] =
PROJCS["Swiss. Obl. Mercator",
    GEOGCS["bessel",
        DATUM["CH1903",
            SPHEROID["Bessel_1841",6377397.155,299.1528128],
            TOWGS84[674.374,15.056,405.346,0,0,0,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Hotine_Oblique_Mercator"],
...

Of course the tool only makes a formal test and won't test if
the inserted values are right, it just tests their position within the
WKT structure.

Markus


More information about the grass-user mailing list