Am 06.08.2017 um 11:07 schrieb Erik Josefsson:



It seems I need an interpreter of the output from ogrinfo that can
translate that rather complex output into a simple EPSG-code.

gdalsrsinfo has an easier output, but will not reveal EPSG codes either.

One reason is because many EPSG codes share basically the same projection parameters. As an example, EPSG:4258 (ETRS89) and EPSG:4619 (SWEREF99) are identical. QGIS makes an educated guess, but still does not know which one you want.

The other way is easy to implement: gdalsrsinfo EPSG:4619 has a unique output of

PROJ.4 : '+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs '

OGC WKT :
GEOGCS["SWEREF99",
    DATUM["SWEREF99",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6619"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4619"]]

It even adds the EPSG code as last line to the WKT definition (which ESRI software does not do).

HTH,
André Joost



_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to