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 windows CRLF line endings for wkt.Unmarshal functions #151

Open
mrwormhole opened this issue Jun 27, 2024 · 0 comments
Open

fix windows CRLF line endings for wkt.Unmarshal functions #151

mrwormhole opened this issue Jun 27, 2024 · 0 comments

Comments

@mrwormhole
Copy link

mrwormhole commented Jun 27, 2024

currently wkt.UnmarhsalPolygon works with

POLYGON ((
    -0.982 51.941,
    -0.982 52.078,
    -1.05 52.078,
    -1.05 51.941,
    -0.982 51.941
))

but if the file is read and passed as it is, line endings are \r\n (on windows) so if you try this will fail, I can not display as it is but above can be written with \n or \r\n line endings

Linux LF endings (works)

"POLYGON ((\n -0.982 51.941,\n -0.982 52.078,\n -1.05 52.078,\n -1.05 51.941,\n -0.982 51.941\n))"

windows CRLF endings (returns an error)

"POLYGON ((\r\n -0.982 51.941,\r\n -0.982 52.078,\r\n -1.05 52.078,\r\n -1.05 51.941,\r\n -0.982 51.941\r\n))"

Note: I can create a fix PR, let me know what you think

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

No branches or pull requests

1 participant