-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support 3d geometry #12
Conversation
There are still quite some tests failing. In the |
Yeah, sorry for the tests, I will rewrite them without having to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really oversee the bit fiddling details, but based on the tests agains GEOS it looks good to me!
Thanks. There's on thing to improve and that is to create real ArchGDAL Z geometries to test with (skipped for now). Actually passing three coordinates per point doesn't do the trick. |
("Point", ArchGDAL.createpoint(coord), false, false), | ||
("PointZ", ArchGDAL.createpoint(coord3), true, true), | ||
("LineString", ArchGDAL.createlinestring(coord, lcoord), false, false), | ||
("LineStringZ", ArchGDAL.createlinestring(coord3, lcoord3, lcoord3), true, true), | ||
("Polygon", ArchGDAL.createpolygon(coords), false, false), | ||
("PolygonZ", ArchGDAL.createpolygon(coords3), true, true), | ||
("MultiPoint", ArchGDAL.createmultipoint([coord, lcoord]), false, false), | ||
("MultiPointZ", ArchGDAL.createmultipoint([coord3, lcoord3]), true, true), | ||
("MultiLineString", ArchGDAL.createmultilinestring([[coord, lcoord], [coord, lcoord]]), false, false), | ||
("MultiLineStringZ", ArchGDAL.createmultilinestring([[coord3, lcoord3], [coord3, lcoord3]]), true, true), | ||
("MultiPolygon", ArchGDAL.createmultipolygon([coords, coords]), false, false), | ||
("MultiPolygonZ", ArchGDAL.createmultipolygon([coords3, coords3]), true, true), | ||
("Empty", ArchGDAL.createpoint(), false, false), | ||
("Empty Multi", ArchGDAL.createmultipolygon(), false, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could these be replaced by GeoInterface wrapper types, since they encode directly whether Z and M are specifically present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They could be, but I mostly want to compare to GDAL and GEOS WKB/WKT functionality, so that would only introduce a layer of conversions.
However, it's not straightforward to be compatible with 3th-party packages.
There are several flavors of 2d+ WKT/WKB. WKT should print Z, M, ZM in their type, but GDAL omits this when possible and only provides it for M. ArchGDAL doesn't fully Z/M geometries, so this is sometimes hard to test. WKB has two ways of providing the geometry type, one with bitflags, one with x-thousands added to the type. We parse both, but only write the flagged one, which seems to be default. Interestingly, LibGEOS(.jl) doesn't seem to support either.
Also improved parsing of type with regex.
Closes #6