[gdal-dev] ISO WKB
Mateusz Loskot
mateusz at loskot.net
Thu Dec 12 15:19:34 PST 2013
On 12 Dec 2013 22:58, "Even Rouault" <even.rouault at mines-paris.org> wrote:
>
> Le jeudi 12 décembre 2013 23:39:25, Paul Ramsey a écrit :
> > It also seems the wkb reader/writer have little handling for empty
geometry
> > types. I’d like to add some in, if that’s OK.
>
> Are you sure about that ?
>
> See :
>
> >>> from osgeo import ogr
> >>> ogr.CreateGeometryFromWkb(g.ExportToWkb()).ExportToWkt()
> 'LINESTRING EMPTY'
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('LINESTRING
> EMPTY').ExportToWkb()).ExportToWkt()
> 'LINESTRING EMPTY'
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('LINESTRING
> EMPTY').ExportToWkb()).ExportToWkt()
> 'LINESTRING EMPTY'
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('POLYGON
> EMPTY').ExportToWkb()).ExportToWkt()
> 'POLYGON EMPTY'
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('MULTILINESTRING
> EMPTY').ExportToWkb()).ExportToWkt()
> 'MULTILINESTRING EMPTY'
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('MULTIPOLYGON
> EMPTY').ExportToWkb()).ExportToWkt()
> 'MULTIPOLYGON EMPTY'
> >>>
ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('GEOMETRYCOLLECTION
> EMPTY').ExportToWkb()).ExportToWkt()
> 'GEOMETRYCOLLECTION EMPTY'
>
> The only exception is POINT EMPTY due to the lack of wkb representation
for it
> :
> >>> ogr.CreateGeometryFromWkb(ogr.CreateGeometryFromWkt('POINT
> EMPTY').ExportToWkb()).ExportToWkt()
> 'POINT (0 0)'
See
http://blog.cleverelephant.ca/2010/03/nothing-nada-zip-bupkus.html
--
Mateusz Łoskot, http://mateusz.loskot.net
(Sent from mobile, apology for top-posting or broken quotes)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131212/1c22be29/attachment.html>
More information about the gdal-dev
mailing list