This commit is contained in:
tidwall 2018-08-29 14:20:07 -06:00
parent 3a6f366955
commit fb5c5fb244
6 changed files with 80 additions and 68 deletions

View File

@ -2,6 +2,19 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## [1.13.0] - 2018-08-29
### Added
- eef5f3c: Add geofence notifications over pub/sub channels
- 3a6f366: Add NODWELL keyword to roaming geofences
- #343: Add Nats endpoints (@lennycampino)
- #340: Add MQTT tls/cert options (@tobilg)
- #314: Add CLIP subcommand to INTERSECTS
### Changes
- 3ae26e3: Updated B-tree implementation
- 1d78a41: Updated R-tree implementation
## [1.12.3] - 2018-06-16
### Fixed
- #316: Fix AMQP and AMQPS webhook endpoints to support namespaces (@DeadWisdom)

View File

@ -5,7 +5,7 @@
</p>
<p align="center">
<a href="https://join.slack.com/t/tile38/shared_invite/enQtMzQ0OTEwMDUxMzc5LTc0NTJjZmM3YjFhOGZiZGU2NDNjOWEwM2Q5ZWE3MzFiYWZkZDIyN2U2ZmUzZDBmODU0MjI1ZjQ0N2Y1M2I1NTg"><img src="https://img.shields.io/badge/slack-channel-orange.svg" alt="Slack Channel"></a>
<a href="https://github.com/tidwall/tile38/releases"><img src="https://img.shields.io/badge/version-1.12.3-green.svg?" alt="Version"></a>
<a href="https://github.com/tidwall/tile38/releases"><img src="https://img.shields.io/badge/version-1.13.0-green.svg?" alt="Version"></a>
<a href="https://travis-ci.org/tidwall/tile38"><img src="https://travis-ci.org/tidwall/tile38.svg?branch=master" alt="Build Status"></a>
<a href="https://hub.docker.com/r/tile38/tile38"><img src="https://img.shields.io/badge/docker-ready-blue.svg" alt="Docker Ready"></a>
</p>
@ -24,7 +24,7 @@ Tile38 is an open source (MIT licensed), in-memory geolocation data store, spati
## Features
- Spatial index with [search](#searching) methods such as Nearby, Within, and Intersects.
- Realtime [geofencing](#geofencing) through persistent sockets or [webhooks](http://tile38.com/commands/sethook).
- Realtime [geofencing](#geofencing) through [webhooks](http://tile38.com/commands/sethook) or [pub/sub channels](#pub-sub-channels).
- Object types of [lat/lon](#latlon-point), [bbox](#bounding-box), [Geohash](#geohash), [GeoJSON](#geojson), [QuadKey](#quadkey), and [XYZ tile](#xyz-tile).
- Support for lots of [Clients Libraries](#client-libraries) written in many different languages.
- Variety of protocols, including [http](#http) (curl), [websockets](#websockets), [telnet](#telnet), and the [Redis RESP](http://redis.io/topics/protocol).
@ -153,23 +153,7 @@ INTERSECTS searches a collection for objects that intersect a specified bounding
NEARBY searches a collection for objects that intersect a specified radius.
<BR CLEAR="ALL">
### Search options
**SPARSE** - This option will distribute the results of a search evenly across the requested area.
This is very helpful for example; when you have many (perhaps millions) of objects and do not want them all clustered together on a map. Sparse will limit the number of objects returned and provide them evenly distributed so that your map looks clean.<br><br>
You can choose a value between 1 and 8. The value 1 will result in no more than 4 items. The value 8 will result in no more than 65536. *1=4, 2=16, 3=64, 4=256, 5=1024, 6=4098, 7=16384, 8=65536.*<br><br>
<table>
<td>No Sparsing<img src="/pkg/assets/sparse-none.png" width="100" height="100" border="0" alt="Search Within"></td>
<td>Sparse 1<img src="/pkg/assets/sparse-1.png" width="100" height="100" border="0" alt="Search Within"></td>
<td>Sparse 2<img src="/pkg/assets/sparse-2.png" width="100" height="100" border="0" alt="Search Within"></td>
<td>Sparse 3<img src="/pkg/assets/sparse-3.png" width="100" height="100" border="0" alt="Search Within"></td>
<td>Sparse 4<img src="/pkg/assets/sparse-4.png" width="100" height="100" border="0" alt="Search Within"></td>
<td>Sparse 5<img src="/pkg/assets/sparse-5.png" width="100" height="100" border="0" alt="Search Within"></td>
</table>
*Please note that the higher the sparse value, the slower the performance. Also, LIMIT and CURSOR are not available when using SPARSE.*
**WHERE** - This option allows for filtering out results based on [field](#fields) values. For example<br>```nearby fleet where speed 70 +inf point 33.462 -112.268 6000``` will return only the objects in the 'fleet' collection that are within the 6 km radius **and** have a field named `speed` that is greater than `70`. <br><br>Multiple WHEREs are concatenated as **and** clauses. ```WHERE speed 70 +inf WHERE age -inf 24``` would be interpreted as *speed is over 70 <b>and</b> age is less than 24.*<br><br>The default value for a field is always `0`. Thus if you do a WHERE on the field `speed` and an object does not have that field set, the server will pretend that the object does and that the value is Zero.
@ -225,6 +209,22 @@ These can be used when establishing a geofence, to pre-filter responses. For ins
> nearby fleet fence detect enter,exit point 33.462 -112.268 6000
```
### Pub/sub channels
Tile38 supports delivering geofence notications over pub/sub channels.
To create a static geofence that sends notifications when a bus is within 200 meters of a point and sends to the `busstop` channel:
```
> setchan busstop nearby buses fence point 33.5123 -112.2693 200
```
Subscribe on the `busstop` channel:
```
> subscribe busstop
```
## Object types
All object types except for XYZ Tiles and QuadKeys can be stored in a collection. XYZ Tiles and QuadKeys are reserved for the SEARCH keyword only.

View File

@ -4,7 +4,7 @@ set -e
cd $(dirname "${BASH_SOURCE[0]}")
OD="$(pwd)"
VERSION=1.12.3
VERSION=1.13.0
PROTECTED_MODE="no"
# Hardcode some values to the core package

View File

@ -14,6 +14,7 @@ import (
"strings"
"github.com/peterh/liner"
"github.com/tidwall/gjson"
"github.com/tidwall/resp"
"github.com/tidwall/tile38/pkg/client"
"github.com/tidwall/tile38/pkg/core"
@ -350,7 +351,9 @@ func main() {
fmt.Fprintln(os.Stderr, "(error) "+cerr.Err)
mustOutput = false
}
} else if string(msg) == client.LiveJSON {
} else if gjson.GetBytes(msg, "command").String() == "psubscribe" ||
gjson.GetBytes(msg, "command").String() == "subscribe" ||
string(msg) == client.LiveJSON {
fmt.Fprintln(os.Stderr, string(msg))
livemode = true
break // break out of prompt and just feed data to screen

View File

@ -1356,10 +1356,6 @@
"group": "webhook"
},
"SETCHAN": {
"summary": "Creates a pubsub channel which points to geofenced search",
"arguments": [
@ -1444,26 +1440,28 @@
],
"group": "pubsub"
},
"SUBSCRIBE": {
"summary": "Subscribe to a geofence channel",
"arguments":[
{
"name": "channel",
"type": "string",
"variadic": true
}
],
"group": "pubsub"
},
"PSUBSCRIBE": {
"summary": "Subscribes the client to the given patterns",
"arguments":[
{
"name": "pattern",
"type": "pattern",
"variadic": true
}
],
"group": "pubsub"
},
"PDEL": {
"summary": "Removes all objects matching a pattern",
"arguments":[

View File

@ -1522,10 +1522,6 @@ var commandsJSON = `{
"group": "webhook"
},
"SETCHAN": {
"summary": "Creates a pubsub channel which points to geofenced search",
"arguments": [
@ -1610,26 +1606,28 @@ var commandsJSON = `{
],
"group": "pubsub"
},
"SUBSCRIBE": {
"summary": "Subscribe to a geofence channel",
"arguments":[
{
"name": "channel",
"type": "string",
"variadic": true
}
],
"group": "pubsub"
},
"PSUBSCRIBE": {
"summary": "Subscribes the client to the given patterns",
"arguments":[
{
"name": "pattern",
"type": "pattern",
"variadic": true
}
],
"group": "pubsub"
},
"PDEL": {
"summary": "Removes all objects matching a pattern",
"arguments":[