Nazar
Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofence. It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON.
nazar is a Tile38 client in rust!
The API is a bit sane now albeit still weird and unstable.
API will change a lot
Install
In your Cargo.toml file add under [dependencies] section
[dependencies]
nazar = "1.0.7"
Usage
SETcommand
use ;
let n = from;
match n.execute
GETcommand
use ;
let n = from;
match n.execute
- New API to execute T38 command -
cmd,argandexecute_with_args. This is a high-level API to execute Tile38 commands!
let mut n = from;
n.cmd.arg.arg.arg.arg.arg;
match n.execute_with_args ;
PINGto check if the server is live or dead.
use ;
let is_live = ping;
Geofence features
To open a fence only, it is advisable to use new associated method like this:
let n = new;
Then use n to open a geofence like this:
- Open a static
FENCEusingopen_fence:
let work = ;
n.open_fence;
- Open a static geofence with GeoJSON object type.
open_fence_within
let work = ;
n.open_fence_within
- Open a static
FENCEusingopen_fence(use this when to want to communicate with the server as well):
//.....
n.open_fence2;
- Open a static geofence with GeoJSON object type.
open_fence_within(use this when you want to communicate with the server as well):
//.....
n.open_fence_within2;
- Open a static geofence (circular) using
open_fence_and_send(use this when you want to send updates to the client who opened the fence)
n.open_fence_and_send; // client is a NazarSender
- Open a static geofence (polygonal) using
open_fence_within_and_send(use this when you want to send updates to the client who opened the fence)
n.open_fence_within_and_send; // client is a NazarSender
A work in progress
TODO
- Make sane API.
- Documentation
- Roaming
FENCE