-
Notifications
You must be signed in to change notification settings - Fork 172
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
WKT decimals precision #196
Comments
|
Hi @macoapps, thanks for sharing this. What you are describing is the default WKT writing behavior from geos. geos does offer some settings we can expose that would allow you to configure the level of precision being used (and whether it should trim trailing zeros). Let's consider this a feature request for a future version of GEOSwift. If anyone is interested in working on this, we welcome contributions. You'll want to look at In each case, we could update Both new initializer arguments would have default values of the |
|
This would be great ! That's exactly what I need :) |
|
@macdrevx I've just made a few tests, and it seems to work for my own case, but I have a doubt about the roundingPrecision usage. And below is the same sample with a rounding precision set to 18. I think the number of digits is not right (19 instead of 18). But maybe I'm wrong |
|
@macoapps I think it actually looks okay. When using fixed precision, you would ignore leading and trailing 0s when counting for precision. I'll add some more test cases to this PR that demonstrate a variety of different behaviors. |
|
Here's a link to the test cases I've added that demonstrate expected behaviors: 71bbf2e#diff-8418771f54cbfe5b4dbc2ef25375bb9bR105 Note that these behaviors are defined by the underlying geos library, not GEOSwift, so we don't have too much room to modify them. |
|
I'm going ahead with releasing this change as v6.1.0. If we decide that what you described is actually a bug after all, we can do a patch. |
|
Sounds nice ! Thx for your awesome work 👍 |
Hi,
there's a problem with the .wkt() function.
For example :
I think the generated string from my real data is twice the size it should be :(
The text was updated successfully, but these errors were encountered: