
A fast geo database with LevelDB, Go and Geohashes - kylequest
http://blog.nobugware.com/post/2015/leveldb_geohash_golang/
======
maze-le
What this "geo database" lacks is the ability to make actual spatial queries.

It is one thing to store and retrieve points, lines and polygons in a
database. This is what this stack can do quite well and I suppose for a
certain class of geospatial applications, this is the only capability needed.
But what you can not do is perform complex operations like:
Projection/Reprojection, computing polygon-intersection, computing a convex
hull of a set of geometries, compute a centroid, compute an area... (sort of
everything that postgis can do).

This is not strictly a "geo database", more a key-value store with the ability
to store and retrieve geospatial data.

~~~
chippy
I believe it's even more limited to just storing points. One could do a query
within a bounding box that does not cross the international date line, and
maybe a radius search and that's about it.

Geohashes are good in that it doesn't need any fancy indexing as nearby points
are also nearby in the index.

------
akhenakh
Hey guys author here, didn't know it was posted on HN.

You are right about complex geospatial queries, it's not the purpose of this
simple storage. But someone sent me a promising lib from Google:
[https://docs.google.com/presentation/d/1Hl4KapfAENAOf4gv-
pSn...](https://docs.google.com/presentation/d/1Hl4KapfAENAOf4gv-
pSngKwvS_jwNVHRPZTTDzXXn6Q/view)

It could be applied to this model to make it handle polygons.

------
Jabbles
A few quick code comments:

Now().UnixNano() is not guaranteed to be monotonically increasing. I'd be more
careful if your keys really do need to be unique.

You can use time.Truncate to get the 10 minute interval.

    
    
        var t time.Time
        t = start
        for {
        	if t.After(stop) {
        		break
        	}
        	/* ... */
        	t = t.Add(d)
        }
    

Would usually be written:

    
    
        for t := start; !t.After(stop); t = t.Add(d) {

~~~
akhenakh
It's not actual code but notes for the simplicity of the blog post. Thanks for
the advise I didn't know about Truncate.

------
Bedon292
I was really excited for a new geo database, especially one involving Go. But,
this is extremely limited. I could see some uses for it, but how does it do
when you are storing hundreds of millions of points (or more) rather than a
few million?

