Skip to content

Experimental geospatial rule engine and sandbox playground

License

Notifications You must be signed in to change notification settings

heritechie/zonatic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zonatic

Zonatic is an experimental geospatial rule engine.

It focuses on a simple but often overlooked problem: how geographic boundaries are used to make explicit, deterministic decisions — not just drawn on a map.

This repository provides a hosted sandbox playground where anyone can:

  • a sandbox API for evaluating boundary-based decisions
  • an interactive sandbox UI for authoring and inspecting boundaries

⚠️ Zonatic is a playground and exploration project, not a production-ready service.


What Zonatic is (and is not)

Zonatic is:

  • a boundary-based decision engine
  • deterministic and auditable
  • API-first and agent-friendly
  • focused on rules, not UI

Zonatic is NOT:

  • a tracking application
  • a full SaaS platform
  • a realtime GPS system
  • an AI decision maker

AI (or LLMs) can control Zonatic, but never decide — the core logic remains explicit and deterministic.


Sandbox Concept

Zonatic revolves around the idea of a sandbox.

A sandbox represents an isolated, temporary environment where:

  • a geographic boundary is defined (GeoJSON)
  • location checks are evaluated against that boundary
  • decisions are deterministic and explainable
  • state expires automatically

The sandbox exists in two forms:

  • Sandbox API — for programmatic evaluation
  • Sandbox UI — for interactive authoring and inspection

The sandbox UI lives in the sandbox/ directory.


Try Zonatic in 2 Minutes (API)

1. Open Swagger UI

http://localhost:8080/docs/

This is the fastest way to try Zonatic without writing any code.


2. Create a Sandbox

Call:

POST /sandbox

Response example:

{
  "sandbox_id": "sbx_123abc",
  "token": "sk_zonatic_xxxxx",
  "endpoint": "/sandbox/sbx_123abc/check",
  "expires_at": "2025-01-01T12:00:00Z"
}

Each sandbox:

  • is isolated
  • supports one boundary
  • expires automatically

3. Save Your Boundary

Call:

PUT /sandbox/{id}/boundary

Body example (GeoJSON Polygon):

{
  "type": "Feature",
  "geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [106.8, -6.2],
        [106.81, -6.2],
        [106.81, -6.21],
        [106.8, -6.21],
        [106.8, -6.2]
      ]
    ]
  }
}

4. Check a Location

Call:

POST /sandbox/{id}/check

Body:

{
  "lat": -6.2,
  "lng": 106.8
}

Response:

{
  "status": "INSIDE",
  "explanation": "Location is inside the defined boundary"
}

This result is deterministic and explicit and explainable.


Using Zonatic with ChatGPT (Conceptual)

Zonatic is designed to be agent-friendly.

A common setup:

  • Zonatic exposes a REST API
  • ChatGPT (via Custom GPT Actions) calls the API
  • ChatGPT explains results, but does not make decisions

Example prompt:

Check whether this coordinate is inside my boundary.

Zonatic:

  • evaluates the rule
  • returns a structured decision

ChatGPT:

  • translates the result into natural language

This separation keeps the system auditable and safe.


API Reference

The full API contract is defined in:

GET /openapi.yaml

Interactive documentation:

/docs/

Project Status

  • Core sandbox API: ✅
  • Boundary evaluation: ✅
  • Sandbox UI: ✅ (experimental)
  • Swagger UI: ✅
  • Hosting: experimental
  • Persistence: in-memory (v0)

Planned explorations:

  • group / collective presence checks
  • expected absence / readiness rules
  • MCP-compatible interfaces
  • optional AI-assisted authoring (non-decision)

LICENSE

Apache License 2.0


Why this exists

Zonatic started as an exploration after building a small web component for drawing boundaries. The question that followed was simple:

After a boundary is defined — what decisions does it actually enable?

This repository is an attempt to answer that question, openly and incrementally.

About

Experimental geospatial rule engine and sandbox playground

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •