-
Notifications
You must be signed in to change notification settings - Fork 14
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
Update for the new GeoInterface #72
Conversation
Nice work! How do you see this in relation to #39? |
Yeah. If we do that, we won't need this PR, because we will have the interface in GB anyway. So this is kind of temporary really. But there are three unmerged GB PRs here now and I dont know where they are at or which to move forward. Im also not totally sure if the upfront conversion to GB types is the best approach. With shapefiles we know the bounding boxes of all objects and can use that information to reduce work. But with GeometryBasics conversion all shapes will be sorted into rings/holes on load. That can be a huge and unnessary overhead if we only need to analyse a small region of a large shape file. On the other hand I can also see how annoying shapefiles are to fit into the GeoInterface. |
Seems like this will kill the other GeometryBasics PRs here? JuliaGeometry/GeometryBasics.jl#173 We need metadata for the bounding box, which would be a shame to lose. |
Yeah they would need to be adapted at least. Indeed these sort of issues show the difficulty of putting everything into shared geometry types. Things like metadata and extents would understandably become out of scope for GeometryBasics. In the end what matters the most is easy interop. If we can show that we can use Shapefile + GeoInterface to easily get either GEOS geometries or GeometryBasics ones, that would be great. The Shapefile geometry structs are not meant for direct use for most cases. So even a struct that wraps a stream or byte array would be enought (like GeoJSONTables, see JuliaGeo/GeoJSON.jl#36 (comment)). |
This is working, just waiting on the new GeoInterfaceRecipes subpackage to be merged and registered for plot recipes here.
@visr my long term plan is to replace this package with the 100% lazy version we spoke about. And call it Shapefiles.jl so we can just use But for now this is working, and should actually be much faster to load, plot and rasterize than before. |
Cool! Besides the new GeoInterface, what (if any) is breaking about this? Does e.g. the README quick start example still work without changes? |
There shouldn't be any user facing changes, except that e.g. I'm not sure what to do about that actually. |
You can still pretend that they're 2d, as they're not truly 3d, but more like 2.5d. So the inpolygon just works with the first two coordinates. |
Ah ok thats what I've done anyway. So its the same as before, but the actual coordinates returned are 3d. |
Feel free to drop julia pre-1.6 here by the way. |
If added |
Because of the major restructuring, I can't really tell what's new code and old. I have a few small comments, otherwise LGTM. |
Yes apologies about the restructure, it got too tedious scrolling around and finding things with the old structure. A lot of the old code is changed and simplified as well. The main new types are Also: this should be good to merge |
Merged so we can get ArchGDAL tests passing ASAP. There may be some changes to add to this afterwards, but it should mostly be fine. |
See JuliaGeo/GeoInterface.jl#33
There are some issues with how to fit the odd format of Shapefiles - mixed multipoligons with rings and holes - into the OGC standard and GeoInterface. We need to work out how to efficiently index holes with
gethole
when we have to manually check.