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

precision lose when using latitude and longitude #29

Closed
carlin314 opened this issue Jun 5, 2020 · 3 comments
Closed

precision lose when using latitude and longitude #29

carlin314 opened this issue Jun 5, 2020 · 3 comments

Comments

@carlin314
Copy link

The correct line is red, while converted spatilite is purple, what can be the reason?

I hope you can help me to figure it out

image

My test geojson
1591263744_bak.geojson.tar.gz

@carlin314
Copy link
Author

I found it is cause by geojson library used by you, its defualt precision is 6

@chris48s
Copy link
Owner

chris48s commented Jun 7, 2020

You are right that this behaviour is caused by a third-party library. There's a long thread about this at jazzband/geojson#135 and I understand why they've made this decision ( https://tools.ietf.org/html/rfc7946#section-11.2 ) but I feel like the implementation is a bit unhelpful and the issue is going nowhere.

In this library, using geojson was helpful for a bit of validation on load, but beyond that its not really buying me a lot over a straight json.load(). Given it introduces a problem here and there isn't really a good workaround, I've just published version 0.3.1 which drops the dependency on geojson and removes this rounding issue.

Give it a try.

@carlin314
Copy link
Author

It work fine, thx for your work

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

2 participants