Comments (3)
Hey @dave-nm, I think there's an error in the input.
0101000020e61000003cdba337dcc351c06d37c1374d374840
does not contain a valid geometry type. (See https://github.com/geomet/geomet/blob/master/wkb_detail.md#point).
I think the problem is that you're missing a byte from the type
field:
- the first byte (2 hex chars) is the endianness -->
01
- the next 4 bytes are the geometry type -->
01000020
, which is not a valid geometry type (at least none that I'm aware of) - the rest should be 8 byte chunks, each chunk containing a coordinate value
The first (working) example should convert to {'type': 'Point', 'coordinates': [-71.060316, 48.432044]}
, but I don't understand what the other geometry is supposed to be. Can you please clarify?
from geomet.
@dave-nm Ah, I see what it is. The SRID is encoded in there; that's why.
I figured this out by playing with postgis:
postgres=# SELECT ST_GeomFromEWKT('POINT(-71.060316 48.432044)');
st_geomfromewkt
--------------------------------------------
01010000003CDBA337DCC351C06D37C1374D374840
(1 row)
postgres=# SELECT ST_GeomFromEWKT('SRID=4326;POINT(-71.060316 48.432044)');
st_geomfromewkt
----------------------------------------------------
0101000020E61000003CDBA337DCC351C06D37C1374D374840
(1 row)
Let me find the documentation on that encoding. This seems to be a PostGIS-specific thing (https://gis.stackexchange.com/questions/143230/i-cant-understand-this-ewkb-type-mask) but I see no reason to not support it.
from geomet.
Closing this issue, moving it to #31 (since it more precisely characterizes the issue/feature).
from geomet.
Related Issues (20)
- geopackage WKB HOT 21
- conda-forge submission HOT 5
- Fix install location of LICENSE file HOT 1
- 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
- Conversion from EWKB does not support 3d HOT 1
- six is not required HOT 1
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.