![]() ![]() |
| niemeyer |
Feb 26 2008, 08:05 AM
Post
#1
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
Yesterday I've put online a service I've been developing for quite a while,
but just recently I've managed to finish it (it's not a big system, but the time has been on the short side). Basically, http://geohash.org is a site that allows a pair of latitude/longitude to be encoded as a short string, in a way that enables it to be used in references pointing to specific places in a practical form. The person following the link can check where the place is located (through embedded google maps), go to another site for more details (including nearest caches, in geocaching.com), download a GPX waypoint with it, or even send it directly to the GPS (with Garmin Communicator). As an example, at http://geohash.org/c216ne we can find Mount Hood, in Oregon, and from there geocaches around it, Google Maps, etc. I've tried to make the input box quite flexible, accepting pretty much any reasonable format of latitude/longitude. If it doesn't work with your preferred format, please let me know. Nearby places will present similar geohash prefixes, and characters may be stripped from the end of the hash to get a shorter string (and gradually less precise). Enjoy! |
| CoyoteRed |
Feb 26 2008, 08:26 AM
Post
#2
|
|
Geocacher Group: Members Posts: 6,808 Joined: 22-August 02 From: Lowcountry, SC |
Nifty site.
Curiosity asks how are you converting a single number into coordinates? Thanks! |
| niemeyer |
Feb 26 2008, 09:05 AM
Post
#3
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
Bits from the latitude and longitude values are mixed.
I'll write a detailed article, when I get some time, to explain details of the algorithm used. I want to make sure that it stays within public domain, rather than being patented like other algorithms have been. This post has been edited by niemeyer: Feb 26 2008, 03:06 PM |
| niemeyer |
Feb 26 2008, 03:50 PM
Post
#4
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
Here is an explanation about the algorithm used:
http://en.wikipedia.org/wiki/Geohash Hopefully this establishes prior art and allows people to use it for whatever they want. |
| ReadyOrNot |
Feb 26 2008, 03:58 PM
Post
#5
|
|
Self Portrait Group: Premium Members Posts: 2,007 Joined: 3-March 05 From: Clackamas, OR |
Do you have any source code? I'd love to convert this into a SOAP service so others can take advantage in a very simplistic way. It could be as simple as having two functions. Can you host .net apps? If so, let me know and I'd be happy to help out any way I can.
Way cool. This post has been edited by ReadyOrNot: Feb 26 2008, 04:01 PM |
| niemeyer |
Feb 26 2008, 06:19 PM
Post
#6
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
Source code isn't available yet, but it should be trivial to get programmatic access to the system. If you access http://geohash.org/c216ne/text, you'll get a plain text latitude/longitude pair, and if you access, e.g. http://geohash.org/?q=49.26,-123.26 , you get the geohash URL back.
It'd be awesome to see some client libraries available. Let me know if you need any help with that. |
| ReadyOrNot |
Feb 26 2008, 07:19 PM
Post
#7
|
|
Self Portrait Group: Premium Members Posts: 2,007 Joined: 3-March 05 From: Clackamas, OR |
Source code isn't available yet, but it should be trivial to get programmatic access to the system. If you access http://geohash.org/c216ne/text, you'll get a plain text latitude/longitude pair, and if you access, e.g. http://geohash.org/?q=49.26,-123.26 , you get the geohash URL back. It'd be awesome to see some client libraries available. Let me know if you need any help with that. The neat thing about subscribing to a SOAP service is I can use the functions directly in my code. The other neat thing is that its compatible with any programming language. Dim coords as String = myService.GetCoords("c216ne") or Dim text as String = myService.GetText(coords) Once you release the source code, I can write the SOAP service for you. Sounds like more fun than what I'm working on at work right now |
| niemeyer |
Feb 27 2008, 05:30 AM
Post
#8
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
HTTP is also compatible with any programming language. Here is a working sketch, in Python:
CODE from urllib import urlopen def get_coords(geohash): return urlopen("http://geohash.org/%s/text" % geohash).readline() def get_geohash(coords): return urlopen("http://geohash.org/?format=url&q=%s" % coords).readline() |
| lordelph |
Feb 27 2008, 01:02 PM
Post
#9
|
|
Premium Member Group: Premium Members Posts: 578 Joined: 28-August 04 From: Hertfordshire, UK |
I have a PHP implementation of the algorithm - will release it shortly!
|
| lordelph |
Feb 27 2008, 03:06 PM
Post
#10
|
|
Premium Member Group: Premium Members Posts: 578 Joined: 28-August 04 From: Hertfordshire, UK |
My test cases failed, possibly highlighting a difference between the documented algorithm and the one on the geohash website. Have contacted the author to figure out the problem!
|
| lordelph |
Feb 27 2008, 04:48 PM
Post
#11
|
|
Premium Member Group: Premium Members Posts: 578 Joined: 28-August 04 From: Hertfordshire, UK |
Many thanks to Gustavo for updating the algorithm documentation so quickly!
Problem solved, so if anyone would like a PHP implementation of the algorithm, you can get one here: http://blog.dixo.net/2008/02/28/geohash-php-class/ |
| Robespierre |
Feb 27 2008, 06:11 PM
Post
#12
|
|
Once and Future Cacher Group: Premium Members Posts: 1,819 Joined: 20-August 03 From: Crawford County, Ohio |
Honestly, I want to understand.
I entered the coords to my newest cache, and it gave me a map and a few choices for the style of coords - but I don't see the point. What am I missing? |
| niemeyer |
Feb 27 2008, 07:09 PM
Post
#13
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
The point of the service is offering a short URL to link to a given location, so that instead of pointing people to a pair of numbers, you point them to a convenient place where they can more comfortably act on the location.
FWIW, I've built a service primarily for my own use. I'll be happy if it helps other people somehow, but the primary goal has already been met. |
| barryhunter |
Feb 28 2008, 02:43 PM
Post
#14
|
|
Geocacher Group: Members Posts: 322 Joined: 3-July 04 From: Wales, UK |
Thanks to Lordelph, I've added this to a conversion webservice:
http://www.nearby.org.uk/api/convert-help.php example http://www.nearby.org.uk/api/convert.php?k...t=geohash-wgs84 but can cope with coordinates other that lat/long http://www.nearby.org.uk/api/convert.php?k...t=geohash-wgs84 and the otherway http://www.nearby.org.uk/api/convert.php?k...n=geohash-wgs84 http://www.nearby.org.uk/api/convert.php?k...n=geohash-wgs84 (specify the coordinate to avoid confusion with postcodes) (there is soap wrapper too) |
| niemeyer |
Mar 1 2008, 08:21 AM
Post
#15
|
|
Geocacher Group: Members Posts: 21 Joined: 14-January 03 From: Brazil |
Nice site. Thanks for adding support for Geohashes.
I've made some improvements to geohash.org as well, adding support for geocoding of addresses (streets, city names, whatever), implemented a bookmark and a mapplet to help using it from Google Maps (check Tips & Tricks), and also documented the supported query parameters, in case someone would like to build custom tools (in the same document). |
![]() ![]() |
|
Lo-Fi Version | Time is now: 20th November 2009 - 02:40 PM |