[gdal-dev] Ogrinfo, WKT and geometries with Z

Ari Jolma ari.jolma at gmail.com
Thu Feb 11 02:14:11 PST 2016


11.02.2016, 11:53, Jukka Rahkonen kirjoitti:
> Hi,
>
> Ogrinfo is printing the WKT of XYZ geometries this way:
>
> ogrinfo polygonz.gpkg -al
> INFO: Open of `polygonz.gpkg'
>        using driver `GPKG' successful.
>
> Layer name: polygonz
> Geometry: Unknown (any)
> Feature Count: 1
> Extent: (340.000000, 420.000000) - (560.000000, 580.000000)
> Layer SRS WKT:
> (unknown)
> FID Column = fid
> Geometry Column = geom
> OGRFeature(polygonz):1
>    POLYGON ((340 580 1,560 580 2,560 420 3,340 580 1))
>
>
> In "OpenGISĀ® Implementation Standard for Geographic information - Simple
> feature access - Part 1: Common architecture" POINT is defined as 2
> dimensional. Wouldn't the right WKT be
>    POLYGON Z ((340 580 1,560 580 2,560 420 3,340 580 1)) ?
>
> I have tested that some software like OpenJUMP and PostGIS do accept POLYGON
> with 3 coordinates while some other like Spatialite do not. Because Ari is
> now working with XYZ(M) code would this also be worth a review?

In GDAL there are two WKT formats. Legacy one and ISO one. Legacy one is 
like above and ISO one prints the Z. I guess ogrinfo is using the legacy 
one.

Ari

>
> -Jukka Rahkonen-
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev



More information about the gdal-dev mailing list