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

csv writer #36

Merged
merged 2 commits into from
May 13, 2022
Merged

csv writer #36

merged 2 commits into from
May 13, 2022

Conversation

michaelkirk
Copy link
Member

Ok, let's try this again (supercedes #33).

FIXES #24

This is a follow up to #30, but for writing CSV's.

]
});

let expected_output = r#"geometry,address,datetime,incident number,type
Copy link
Member Author

@michaelkirk michaelkirk May 13, 2022

Choose a reason for hiding this comment

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

note the column order here is different from what's listed in the geojson. By default geojson doesn't keep it's properties ordered. The underlying serde_json crate offers this as an optional feature. I opened an issue to discuss exposing it in geojson here: georust/geojson#187

I'm not totally sure we'd want to use it, but it might be a nice option since we have a concept of "property idx" in some data formats.

}
}

impl GeomProcessor for BufferingWktWriter {
Copy link
Member Author

Choose a reason for hiding this comment

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

All this explicit delegation is kind of tedious. But I'm not sure of a better way to embed the output of WktWriter into the CSVWriter.

Copy link
Member

Choose a reason for hiding this comment

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

I hope these delegations won't be necessary with the event API anymore.

@pka pka merged commit 7fea413 into georust:master May 13, 2022
@pka pka mentioned this pull request May 16, 2022
michaelkirk added a commit to michaelkirk/geozero that referenced this pull request Jun 29, 2022
I encountered this with my initial approach
(georust#33), and incorporated a
work-around in georust#36, but I failed
to consistently apply the work-around, so it was still broken for some
geometry types.
michaelkirk added a commit to michaelkirk/geozero that referenced this pull request Jun 29, 2022
I encountered this with my initial approach
(georust#33), and incorporated a
work-around in georust#36, but I failed
to consistently apply the work-around, so it was still broken for some
geometry types.
pka pushed a commit that referenced this pull request Jun 30, 2022
I encountered this with my initial approach
(#33), and incorporated a
work-around in #36, but I failed
to consistently apply the work-around, so it was still broken for some
geometry types.
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.

CSV reader/writer
2 participants