11

GeoHash is an excellent method to code the latitude and longitude of a point into a string. It's concise, due to the use of numbers + letters, and the precision can be tuned adding characters at the end.

I'm looking for an equivalent method to code polygons, not points. I saw two ways to do it:

I would like the code could be manipulated by humans, ie. manually copied, not only by machines as an index.

Edit: see also the discussion (in French) at http://seenthis.net/messages/269838.

  • Welcome to GIS SE, are you open to use any python/geo library? – artwork21 Jun 23 '14 at 19:50
  • Clearly yes. But the question is more about concepts and algorithms than implementations. – Sylvain Lesage Jun 23 '14 at 20:00
6

Have a look at Georaptor. Creates a compressed set of geohashes, i.e., a combination of geohashes at different levels.

| improve this answer | |
2

The most robust implementation is in the s2 geometry library with its Polygon Cover implementation. Uses S2CellIds, an improvement upon GeoHashes, as its unit.

| improve this answer | |
1

With recent release by Google of Open Location Code, there was a good questioning about Geohash. Infortunately, I didn't see something about polygons Geohash.

As you are looking for various implementations for Geohash like solutions, look at Google comparison of various algorithms and solutions at https://github.com/google/open-location-code/blob/master/docs/comparison.adoc

It's clearly for points but it may help you for your polygon Geohash "quest".

| improve this answer | |
1

A very simple implementation would be to perform BFS filling the polygon with the geohashes. Then you can recursively breakdown the edges into higher precision.

enter image description here

Here's an example Example BFS

| improve this answer | |
0

The PostGIS function ST_GeoHash returns a GeoHash based on the input geometry type. Of course, any geometry other than a Point would result in lower precision.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.