tidwall /tile38

Real-time Geospatial and Geofencing

★ 9,762⑂ 626👁 198⑃ 0● 595▤ 107
GoMITCreated 2016-03-04tile38.com
More from this author
Download: 1.38.01.38.0 ↓1.38.02026-06-09
+1
Daily
9,762
stars
626
forks
198
watchers
0
prs
595
issues
107
releases

README

Tile38 is an open source (MIT licensed), in-memory geolocation data store, spatial index, and realtime geofencing server.
It supports a variety of object types including lat/lon points, bounding boxes, XYZ tiles, Geohashes, and GeoJSON. 


This README is quick start document. You can find detailed documentation at https://tile38.com.







 Features

- Spatial index with search methods such as Nearby, Within, and Intersects.
- Realtime geofencing through webhooks or pub/sub channels.
- Object types of lat/lon, bbox, Geohash, GeoJSON, QuadKey, and XYZ tile.
- Support for lots of Clients Libraries written in many different languages.
- Variety of protocols, including http (curl), websockets, telnet, and the Redis RESP.
- Server responses are RESP or JSON.
- Full command line interface.
- Leader / follower replication.
- In-memory database that persists on disk.

 Components
- tile38-server: The server
- tile38-cli: Command line interface tool
- tile38-benchmark: Server benchmark tool

 Getting Started

 Getting Tile38

Perhaps the easiest way to get the latest Tile38 is to use one of the pre-built release binaries which are available for OSX, Linux, FreeBSD, and Windows. Instructions for using these binaries are on the GitHub releases page.

 Docker 

To run the latest stable version of Tile38:


docker pull tile38/tile38
docker run -p 9851:9851 tile38/tile38


Visit the Tile38 hub page for more information.

 Homebrew (macOS)

Install Tile38 using Homebrew

sh
brew install tile38
tile38-server


 Building Tile38 

Tile38 can be compiled and used on Linux, OSX, Windows, FreeBSD, and probably others since the codebase is 100% Go. We support both 32 bit and 64 bit systems. Go must be installed on the build machine.

To build everything simply:

$ make


To test:

$ make test


 Running 
For command line options invoke:

$ ./tile38-server -h


To run a single server:


$ ./tile38-server

 The tile38 shell connects to localhost:9851
$ ./tile38-cli
 help


 Prometheus Metrics
Tile38 can natively export Prometheus metrics by setting the --metrics-addr command line flag (disabled by default). This example exposes the HTTP metrics server on port 4321:

 start server and enable Prometheus metrics, listen on local interface only
./tile38-server --metrics-addr=127.0.0.1:4321

 access metrics
curl http://127.0.0.1:4321/metrics

If you need to access the /metrics endpoint from a different host you'll have to set the flag accordingly, e.g. set it to 0.0.0.0: to listen on all interfaces.

Use the redis_exporter for more advanced use cases like extracting key values or running a lua script.


 Playing with Tile38

Basic operations:

$ ./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

Top issues

Latest release

1.38.0 1.38.0 2026-06-09
Tile38 is a real-time geospatial and geofencing server.

Build Instructions | Full Changelog

 Added 
- 806: Support multiple Kafka broker addresses in endpoint URL (@badaverse)
- 799: Add RX option for inline object response in SET and FSET (@XanderD99)
- 811: MQTT add SSL and user (@bqstony)

 Fixed
- 194107f: Apply WHERE clause check for cross detection in geofence hooks (@majiayu000)
- b3902cf: Distinguish between hooks and channels in RENAME error message (@majiayu000)
- e16c198: Fix lock (@rohanri)
- 812: Added amqp channel closure on error and connection expiry on closure (

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON