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 not honored #107

Open
cuellarirobert opened this issue Oct 1, 2022 · 1 comment
Open

precision not honored #107

cuellarirobert opened this issue Oct 1, 2022 · 1 comment

Comments

@cuellarirobert
Copy link

When comparing the transform_translate function with the transformTranslate function in the JS turf library, the coordinates precision is reduce to 6 values after the decimal in the python library.

Is there a way to get to the precision that I've started with (7).

transform_translate({"coordinates": [5.1036861, 52.0850478], "type": "Point"}, 5.9323754494890855, 63.45775765114114, 'm')

I would expect this to have at least 7, but the response is:

{'coordinates': [5.103764, 52.085072], 'type': 'Point'}

Please help if there's any idea. I tried changing the units to 'cm', but I don't think this was a valid option.

@cuellarirobert
Copy link
Author

it can be fixed. whenever you create a Point object from geojson library, you can add the parameter "precision". i think it's defaulting to 6 decimal places, but it can be arbitrary. you may wish to pass this value down, or just hard-code it to something bigger.

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

1 participant