-
Notifications
You must be signed in to change notification settings - Fork 19
New (breaking) Traits based release #33
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
Conversation
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.
Awesome interface. Thank you for the effort again.
|
What is the status of this PR? It would be good to build GeoData.jl polygon operations off this rather than master. |
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 was thrown off by the [WIP] in the title, but the implementation is great! Sorry for my slowness in reviewing this PR!
|
I've been reading over this too now I'm using GeoInterface more. It seems like a real improvement, I'm keen to help getting it merged. My comments so far are:
|
src/interface.jl
Outdated
| getpolygon(geom, i::Integer) = getpolygon(geomtype(geom), geom, i) | ||
|
|
||
| # Other methods | ||
| crs(geom) = missing # or conforming to <:CoordinateReferenceSystemFormat in GeoFormatTypes |
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.
| crs(geom) = missing # or conforming to <:CoordinateReferenceSystemFormat in GeoFormatTypes | |
| crs(geom) = nothing # or conforming to <:CoordinateReferenceSystemFormat in GeoFormatTypes |
README.md
Outdated
| There are also optional generic methods that could help or speed up operations: | ||
| ```julia | ||
| GeoInterface.crs(geom)::Union{Missing, GeoFormatTypes.CoordinateReferenceSystemFormat} | ||
| GeoInterface.extent(geom) # geomtype -> GeoInterface.Rectangle |
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.
extent needs to be implemented.
Could it hold/be a NamedTuple ? Like extent(obj) = Extent((X=(xmin, xmax), Y=(ymin, ymax))) etc for how many dimensions there are, using the :X, :Y, :Z, :M names from the interface.
I find this organisation is easier to use than the xmin, ymin, xmax, ymax style bbox usually uses.
(but somehow I missed that its meant to return a Rectangle. I guess that makes sense in a different way.)
|
I would like to propose an Giving it a specific type means we can dispatch on it, and including the dimension names means we know their order in the object. |
|
Ah yes, I agree that we need some sort of bounds object. I've had issues finding a generic one, hence the default to a @visr Do you remember my magical bbox code that you reviewed and we shelved for it being too complex? I can't seem to find it. edit: Found it here JuliaGeo/GeoInterfaceRFC.jl@527198b#diff-64b0c51af7618fbd8cd973bf88690c8b22c309f9b718e4fdd41b7555769f23fdR25 |
|
Yeah, a With the |
|
Better implementation including And the order doesn't matter for |
|
Cautionary tale against using |
|
Thanks, that's good to know when updating this PR. |
|
Some updates:
Will now use Extents.jl once registered.
Done TODO
And
|
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.
Looking pretty solid to me. I probably have to see it in PRs to give more extensive feedback.
Co-authored-by: Rafael Schouten <[email protected]>
|
I just hit a And |
My bad, I've fixed it and added a test for it. Will add some more tests on the defaults, and enable coverage to prevent this. |
standardise trait arg passing
This fits the header description better, and is the same filename as used for Tables.jl
This makes it more clear what the unused argument is supposed to be.
export the traits
Co-authored-by: Rafael Schouten <[email protected]>
some editing of #33
Based on https://github.com/JuliaGeo/GeoInterfaceRFC.jl
primitives.jl(removed it)getGeometryandgetGeometriesin geos operations LibGEOS.jl#101 andnumGeometriesin geos operations LibGEOS.jl#96)@visr @yeesian @juliohm