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

Fix: invalid WKT output for CSV's #167

Merged
merged 1 commit into from
Aug 22, 2023

Conversation

michaelkirk
Copy link
Member

@michaelkirk michaelkirk commented Aug 21, 2023

Without the fix, the new tests fail with invalid output:

GEOMETRYCOLLECTION EMPTYPOINT(-122.329051 47.6069),POINT(-122.266529 47.515984)

It's because of a hack in my earlier implementation — because we can't know the number of lines in a CSV before reading it, we can't know the size of the output unless we want to double back or hold the entire thing in memory, which I think is undesirable.

Previously I just said the size was "0" sized because the size was only used to optimize runtime performance, but #160 expects the value it's given to be accurate (which is reasonable) in order to produce valid output.

Another approach might be to have size be some kind of enum to explicitly distinguish between known and unknown sizes, but it makes the api less ergonomic for all the other processors which know their size.

As of georust#160, this breaks with invalid output:

    GEOMETRYCOLLECTION EMPTYPOINT(-122.329051 47.6069),POINT(-122.266529 47.515984)
@pka pka merged commit d200e22 into georust:main Aug 22, 2023
1 check passed
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.

2 participants