Tile38是一个开源(MIT许可),内存地理定位数据存储,空间索引,实时地理围栏的软件。它支持各种对象类型比如纬度/经度,边镜框,XYZ tiles, Geohashes和GeoJSON。
特性:
*
Spatial index with [search](https://github.com/tidwall/tile38#searching) methods such as Nearby, Within, and Intersects.
*
Realtime [geofencing](https://github.com/tidwall/tile38#geofencing).
*
Variety of client protocols, including [http](https://github.com/tidwall/tile38#http) (curl), [websockets](https://github.com/tidwall/tile38#websockets), [telnet](https://github.com/tidwall/tile38#telnet), and a [native interface](https://github.com/tidwall/tile38#native-interface).
*
Object types of [lat/lon](https://github.com/tidwall/tile38#latlon-point), [bbox](https://github.com/tidwall/tile38#bounding-box), [Geohash](https://github.com/tidwall/tile38#geohash), [GeoJSON](https://github.com/tidwall/tile38#geojson), [QuadKey](https://github.com/tidwall/tile38#quadkey), and [XYZ tile](https://github.com/tidwall/tile38#xyz-tile).
*
Server responses are in json.
*
Full [command line interface](https://github.com/tidwall/tile38#cli).
*
Leader / follower [replication](https://github.com/tidwall/tile38#replication).
*
In-memory database that persists on disk.
*
Simliar feel and syntax style to the fantastic [Redis](http://redis.io) api.
组件:
*
`tile38-server` - The server
*
`tile38-cli` - Command line interface tool
运行tile38
基本操作
<pre class="brush:cpp ;toolbar: true; auto-links: false;">$ ./tile38-cli
# add a couple of points named 'truck1' and 'truck2' to a collection named 'fleet'.
> set fleet truck1 point 33.5123 -112.2693 # on the Loop 101 in Phoenix
> set fleet truck2 point 33.4626 -112.1695 # on the I-10 in Phoenix
# search the 'fleet' collection.
> scan fleet # returns both trucks in 'fleet'
> nearby fleet point 33.462 -112.268 6000 # search 6 kilometers around a point. returns one truck.
# crud operations
> get fleet truck1 # returns 'truck1'
> del fleet truck2 # deletes 'truck2'
> drop fleet # removes all</pre>