mohamedmansour / hackathon-letsgo.io

letsgo.io - Photo Hack Day 4 project
http://letsgo.io
5 stars 6 forks source link

Shorten Latitude/Longitude #44

Closed justinormont closed 11 years ago

justinormont commented 11 years ago

Current sharable urls look like: http://letsgo.io/?q=Hearst+Castle,+CA&from=Big+Sur,+CA&wp=36.272491455078125,-121.81114196777344,35.65024948120117,-121.18644714355469

The precision for Latitude/Longitude numbers are likely too high for our needs, which creates a very long URL.

Work Item: Find the correct length to round the Latitude/Longitude numbers for the purpose of making the URL shorter.

justinormont commented 11 years ago

5 digits beyond the decimal point looks sufficient. This is roughly 1m of accuracy.

Example: lat:37.12345, lng:-122.12345

I'll update the code.

justinormont commented 11 years ago

Done.

URL before: http://letsgo.io/?q=Hearst+Castle,+CA&from=Big+Sur,+CA&wp=36.272491455078125,-121.81114196777344,35.65024948120117,-121.18644714355469

URL after: http://letsgo.io/?q=Hearst+Castle,+CA&from=Big+Sur,+CA&wp=36.27249,-121.81114,35.65025,-121.18645

~30% shorter url, with larger gains once we have full itineraries.