question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WKB representation of empty 3D Point is 2-dimensional

See original GitHub issue

I am a bit lost in the previous discussions we had about this topic of WKB and empty points (and GEOS version dependencies … etc), but noticed the following difference between Shapely and PyGEOS while running the Shapely tests (in the shapely-2.0 branch) with the latest pygeos:

>>> pygeos.to_wkb(pygeos.from_wkt("POINT Z EMPTY"), hex=True)
'0101000000000000000000F87F000000000000F87F'

This in contrast to Shapely (using the same GEOS 3.9.1 version):

>>> from shapely import wkt

>>> wkt.loads("POINT Z EMPTY").wkb_hex
'0101000080000000000000F87F000000000000F87F000000000000F87F'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
caspervdwcommented, Sep 18, 2021

Yes, but at least that’s the same in Shapely, so that might also be a limitation/bug of GEOS:

In [4]: wkt.loads("POINT Z EMPTY").wkt
Out[4]: 'POINT EMPTY'

I created a ticket at GEOS: https://trac.osgeo.org/geos/ticket/1129

0reactions
jorisvandenbosschecommented, Sep 15, 2021

Yes, but at least that’s the same in Shapely, so that might also be a limitation/bug of GEOS:

In [4]: wkt.loads("POINT Z EMPTY").wkt
Out[4]: 'POINT EMPTY'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Well-known text representation of geometry - Wikipedia
Empty geometries that contain no coordinates can be specified by using the symbol EMPTY after the type name.
Read more >
#1005 (Writing POINT EMPTY in WKB) – GEOS - OSGeo Trac
turns out the core model of GEOS/JTS can't even represent a "GEOMETRYCOLLECTION Z EMPTY" of any type. There's nowhere for the dimensionality to...
Read more >
WKT: What is the reasoning behind the concept of a POINT ...
That all pretty much makes sense: a "LINESTRING EMPTY" is a LINESTRING type with 0 vertices. Same with a MULTIPOINT, POLYGON, etc. But...
Read more >
Well-known text - GIS Wiki | The GIS Encyclopedia
Well-known text (WKT) is a text markup language for representing vector geometry objects on a map, spatial reference systems of spatial ...
Read more >
Chapter 8. PostGIS Reference
ST_GeogFromWKB — Creates a geography instance from a Well-Known Binary geometry representation (WKB) or extended Well Known Binary (EWKB).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found