Skip to content

Lines from geojsonToBinary are rendered "wobbly" #8417

Closed Answered by ffendt
ffendt asked this question in Q&A
Discussion options

You must be logged in to vote

Just found out the problem after further debugging: The used Float32Array for the coordinates, created by geojsonToBinary, does not have enough precision for the coordinates used in my example:

const f32 = new Float32Array(1)
const f64 = new Float64Array(1)
f32.set([4.3678157])
f64.set([4.3678157])

f32[0] // -> 4.3678154945373535
f64[0] // -> 4.3678157

This can be fixed by changing the position data type when creating the binary geojson via geojsonToBinary:

const binaryGeojson = geojsonToBinary(geojson.features, { PositionDataType: Float64Array });

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ffendt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant