News for hackers. Stuff that matters.
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @12:36PM (#13285701)
> I see that it is in Memory, but are there any practical limits?

Yes. The in-memory database is basically a big btree + a big rtree. These trees contain many pointers to geo objects and depending on the complexity of the objects, it may take up a lot of memory. A 16GB machine can typically store 100 million+ points.

> How much memory is recommended for what size datasets?

Depends on the type of object and the length of the keys, but I would conservatively use 128-bytes per point as a general rule. So 16GB machine should support ~135 million points.

> And it doesn't look like the documentation has an examples as to how to load data in?

Please check out http://tile38.com for extra info and docs on commands. Tile38 uses the Redis protocol (https://redis.io/topics/protocol), so it's importing data is similar to https://redis.io/topics/mass-insert.

> Do I need to convert to Web Mercator, or can I give it WGS84 and have it convert? Also, any plans to allow for pure WGS84?

All coordinates are in WGS84 lat/lon, so you should be fine. Under-the-hood the calculations and such are in EPSG:3857 / WGS 84 Web Mercator.

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by Bedon292 on Friday December 30, 2016 @12:52PM (#13285801)
Thanks for the response. I see what I was actually looking for was on http://tile38.com/topics/object-types/ Right there on the front page, and not in the docs tab where I was looking.

For the GeoJSON, does it support properties? Meaning can I store a a whole document in there? Or would it be best to just store an ID and lookup the ID in a DB or something?

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @01:12PM (#13285966)
> For the GeoJSON, does it support properties?

Yes, Tile38 has full GeoJSON support including properties for Feature objects. Though there is one exception, the CRS key is ignored because WGS84 is assumed.

> Meaning can I store a a whole document in there?

Yes, as long as the document conforms to http://geojson.org/geojson-spec.html. Though JSON keys that are not defined in the spec will be stripped out of the document prior to storing in memory. For example, a "properties" key of a type that is not a "Feature" will be stripped, and requesting that object at later time will result in a JSON document that does not include the "properties".

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by mynewtb on Friday December 30, 2016 @06:17PM (#13288363)
The RFC also limits GeoJSON to WGS84 by the way. https://tools.ietf.org/html/rfc7946
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @06:43PM (#13288485)
Thanks for sharing. The draft RFC at the beginning of the year included the CRS key so it must've be a recent decision.
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by derefr on Friday December 30, 2016 @04:40PM (#13287698)
> Tile38 uses the Redis protocol

Under the hood, is Tile38 a distribution of Redis with a Tile38 Redis module?

If so, could the Tile38 module be used in "regular" Redis alongside other Redis modules?

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @05:33PM (#13288073)
It's custom. I explored a Redis fork months ago, prior to the ability for modules. https://github.com/tidwall/redis-gis

I then tried to make a module but redis modules do not support hooking into the pubsub tooling, so Tile38 live geofencing and webhooks were not possible.

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by nrjdhsbsid on Friday December 30, 2016 @05:01PM (#13287854)
Lol looks like this database needs its own database. Yeah seems like it should be a plugin or library not sure why it's standalone if it's just backed by redis.
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @05:34PM (#13288081)
It's not backed by Redis. It's fully standalone. I wish I could have made a redis module back when I started the project, but I'm plenty happy how Tile38 has matured.
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by nrjdhsbsid on Friday December 30, 2016 @07:19PM (#13288639)
Eh, fair enough then. If you don't have to setup redis yourself it doesn't really matter
Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by Opteron67 on Friday December 30, 2016 @03:48PM (#13287311)
> but I would conservatively use 128-bytes per point as a general rule.

why not store close items together in a small block and use offsets + delta encoding ?

Re:Tile38 – Realtime geofencing and geospatial index, v1.7.0 by tidwall on Friday December 30, 2016 @07:44PM (#13288750)
Thanks for the suggestion, I'll need to investigate further. Right now, under the hood Tile38 uses an 3d rtree. Each node clusters 8-16 objects together. I'm always looking for a better way.