Comments (1)
@frisia-mtz Thanks for the bug report. I appreciate you taking the time to point this out and provide an example.
I think this is more of a general problem of the way the geometry type (bytes 1-5: 010000A0
) is represented in EWKB context. In EWKB, the 01
indicates a Point-type, and the A0
is the bitwise OR [1] of an SRID flag (0x20
) and a WKB Z offset (0x80
) [2] --> 0x20 | 0x80 = 0xa
. geomet
is checking for the presence of the SRID flag [3] but it's not expecting the dimensional offset.
It looks the reverse of the conversion (dumps
/to WKB) is also not correctly setting the dimensionality flag [4].
It looks like the correct fix would be to:
- look for the dimensionality flag when parsing EWKB
- inject the dimensionality flag when generating EWKB
@tomplex @achapkowski Would you both agree with this assessment? Is there anything I'm missing, perhaps an alternate EWKB spec independent of PostGIS that would contradict this and cause additional breakage in other use cases, if we were to fix this per the PostGIS spec?
References:
[1] - https://github.com/postgis/postgis/blob/b1b8c11bfe54d7756ed53719e74783dd2733d3df/doc/ZMSgeoms.txt#L56-L66
[2] - https://github.com/postgis/postgis/blob/b1b8c11bfe54d7756ed53719e74783dd2733d3df/liblwgeom/liblwgeom.h.in#L124-L127
[2] -
Line 135 in 8d2b8f2
[3] -
Lines 336 to 373 in 8d2b8f2
from geomet.
Related Issues (20)
- WKT cannot load geocollections if one of the shapes is "EMPTY" HOT 4
- Accept hex as well as bytestrings in loads functions
- Geomet does not support explicit M, Z, or ZM WKT HOT 5
- Update documentation and project metadata to include support for GeoPackage HOT 4
- Direct WKB <-> WKT conversion functions? HOT 2
- Rework CI and release processes HOT 1
- Error in wkt.dumps
- Error in wkt.dumps HOT 2
- geomet.wkt.dumps fails with specific coordinates HOT 2
- assertEquals is gone in Python 3.11 HOT 2
- Being able to programmatically insert POLYHEDRALSURFACE (Z) or TIN (Z) object from Python to PostGIS HOT 1
- Release with fixes for exponential value bug HOT 2
- Drop support for end-of-life Python versions.
- Release version 1.0.0 HOT 3
- README not rendering correctly on PyPI
- six is not required HOT 1
- Tests fail with Python 3.12 HOT 3
- Add support for Python3.11
- Use modern format strings
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from geomet.