wkx icon indicating copy to clipboard operation
wkx copied to clipboard

TWKB precision

Open JanBaryla opened this issue 5 years ago • 4 comments

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.

JanBaryla avatar May 21 '20 07:05 JanBaryla

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.

nicklasaven avatar May 21 '20 08:05 nicklasaven

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.

JanBaryla avatar May 21 '20 18:05 JanBaryla

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

cschwarz avatar May 21 '20 18:05 cschwarz

Is there a PR for this now?

jayarjo avatar Dec 10 '20 06:12 jayarjo