-
Notifications
You must be signed in to change notification settings - Fork 26
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
API to infer only geometry type/dimension #117
Comments
For reference, in geoarrow-rs we plan to use the |
That seems useful. With &str as input, it's straight forward. With an arbitrary To accommodate that, I guess we'd need to introduce some kind of "peakable" WktReader (name up for debate) that journals anything it consumes during the "infer geometry type/dimension" step so that it can be "replayed" when it comes time to parse to WKT. Some bike-shedding: A
But maybe there's some reason I'm not considering to have a flattened list like you've proposed. Either way, that doesn't seem like a deal breaker to me. |
I'm content with making this an API that uses
That's totally fine with me. |
In cases like GeoArrow, it's nice to know if all input geometries have a common geometry type.
This would mean an API like
and then
infer_type
would only parse up to the first(
character, using that text to infer the geometry type and dimension.There's a tradeoff between time spent first parsing the text to get the geometry types and then again to actually parse the geometries, vs memory overhead of parsing all objects first to
Wkt
objects and then inferring what type of array builder to use.But I figure that scanning a string for the first instance of
(
and matching those first characters should be very fast, especially if no numeric parsing needs to happen for that first stage.Thoughts?
The text was updated successfully, but these errors were encountered: