niemeyer Posted February 26, 2008 Share Posted February 26, 2008 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! Quote Link to comment
CoyoteRed Posted February 26, 2008 Share Posted February 26, 2008 Nifty site. Curiosity asks how are you converting a single number into coordinates? Thanks! Quote Link to comment
niemeyer Posted February 26, 2008 Author Share Posted February 26, 2008 (edited) 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. Edited February 26, 2008 by niemeyer Quote Link to comment
niemeyer Posted February 26, 2008 Author Share Posted February 26, 2008 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. Quote Link to comment
+ReadyOrNot Posted February 26, 2008 Share Posted February 26, 2008 (edited) 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. Edited February 27, 2008 by ReadyOrNot Quote Link to comment
niemeyer Posted February 27, 2008 Author Share Posted February 27, 2008 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. Quote Link to comment
+ReadyOrNot Posted February 27, 2008 Share Posted February 27, 2008 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 Quote Link to comment
niemeyer Posted February 27, 2008 Author Share Posted February 27, 2008 HTTP is also compatible with any programming language. Here is a working sketch, in Python: 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() Quote Link to comment
+lordelph Posted February 27, 2008 Share Posted February 27, 2008 I have a PHP implementation of the algorithm - will release it shortly! Quote Link to comment
+lordelph Posted February 27, 2008 Share Posted February 27, 2008 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! Quote Link to comment
+lordelph Posted February 28, 2008 Share Posted February 28, 2008 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/ Quote Link to comment
+Robespierre Posted February 28, 2008 Share Posted February 28, 2008 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? Quote Link to comment
niemeyer Posted February 28, 2008 Author Share Posted February 28, 2008 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. Quote Link to comment
barryhunter Posted February 28, 2008 Share Posted February 28, 2008 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) Quote Link to comment
niemeyer Posted March 1, 2008 Author Share Posted March 1, 2008 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). Quote Link to comment
+Weary Banker & Bookworm Posted December 4, 2014 Share Posted December 4, 2014 I wonder if anyone is still monitoring this page? It is six years since the last post. Anyway, its worth a try. I have tried to access the www.geohash.org site and received a code 500 error referring me to the webmaster at the site. Unfortunately emails there are returned undeliverable. Can anyone tell me what is happening? Has Geohash finished for good? Quote Link to comment
+kunarion Posted December 4, 2014 Share Posted December 4, 2014 (edited) I wonder if anyone is still monitoring this page? It is six years since the last post. Anyway, its worth a try. I have tried to access the www.geohash.org site and received a code 500 error referring me to the webmaster at the site. Unfortunately emails there are returned undeliverable. Can anyone tell me what is happening? Has Geohash finished for good? Looks like the site is up, but the script has failed. Are you interested in the domain only? If you look up "Geohash", there are sites and software that encode and decode the coordinates. Here's a web site that is very basic, but seems to work even with Geocaching.com's default coordinate system: http://geohash.2ch.to/ Edited December 4, 2014 by kunarion Quote Link to comment
+NYPaddleCacher Posted December 5, 2014 Share Posted December 5, 2014 I wonder if anyone is still monitoring this page? It is six years since the last post. Anyway, its worth a try. I have tried to access the www.geohash.org site and received a code 500 error referring me to the webmaster at the site. Unfortunately emails there are returned undeliverable. Can anyone tell me what is happening? Has Geohash finished for good? Looks like the site is up, but the script has failed. That fits the general definition of a 500 error. Generally it means that the web server is up, it has accepted and has started processing the request (it has started running script or some application that it used to construct a response) but the script/application terminated before a response could be generated, and the server will send a 500 error as a response. Some servers can be configured to intercept a 500 error and generate a custom web page (i.e. Please contact the web master) while in other cases the server just returns a 500 error and the browser will display a page that just indicates that an error 500 was encountered. Quote Link to comment
kanchan Posted December 5, 2014 Share Posted December 5, 2014 While you are at it, I'd like to mention what3words. For example, Groundspeak HQ can be coded: clouds.wink.tame Quote Link to comment
+Weary Banker & Bookworm Posted December 6, 2014 Share Posted December 6, 2014 Thanks Kunarion for your response. I shall look in to that shortly. Quote Link to comment
+Weary Banker & Bookworm Posted December 6, 2014 Share Posted December 6, 2014 Thanks for your response too NYPaddlecacher. It sounds as if you have more knowledge of the workings of the internet than I. However, the error message that I receive when trying the www.geohash.org suggests that I should contact the webmaster at the site . When I did this it was returned. I also seem to remember there was something on the bottom of the original error message to suggest other problems. Does anyone else know of a way to contact these people? Quote Link to comment
snoyes Posted November 5, 2015 Share Posted November 5, 2015 (edited) If I understand the algorithm properly, the geohash 'xkcd' ought to map to the square with latitude between 27.0703125 and 27.24609375 and longitude between 148.359375 and 148.7109375. So you could round it to anything between (27.1 148.4) and (27.2 148.7). But geohash.org outputs (27 149), which is outside the range to the southeast and is actually in square 'xkcc'. The geohash 'ebrb' gives you (1 -0) which is actually in 's00j'. It needs to round to one more decimal place. Edited November 6, 2015 by snoyes Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.