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

TWKB precision #33

Open
JanBaryla opened this issue May 21, 2020 · 4 comments
Open

TWKB precision #33

JanBaryla opened this issue May 21, 2020 · 4 comments

Comments

@JanBaryla
Copy link

When using the toTwkb method on any geometry, the default, hardcoded value for precision is 5. I'd like to go even lower but I don't think it's possible without modifying the library's code.

Is customizing precision something that is planned for the future or is this library's goal to keep things simple? I'd really like to use this and I want to know what my options are.

@nicklasaven
Copy link

nicklasaven commented May 21, 2020

I don't know if there are limitations in the implementation, but there is a limitation in the format itself the constraints precision to maximum value 7. The precision is stored in 4 bits which gives 0 - 7 in the positive range.

@JanBaryla
Copy link
Author

So ideally, the toTwkb method would allow an optional integer parameter in the range of 0-7. What I'm asking is whether it's in the scope of this library, as I wouldn't want to waste anybody's time by writing and submitting a PR with this.

@cschwarz
Copy link
Owner

Yes I would welcome a PR. Please implement it in a similar like the GeoJSONOptions.

@jayarjo
Copy link

jayarjo commented Dec 10, 2020

Is there a PR for this now?

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

4 participants