Closed tomvantilburg closed 6 years ago
After a bit more digging I understood that the problem was with the geometry not being a Polyhedral but a PolygonZ (which has a different byte length). Apparently only Polyhedrals are supported. Not sure if this is intentional, but it makes sense. Issue closed.
Hi,
We unfortunately support only a small amount of geometry types. However, both polyhedral surfaces and multipolygonsZ are supported. You can easily convert from polygonZ to multipolygonZ using the postgis ST_Multi function.
Good to know! I saw you are already checking the geometry type in the code. https://github.com/Oslandia/py3dtiles/blob/f55669b2003def0eb699e5fa6e543c579ce1ce82/py3dtiles/wkb_utils.py#L145
You might like to add a small if
statement to throw an error message when it's not a polyhedral or multipolyz. Now I was kind of in the dark....
Wanted to test how it works with getting data from postgis but I receive a
struct.error: unpack requires a buffer of 16 bytes
Offence happens here:
As far as I can see psycopg2 returns a memoryview for the ST_AsBinary object from postgres. I've tried to convert this to bytes by using
bytes(wkb)
but that wouldn't help.Testing it on the building.wkb file runs without error.