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

location coordinates precision #1677

Open
pdmangel2 opened this issue Sep 26, 2024 · 6 comments
Open

location coordinates precision #1677

pdmangel2 opened this issue Sep 26, 2024 · 6 comments
Assignees

Comments

@pdmangel2
Copy link

Hi,

I recently stumbled into a issue with geojson coordinate precision : I use a precsion of 8 digits and when I query orion I get a prcision of 6. However the entitity is saved in the mongo DB with a precision of 8.

Is this intended behaviour ?

Kind regards,
Peter

@kzangeli
Copy link
Collaborator

Hi there,

yes, it is intended, as for when I render the payload body I have to pick some "decent" number of decimals.
I caould not tell you why I picked 6 though. Guess I "inherited" the 6 from Orion.
Would you like me to change it to 8 ?

@kzangeli kzangeli self-assigned this Sep 26, 2024
@pdmangel2
Copy link
Author

Thx for the quick reply, Ken.

  1. is this only for coordinates ? Or for all numbers ?
  2. Why not return the values as stored in mongo ?
  3. If this rerendering is really required, why not make the precision configurable ?

@kzangeli
Copy link
Collaborator

  1. All floating point numbers
  2. Floating point is tricky. Sometimes e.g. 1.9 is stored as 1.899999999999999999999999999999999999999999999 ...
  3. Yes quite required - I respond as a JSON and that's a string :) And yes, I could make it configurable

@pdmangel2
Copy link
Author

In that case I prefer to have it configurable with 6 as default so the behaviour is backward compatible.

@kzangeli
Copy link
Collaborator

That I can do ! :)

@kzangeli
Copy link
Collaborator

I'm supposed to make a new release before Saturday next week.
I'll make sure this issue is included before then.

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