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

lat lon precision and/or truncation #89

Open
pmpowers-usgs opened this issue May 9, 2017 · 3 comments
Open

lat lon precision and/or truncation #89

pmpowers-usgs opened this issue May 9, 2017 · 3 comments

Comments

@pmpowers-usgs
Copy link
Member

When entering specific decimal lat lon coordinates, the widget truncates the entered values on clicking 'search'. In the earthquake-hazard-tool, the value is truncated to a single decimal place; in earthquake-usdesign the value is truncated to 0 decimal places.

One could argue that this does not instill user confidence that the values they entered will be used for a calculation and that if a user enters lat=32.045 then the field should preserve that value.

Of course, if a user enters something unreasonably precise 32.0450123471, truncating to 4 or 5 decimal places is probably ok.

@jmfee-usgs
Copy link
Contributor

Can you clarify how the decimal coordinates are being entered? This is using the location view rather than the input boxes?

This suggests we round to 3 decimals in earthquake-hazard-tool, unless they were entered manually:
https://github.com/usgs/earthquake-hazard-tool/blob/master/src/htdocs/js/input/Location.js#L178

@pmpowers-usgs
Copy link
Member Author

Scratch the original comment. The issue is the precision comparison between the two fields on the 'x,y' option of the location view. If I enter 40.0 and -117.25, my location is changed to 40.0 and -117.3, and that is where the pin drops. Moreover, the first click on search will shorten 40.0 to 40, at which point a second click will set my longitude to -117, because my lat precision has decreased.

I would set a hard limit of 5 decimal places (meter-scale precision more or less) regardless, and just leave user entered values alone below that precision, other than checking for them being valid lat-lon values.

@jmfee-usgs
Copy link
Contributor

I think it's attempting to keep similar precision between latitude and longitude values. For example, if I enter 40.00 and -117.25 the values are preserved without rounding; even though the trailing zeros are removed from the latitude...

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