Skip to content

Increasing the precision of LatLng's toUrlValue#153

Merged
domesticmouse merged 2 commits intogooglemaps:masterfrom
domesticmouse:greater-latln-precision
Apr 29, 2016
Merged

Increasing the precision of LatLng's toUrlValue#153
domesticmouse merged 2 commits intogooglemaps:masterfrom
domesticmouse:greater-latln-precision

Conversation

@domesticmouse
Copy link
Copy Markdown
Contributor

See
#114 (comment)
for context.

@broady
Copy link
Copy Markdown
Contributor

broady commented Apr 29, 2016

Is 9 too much? Can you calculate the average distance where this would make a difference?

Maybe this should be %.6f or something (just the part after the dot).

@domesticmouse
Copy link
Copy Markdown
Contributor Author

Reading through the original report, it looks like %.6f is the current state of play, which the reporter says is affecting their usage of the API. I honestly don't know what the real world distance of round seven significant digits back to six digits is, and I'm not sure who to ask.

@broady
Copy link
Copy Markdown
Contributor

broady commented Apr 29, 2016

http://www2.usgs.gov/faq/categories/9794/3022

At 38 degrees North latitude, one degree of latitude equals approximately 364,000 ft (69 miles), one minute equals 6068 ft (1.15 miles), one-second equals 101 ft; one-degree of longitude equals 288,200 ft (54.6 miles), one minute equals 4800 ft (0.91 mile), and one second equals 80 ft.

69 miles is 111,045m

0.000001 * 111045 = 0.111045

That is, 111mm

%.6f = 111mm
%.7f = 11mm
%.8f = 1mm
%.9f = 1110450nm

That seems good enough for anything we're doing, but yeah, perhaps bumping it up is better. Anywhere between 7 and 9 seems fine.

@broady
Copy link
Copy Markdown
Contributor

broady commented Apr 29, 2016

Also, you want a period before the 9.
%.9f, not %9f

@domesticmouse
Copy link
Copy Markdown
Contributor Author

Thanks for the clarification @broady

I think 1mm precision is good enough.

@broady
Copy link
Copy Markdown
Contributor

broady commented Apr 29, 2016

lg

@domesticmouse domesticmouse merged commit 0964d0d into googlemaps:master Apr 29, 2016
@domesticmouse domesticmouse deleted the greater-latln-precision branch April 29, 2016 07:26
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

Successfully merging this pull request may close these issues.

2 participants