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

Rust implementation? #54

Closed
gadomski opened this issue May 21, 2024 · 6 comments
Closed

Rust implementation? #54

gadomski opened this issue May 21, 2024 · 6 comments
Labels
question Further information is requested

Comments

@gadomski
Copy link
Member

I was thinking about using the spec document in this repo, along with cribbing some of your code, to make a pure-Rust implementation over at https://github.com/stac-utils/stac-rs. I was curious if ya'll thought it would be more appropriate to build that implementation over here and just depend on stac-rs instead?

Presumably there could be Python bindings into the Rust impl as well, eventually...also guessing @kylebarron has thought about this already :-).

@gadomski gadomski added the question Further information is requested label May 21, 2024
@kylebarron
Copy link
Collaborator

The pure-rust implementation would also convert STAC json to/from Arrow and Parquet? I'd love to see it but I'd imagine that the schema resolution will be a lot of work in Rust. Some of the pyarrow apis make our life a lot easier, and it would be annoying to redo that in Rust. But if you wanted to work on it, I'm of course very supportive

@gadomski
Copy link
Member Author

Tight, alright I'll PoC something over at stac-rs and ping you when it's worth looking at. I've played a bit with https://docs.rs/arrow-json/51.0.0/arrow_json/reader/fn.infer_json_schema_from_iterator.html and I think it will mostly work, with some manual tweaks, but it's still early doors.

@kylebarron
Copy link
Collaborator

That won't work directly on the geometry field any time you have multiple geometry types in a single collection. E.g. if you have polygons most of the time but multi polygons over the antimeridian, it'll fail. We handle that by converting to WKB before inferring a schema from the JSON.

@gadomski
Copy link
Member Author

Gentle, dumb proof-of-concept in this branch: stac-utils/stac-rs#256. The motivating example (for now) is to use STAC-GeoParquet + DuckDB as an API backend.

@kylebarron
Copy link
Collaborator

If you run into any issues, feel free to ask!

@gadomski
Copy link
Member Author

gadomski commented Sep 6, 2024

Released: https://github.com/stac-utils/stac-rs/releases/tag/stac-v0.9.0

@gadomski gadomski closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants