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

Add FeatureWriter to stream writes #205

Merged
merged 1 commit into from
Sep 2, 2022

Conversation

michaelkirk
Copy link
Member

@michaelkirk michaelkirk commented Sep 1, 2022

  • I agree to follow the project's code of conduct.
  • I added an entry to CHANGES.md if knowledge of this change could be valuable to users.

This allows the user to incrementally serialize a FeatureCollection, rather than requiring them to do it one-shot. This is a pretty logical counterpart to the FeatureReader introduced in #199.

@michaelkirk
Copy link
Member Author

michaelkirk commented Sep 1, 2022

Here's an example integration into abstreet: https://github.com/a-b-street/abstreet/compare/master...michaelkirk:mkirk/geojson-writer?expand=1#diff-38d8c6286297dd3e2dac2758061359d82d7d273471512f81e839c0e2b56be395R465

This screen in ABStreet has a CSV export and a GeoJSON export - after this change, the GeoJSON generation code path looks much more like the CSV code path, and they can even share substantial parts of the code path now.

Note that one regression here, at least as far as abstreet is concerned, is that we don't currently support pretty-formatting.

/cc @dabreegster

@dabreegster
Copy link
Contributor

I'm a fan of this and would it use it in a few other projects too. Thanks for improving API ergonomics so much!

Note that one regression here, at least as far as abstreet is concerned, is that we don't currently support pretty-formatting.

Not important to preserve.

Copy link
Member

@urschrei urschrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great addition – makes perfect sense.

@michaelkirk
Copy link
Member Author

bors r=urschrei

@bors
Copy link
Contributor

bors bot commented Sep 2, 2022

Build succeeded:

@bors bors bot merged commit 0d92bd2 into georust:master Sep 2, 2022
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

Successfully merging this pull request may close these issues.

3 participants