Skip to content
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

Use general GeoInterface polygons as PolyRegions #10

Open
asinghvi17 opened this issue Mar 30, 2024 · 6 comments
Open

Use general GeoInterface polygons as PolyRegions #10

asinghvi17 opened this issue Mar 30, 2024 · 6 comments

Comments

@asinghvi17
Copy link
Contributor

This would only require GeoInterface support, and would allow people to use predefined polygons a lot more easily, plus add support for holes in regions!

If you need a nice point in polygon test, Rasters.jl and GeometryOps.jl have some good implementations.

@asinghvi17
Copy link
Contributor Author

Ah I see you already use PolygonOps - that's the same algorithm which GeometryBasics uses. I think we got the code from there!

@asinghvi17
Copy link
Contributor Author

Another cool thing to do might be to implement the GeoInterface Feature interface for GeoRegions, so that Rasters.jl can easily consume them.

@natgeo-wong
Copy link
Member

Could you link to the documentation on this? I'm very close to publishing v7, so this will probably go into v7.1 or v8.

@asinghvi17
Copy link
Contributor Author

https://juliageo.org/GeoInterface.jl/dev/guides/developer/#Required-for-Feature(Collection)s

and you could just return a NamedTuple with all relevant attributes as the result of GI.properties(::GeoRegion), as well as the underlying GeometryBasics.Polygon as the result of GI.geometry(::GeoRegion). Maybe consider defining e.g. GI.crs as well?

This would also give a standard interface to get "a polygon" from a georegion, where rectregions could construct the polygon on the fly and return it in GI.geometry. Same for tilted regions, I imagine.

@natgeo-wong
Copy link
Member

GeoRegions will construct the polygon automatically when the GeoRegion information is retrieved.

But are you asking if I can integrate and extend GI.properties and other things, that I can do eventually.

@asinghvi17
Copy link
Contributor Author

Will PR if I end up doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants