-
Notifications
You must be signed in to change notification settings - Fork 8
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
ENH: geography constructor from geoarrow #49
base: main
Are you sure you want to change the base?
ENH: geography constructor from geoarrow #49
Conversation
This reverts commit a01dc4b.
030fb60
to
b2ff23d
Compare
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.
Just left a couple of minor comments.
I'm not very familiar with (geo)arrow but this seems good to go to me.
The maximum distance in meters that a point must be moved to | ||
satisfy the planar edge constraint. This is only used if `planar` | ||
is set to True. | ||
geometry_encoding : str, default None |
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.
geometry_encoding : str, default None | |
geography_encoding : str, default None |
Not sure which is best, though.
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.
Yeah, given this is for geoarrow IO and in geoarrow we generally use the "geometry" term, I thought to keep that as well for the keyword ... But either way it is not ideal.
This depends on paleolimbot/s2geography#23This also introduces the question: how to we deal with functions that depend on a specific version of s2geography? Short term we can just ensure we do a upstream release and require the latest version, but longer term we might need to have some mechanism for this? -> added some version definitions that can be used in C++
Some other notes:
from_geoarrow
that accepts any Arrow-compatible array object (through the Arrow PyCapsule interface). As a result, this is not a numpy vectorized function that will take any dimension of input, it's purely a 1D -> 1D function.__arrow_c_array__
, but probably should also support__arrow_c_stream__
? (given that a lot of other libraries will often only implement that)s2geography::geoarrow::Reader
already supports WKT, WKB and native (nested coordinates) encoding, so those work out of the box here as well.Right now I only accept Arrow input with an extension type and let the Reader figure out the encoding, but we could also add a argument to let the user specify "WKT"/"WKB" and then accept a plain Arrow object (without geoarrow extension type)
from_wkt
that is a normal vectorized function, but the problem is that pybind11'svectorize
doesn't seem to likestd::string
argument input for a vectorized arg. -> this is done in ENH: add from_wkt/to_wkt functions #50