{"id":13858903,"url":"https://github.com/mapbox/Hecate","last_synced_at":"2025-07-14T01:32:08.979Z","repository":{"id":45516043,"uuid":"107133902","full_name":"mapbox/Hecate","owner":"mapbox","description":"Fast Geospatial Feature Storage API","archived":false,"fork":false,"pushed_at":"2021-10-09T14:26:35.000Z","size":12027,"stargazers_count":254,"open_issues_count":22,"forks_count":38,"subscribers_count":60,"default_branch":"master","last_synced_at":"2024-10-31T12:09:46.808Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-16T13:50:27.000Z","updated_at":"2024-10-25T21:55:12.000Z","dependencies_parsed_at":"2022-07-18T08:13:17.410Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/Hecate","commit_stats":null,"previous_names":[],"tags_count":161,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2FHecate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2FHecate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2FHecate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2FHecate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/Hecate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225938719,"owners_count":17548540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-05T03:02:25.393Z","updated_at":"2024-11-22T17:30:30.602Z","avatar_url":"https://github.com/mapbox.png","language":"Rust","readme":"\u003ch1 align='center'\u003eHecate\u003c/h1\u003e\n\n\u003cp align=center\u003eOpenStreetMap Inspired Data Storage Backend Focused on Performance and GeoJSON Interchange\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://circleci.com/gh/ingalls/Hecate/tree/master\"\u003e\u003cimg src=\"https://circleci.com/gh/ingalls/Hecate/tree/master.svg?style=shield\"/\u003e\u003c/a\u003e\n  \u003ca href=\"https://crates.io/crates/hecate\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/hecate.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cimg src=\"https://i.imgur.com/xLjiTqL.jpg\"/\u003e\n\n## Hecate Feature Comparison\n\n| Feature               | Hecate             | ESRI MapServer     | OSM Backend        |\n| --------------------- | ------------------ | ------------------ | ------------------ |\n| Vector Tile Creation  | :heavy_check_mark: | :heavy_check_mark: | :x:                |\n| Streaming Query API   | :heavy_check_mark: | :x:                | :x:                |\n| Multi User Support    | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |\n| Feature History       | :heavy_check_mark: | :x:                | :heavy_check_mark: |\n| Atomic API Operations | :heavy_check_mark: | :heavy_check_mark: | :x:                |\n| GeoJSON-LD Based API  | :heavy_check_mark: | :x:                | :heavy_check_mark: |\n| Mapbox GL JS Styling  | :heavy_check_mark: | :heavy_check_mark: | :x:                |\n| Integrated Data Stats | :heavy_check_mark: | :heavy_check_mark: | :x:                |\n\n## Table Of Contents\n\n\u003cdetails\u003e\n\n1. [Brief](#brief)\n1. [Why Use Hecate](#why-use-hecate)\n2. [Table of Contents](#table-of-contents)\n3. [Related Libraries](#related-libraries)\n4. [Build Environment](#build-environment)\n5. [Docker File](#docker-file-coverage-tests)\n6. [Feature Format](#feature-format)\n7. [Server](#server)\n    - [Database Connection](#database)\n    - [JSON Validation](#json-validation)\n    - [Custom Authentication](#custom-authentication)\n8. [API](#api)\n    - [User Options](#user-options)\n    - [Meta](#meta)\n    - [Data Stats](#data-stats)\n    - [Admin Interface](#admin-interface)\n    - [Schema](#schema)\n    - [Webhooks](#webhooks)\n    - [Authentication](#authentication)\n    - [Styles](#styles)\n    - [Vector Tiles](#vector-tiles)\n    - [Downloading Via Clone](#downloading-via-clone)\n    - [Downloading Via Query](#downloading-via-query)\n    - [Boundaries](#boundaries)\n    - [Downloading Individual Features](#downloading-individual-features)\n    - [Downloading Multiple Features](#downloading-multiple-features)\n    - [Feature Creation](#feature-creation)\n    - [Deltas](#deltas)\n    - [OpenStreetMap API](#openstreetmap-api)\n\n\u003c/details\u003e\n\n## Related Libraries\n\n\u003cdetails\u003e\n\n- [HecateJS](https://github.com/mapbox/HecateJS) Javascript Library \u0026 CLI Tool for interacting with the Hecate API\n- [Hecate-Example](https://github.com/ingalls/hecate-example) Script for importing some fake data for testing\n\nBuilt something cool that uses the Hecate API? Let us know!\n\n\u003c/details\u003e\n\n## Build Environment\n\n\u003cdetails\u003e\n\n- Start by installing Rust from [rust-lang.org](https://www.rust-lang.org/en-US/), this will install the current stable version\n\n```bash\ncurl https://sh.rustup.rs -sSf | sh\n```\n\n- Hecate is designed to run on the latest stable version of Rust, but has been thoroughly tested with `1.38.0`. This will install `1.38.0`\n\n```bash\ncurl https://sh.rustup.rs -sSf | sh -s --  --default-toolchain 1.38.0\n```\n\n- Source your `bashrc/bash_profile` to update your `PATH` variable\n\n```bash\nsource ~/.bashrc        # Most Linux Distros, some OSX\nsource ~/.bash_profile  # Most OSX, some Linux Distros\n```\n\n- Download and compile the project and all of it's libraries\n\n```bash\ncargo build\n```\n\n- Ensure you have database dependencies `postgres` and `postgis` installed.\n\n- Create the `hecate` database using the provided schema file. These instructions assume you have set up a role `postgres` with sufficient privileges.\n\n```bash\necho \"CREATE DATABASE hecate;\" | psql -U postgres\n\npsql -U postgres -f src/schema.sql hecate\n```\n\n- This step will also create a database role called `hecate` and `hecate_read`. If\nthe connection fails due to authentication, your pg_hba file may not be set up\nto trust local connections.\n\nYour pb_hba file location can be found using `echo \"show hba_file;\" | psql -U postgres`\n\nReplace the file with the following:\n\n```\nlocal all postgres trust\nlocal all all trust\nhost all all 127.0.0.1/32 trust\nhost all all ::1/128 trust\nhost replication postgres samenet trust\n```\n\n- [Install Node/Npm](https://nodejs.org/en/) for building the frontend code\n\n- [Install Yarn](https://yarnpkg.com/lang/en/docs/install/) for installing\n  frontend dependencies\n\n- Install frontend dependencies\n\n```\ncd web/\nyarn install\n```\n\n- Build frontend UI\n\n```\nyarn build\n```\n\nNote: if actively working on developing the UI, a live reloading server\ncan be started via:\n\n```\nyarn dev\n```\n\n- Start the server\n\n```bash\ncargo run\n```\n\n- Test it is working - should respond with `HTTP200`\n\n```bash\ncurl localhost:8000\n```\n\nYou will now have an empty database which can be populated with your own data/user accounts.\n\nIf you want to populate the database with sample data for testing, [ingalls/hecate-example](https://github.com/ingalls/hecate-example)\nhas a selection of scripts to populate the database with test data.\n\n\u003c/details\u003e\n\n## Docker File (Coverage Tests)\n\n\u003cdetails\u003e\n\nThe Docker file is designed to give the user a testing environment to easily run rust tests.\n\nInstall docker and then run\n\n```\ndocker build .\n\ndocker run {{HASH FROM ABOVE}}\n```\n\n\u003c/details\u003e\n\n## Feature Format\n\n\u003cdetails\u003e\n\nHecate is designed as a GeoJSON first interchange and uses [standard GeoJSON](http://geojson.org/) with a couple additions\nand exceptions as outlined below.\n\n*Supported Geometry Types*\n- `Point`\n- `MultiPoint`\n- `LineString`\n- `MultiLineString`\n- `Polygon`\n- `MultiPolygon`\n\n*Unsupported Geometry Types*\n- `GeometryCollection`\n\n### Additional Members\n\nThe following table outlines top-level members used by hecate to handle feature creation/modification/deletion.\n\nKey/Value pairs in the `.properties` of a given feature are _never_ directly used by the server and are simply\npassed through to the storage backend. This prevents potential conflicts between user properties and required\nserver members.\n\n| Member    | Notes |\n| :-------: | ----- |\n| `id`      | The unique integer `id` of a given feature. Note that all features get a unique id accross GeoJSON Geometry Type |\n| `version` | The version of a given feature, starts at `1` for a newly created feature |\n| `action`  | Only used for uploads, the desired action to be performed. One of `create`, `modify`, `delete`, or `restore` |\n| `key`     | `Optional` A String containing a value that hecate will ensure remains unique across all features. Can be a natural id (wikidata id, PID, etc), computed property hash, geometry hash etc. The specifics are left up to the client. Should an attempt at importing a Feature with a differing `id` but identical `key` be made, the feature with will be rejected, ensuring the uniqueness of the `key` values. By default this value will be `NULL`. Duplicate `NULL` values are allowed.\n| `force`   | `Optional` Boolean allowing a user to override version locking and force UPSERT a feature. Disabled by default |\n\n### Examples\n\n#### Downloaded Features\n\n```JSON\n{\n    \"id\": 123,\n    \"key\": \"Q1234\",\n    \"version\": 2,\n    \"type\": \"Feature\",\n    \"properties\": {\n        \"shop\": true,\n        \"name\": \"If Pigs Could Fly\"\n    },\n    \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [0,0]\n    }\n}\n```\n\nDownloaded Features will return the integer `id` of the feature, the current `version` and the user supplied `properties` and `geojson`.\n`action` is not applicable for downloaded features, it is only used on upload.\n\n#### Create Features\n\n```JSON\n{\n    \"action\": \"create\",\n    \"key\": \"11-22-33-44-1234\",\n    \"type\": \"Feature\",\n    \"properties\": {\n        \"shop\": true,\n        \"name\": \"If Pigs Could Fly\"\n    },\n    \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [0,0]\n    }\n}\n```\n\nA features being uploaded for creation must have the `action: create` property. Since an `id` and `version` have not yet been\nassigned they must be omitted. Should an `id` be included it will be ignored. Adding a `version` property will throw an error.\n\nOptionally create actions can use the `force: true` option to perform an `UPSERT` like option. In this mode the uploader must\nspecify the `key` value. Hecate will then `INSERT` the feature if the `key` value is new, if the `key` is already existing, the\nexisting feature will be overwritten with the forced feature. Note that this mode ignores version checks and is therefore unsafe.\n\nForce Prerequisites\n- Disabled by default, must be explicitly enabled via [Custom Authentication](#custom-authentication)\n- Can only be performed on a feature with `action: create`\n- Must specify a valid `key`\n\n#### Modify Features\n\n```JSON\n{\n    \"id\": 123,\n    \"key\": \"Fn4aAsJ30\",\n    \"version\": 1,\n    \"action\": \"modify\",\n    \"type\": \"Feature\",\n    \"properties\": {\n        \"shop\": true,\n        \"name\": \"If Pigs Could Fly\"\n    },\n    \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [0,0]\n    }\n}\n```\n\nA feature being uploaded for modification must have the `action: modify` as well as the `id` and `version` property. The `id` is the integer id of the feature to modify and the `version` property is the\ncurrent version of the feature as stored by the server. If the version uploaded does not match the version that the server has stored, the modify will fail. This prevents consecutive edits from conflicting.\n\nNote that the modify operation is _not a delta operation_ and the full feature with the complete Geometry \u0026 All Properties must be included with each modify.\n\nAlso note that since the `id` pool is shared accross geometry types, an id is allowed to change it's geometry type. eg. If `id: 1` is a `Point` and then a subsequent `action: modify` with a `Polygon` geometry is performed, `id: 1` is allowed to switch to the new `Polygon` type.\n\n#### Delete Features\n\n```JSON\n{\n    \"id\": 123,\n    \"version\": 1,\n    \"action\": \"delete\",\n    \"type\": \"Feature\",\n    \"properties\": null,\n    \"geometry\": null\n}\n```\n\nA feature being uploaded for deletion must have the `action: delete` as well as the `id` and `version` property. See _Modify Features_ above for an explanation of those properties.\n\nNote the `properties` and `geometry` attributes must still be included. They can be set to `null` or be their previous value. They will be ignored.\n\n#### Restore Features\n\n```JSON\n{\n    \"id\": 123,\n    \"version\": 2,\n    \"key\": \"new-optional-key\",\n    \"action\": \"restore\",\n    \"type\": \"Feature\",\n    \"properties\": {\n        \"test\": true,\n        \"random_array\": [1, 2, 3]\n    },\n    \"geometry\": {\n        \"type\": \"Point\",\n        \"coordinates\": [ 12.34, 56.78 ]\n    }\n}\n```\n\nA feature being uploaded for restoration must have the `action: restore` as well as the `id` and `version` properties. A `restore` action is just a `modify` on a deleted feature.\n\nRestore places the new given geometry/properties at the id specified. It does not automatically roll back the feature to it's state before deletion, if this is desired, one\nmust use the Feature History API to get the state before deletion and then perform the `restore` action.\n\nNote: Restore will throw an error if an feature still exists.\n\n\u003c/details\u003e\n\n## Server\n\nThis section of the guide goes over various options for launching the server\n\nHecate can be launched with default options with\n\n```\ncargo run\n```\n\n### Database\n\n\u003cdetails\u003e\n\n#### Main Connection\n\nBy default hecate will attempt to connect to `hecate@localhost:5432/hecate` for read/write\noperations and simultaneously connect to `hecate_read@localhost:5432/hecate` for\nsandboxed read only operations.\n\nNote that only postgres w/ postgis enabled is supported.\n\nThis database should be created prior to launching hecate. For instructions on setting up the database\nsee the [Build Environment](#build-environment) section of this doc.\n\nA custom database name, postgres user or port can be specified using the database flag.\n\n*Example*\n\n```bash\ncargo run -- --database \"\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n\ncargo run -- --database \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n```\n\n#### Sandbox Connection\n\nA second read-only account should also be created with permissions to SELECT from the\n`geo` \u0026 `deltas` table. This endpoint will only be used for the `query` endpoint, which\nallows arbitrary user query execution. A sample implementation can be found in the `schema.sql` document\n\nNote: It is up to the DB Admin to ensure the permissions are limited in scope for this user. Hecate will\nexpose access to this user via the query endpoint.\n\nIf multiple instances of `database_sandbox` are present, hecate will load balance accross the multiple read instances.\n\n```bash\ncargo run -- --database_sandbox \"\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n\ncargo run -- --database_sandbox \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n\ncargo run -- --database_sandbox \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\" --database_sandbox \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n```\n\n#### Replica Connection [optional]\n\nFinally, optionally multiple `--database_replica` conncetions can be specified which hecate\nwill use to load balance read traffic accross, alleviating capacity on the master db for write operations.\n\n```bash\ncargo run -- --database_replica \"\u003cUSER\u003e:\u003cPASSWORD\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n\ncargo run -- --database_replica \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n\ncargo run -- --database_replica\"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\" --database_replica \"\u003cUSER\u003e@\u003cHOST\u003e/\u003cDATABASE\u003e\"\n```\n\n\n\u003c/details\u003e\n\n### JSON Validation\n\n\u003cdetails\u003e\n\nBy default Hecate will allow any property on a given GeoJSON feature, including nestled arrays, maps, etc.\n\nA custom property validation file can be specified using the schema flag.\n\n*Example*\n\n```bash\ncargo run -- --schema \u003cPATH-TO-SCHEMA\u003e.json\n```\n\nNote hecate currently supports the JSON Schema draft-04. Once draft-06/07 support lands in\n[valico](https://github.com/rustless/valico) we can support newer versions of the spec.\n\n\u003c/details\u003e\n\n### Custom Authentication\n\n\u003cdetails\u003e\n\nBy default the Hecate API is most favourable to a crowd-sourced data server. Any users\ncan access the data/vector tiles, users can create \u0026 manage data, and admins\ncan manage user accounts.\n\nThis provides a middle ground for most users but all endpoints are entirely configurable\nand can run from a fully open server to fully locked down.\n\nIf the default values aren't suitable for what you intend, passing in an authentication\nconfiguration JSON document will override the defaults.\n\n*Example*\n\n```\ncargo run -- --auth path/to/auth.json\n```\n\n__Contents of auth.json__\n```\n{\n    \"endpoints\": {\n        \"server\": \"public\",\n        \"schema\": null,\n        \"mvt\": {\n            \"get\": \"user\",\n            \"regen\": \"admin\",\n            \"meta\": null\n        },\n        \"users\": {\n            \"info\": \"admin\",\n            \"create\": \"admin\",\n            \"create_session\": null\n        },\n\n        ....\n\n    }\n}\n```\n\nIt is important to note that if custom authentication is used, _every_ category must be either disabled or have\nan option for every sub category within it set. One cannot conditionally override only a subset of of the default options. This is for the security of private\nservers, since adding a new API endpoint is a non-breaking change, the server checks that you have specified\na policy for every endpoint or are happy with just the defaults before it will start.\n\nIE:\n\nThe below schema is invalid. Each category (schema, user, style) etc. must be specified as disabled or\nhave a map containing the auth for each subkey.\n\n```\n{\n    \"endpoint\": {\n        \"schema\": null\n    }\n}\n```\n\n#### Behavior Types\n\n| Type          | Description |\n| ------------- | ----------- |\n| `\"public\"`    | Allow any authenticated or unauthenticated user access |\n| `\"admin\"`     | Allow only users with the `access: 'admin'` property on their user accounts access |\n| `\"user\"`      | Allow any user access to the endpoint |\n| `\"self\"`      | Only the specific user or an admin can edit their own metadata |\n| `\"disabled\"`  | Disable all access to the endpoint |\n\n#### Endpoint Lookup\n\n| Example Endpoint                      | Config Name               | Default       | Supported Behaviors           | Notes |\n| ------------------------------------- | ------------------------- | :-----------: | ----------------------------- | :---: |\n| `GET /api`                            | `server`                  | `public`      | All                           |       |\n| **Server Meta**                       | `meta`                    |               | `null`                        | 2     |\n| `GET /api/meta/\u003ckey\u003e`                 | `meta::get`               | `public`      | All                           |       |\n| `POST /api/meta/\u003ckey\u003e`                | `meta::set`               | `admin`       | `user`, `admin`, `disabled`   |       |\n| **JSON Schema**                       | `schema`                  |               | `null`                        | 2     |\n| `GET /api/schema`                     | `schema::get`             | `public`      | All                           |       |\n| **Custom Auth JSON**                  | `auth`                    |               | `null`                        | 2     |\n| `GET /api/auth`                       | `auth::get`               | `public`      | All                           |       |\n| **Mapbox Vector Tiles**               | `mvt`                     |               | `null`                        | 2     |\n| `DELETE /api/tiles`                   | `mvt::delete`             | `admin`       | All                           |       |\n| `GET /api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e`          | `mvt::get`                | `public`      | All                           |       |\n| `GET /api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e/regen`    | `mvt::regen`              | `user`        | All                           |       |\n| `GET /api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e/meta`     | `mvt::meta`               | `public`      | All                           |       |\n| **Users**                             | `user`                    |               | `null`                        | 2     |\n| `GET /api/users`                      | `user::list`              | `user`        | All                           |       |\n| `GET /api/user/info`                  | `user::info`              | `self`        | `self`, `admin`, `disabled`   |       |\n| `GET /api/create`                     | `user::create`            | `public`      | All                           |       |\n| `GET /api/create/session`             | `user::create_session`    | `self`        | `self`, `admin`, `disabled`   |       |\n| **Mapbox GL Styles**                  | `style`                   |               | `null`                        | 2     |\n| `POST /api/style`                     | `style::create`           | `self`        | `self`, `admin`, `disabled`   |       |\n| `PATCH /api/style`                    | `style::patch`            | `self`        | `self`, `admin`, `disabled`   |       |\n| `POST /api/style/\u003cid\u003e/public`         | `style::set_public`       | `self`        | All                           |       |\n| `POST /api/style/\u003cid\u003e/private`        | `style::set_private`      | `self`        | `self`, `admin`, `disabled`   |       |\n| `DELETE /api/style/\u003cid\u003e`              | `style::delete`           | `self`        | `self`, `admin`, `disabled`   |       |\n| `GET /api/style/\u003cid\u003e`                 | `style::get`              | `public`      | All                           | 1     |\n| `GET /api/styles`                     | `style::list`             | `public`      | All                           | 1     |\n| **Deltas**                            | `delta`                   |               | `null`                        | 2     |\n| `GET /api/delta/\u003cid\u003e`                 | `delta::get`              | `public`      | All                           |       |\n| `GET /api/deltas`                     | `delta::list`             | `public`      | All                           |       |\n| **Webhooks**                          | `webhooks`                |               | `null`                        | 2     |\n| `GET /api/webhooks/\u003cid\u003e`              | `webhooks::get`           | `admin`       | All                           |       |\n| `POST /api/webhooks/\u003cid\u003e`             | `webhooks::set`           | `admin`       | All                           |       |\n| **Data Stats**                        | `stats`                   | `public`      | All                           |       |\n| `GET /api/data/stats`                 | `stats::get`              | `public`      | All                           |       |\n| **Features**                          | `feature`                 |               | `null`                        | 2     |\n| `POST /api/data/feature(s)`           | `feature::create`         | `user`        | `user`, `admin`, `disabled`   |       |\n| `GET /api/data/feature/\u003cid\u003e`          | `feature::get`            | `public`      | All                           |       |\n| `GET /api/data/feature/\u003cid\u003e/history`  | `feature::history`        | `public`      | All                           |       |\n| `POST /api/data/feature(s) w/ `force` | `feature::force`          | `admin`       | `user`, `admin`, `disabled`   |       |\n| **Clone**                             | `clone`                   |               | `null`                        | 2     |\n| `GET /api/data/clone`                 | `clone::get`              | `user`        | All                           |       |\n| `GET /api/data/query`                 | `clone::query`            | `user`        | All                           |       |\n| **Bounds**                            | `bounds`                  |               | `null`                        | 2     |\n| `GET /api/bounds`                     | `bounds::list`            | `public`      | All                           |       |\n| `GET /api/bounds/\u003cid\u003e`                | `bounds::get`             | `public`      | All                           |       |\n| `POST /api/bounds/\u003cid\u003e`               | `bounds::create`          | `admin`       | All                           |       |\n| `DELETE /api/bounds/\u003cid\u003e`             | `bounds:delete`           | `admin`       | All                           |       |\n| **OpenStreetMap Shim**                | `osm`                     |               | `null`                        | 2     |\n| `GET /api/0.6/map`                    | `osm::get`                | `public`      | All                           | 3     |\n| `PUT /api/0.6/changeset/\u003cid\u003e/upload`  | `osm::create`             | `user`        | `user`, `admin`, `disabled`   | 3     |\n\n*Notes*\n\n1. This only affectes `public` styles. The `private` attribute on a style overrides this. A `private` style can _never_ be seen publicly regardless of this setting.\n2. This is a category, the only valid option is `null` this will disable access to the endpoint entirely\n3. OSM software expects the authentication on these endpoints to mirror OSM. Setting these to a non-default option is supported but will likely have unpredicable\nsupport when using OSM software. If you are running a private server you should disable OSM support entirely.\n\n\u003c/details\u003e\n\n## API\n\n\u003ch3 align='center'\u003eIndex\u003c/h3\u003e\n\n#### `GET` `/`\n\nHTTP Healthcheck URL, currently returns `Hello World!`\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/'\n```\n\n---\n\n\u003ch3 align='center'\u003eAdmin Interface\u003c/h3\u003e\n\nView the Admin Interface in your browser by pointing to `127.0.0.1:8000/admin/index.html`\n\n---\n\n\u003ch3 align='center'\u003eMeta\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api`\n\nReturn a JSON object containing metadata about the server\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eData Stats\u003c/h3\u003e\n\n\u003cdetails\u003e\n\nNote: Analyze stats depend on the database having `ANALYZE` run.\nFor performance reasons these stats are calculated from ANALYZEd stats\nwhere possible to ensure speedy results. For more up to date stats,\nensure your database is running `ANALYZE` more often. This can be done\nmanually in the database or by using the `/api/data/stats/regen` API.\n\n#### `GET` `/api/data/stats`\n\nReturn a JSON object containing statistics and metadata about the\ngeometries stored in the server\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/stats'\n```\n\n---\n\n#### `GET` `/api/data/stats/regen`\n\nPerform an `ANAYLZE` call on the `geo` table to update\nthe global stats.\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/stats/regen'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eStyles\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/styles`\n\nReturn an array containing a reference to every public style\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/styles'\n```\n\n---\n\n#### `GET` `/api/styles/\u003cuser id\u003e`\n\nReturn an array containing styles owned by a particular user.\n\nBy default any request will only return the public styles for a given user.\n\nIf an authenticated user requests their own styles, it will return their public and private styles.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cuser id\u003e` | `REQUIRED` Numeric ID of the user to get styles from |\n\n*Example*\n\nReturn only public styles of user 1\n\n```bash\ncurl -X GET 'http://localhost:8000/api/styles/1'\n```\n\nUser requesting their own styles will get public \u0026 private styles\n\n```bash\ncurl -X GET \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/styles/1'\n```\n\n---\n\n#### `POST` `/api/style`\n\nCreate a new private style attached to the authenticated user\n\n*Example*\n\n```bash\ncurl \\\n    -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"name\": \"Name of this particular style\", \"style\": \"Mapbox Style Object Here\"}' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/style'\n```\n\n---\n\n#### `DELETE` `/api/style/\u003cid\u003e`\n\nDelete a particular style by id. Users must be authorized and\ncan only delete styles created by them.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given style to delete |\n\n*Example*\n\n```bash\ncurl -X DELETE 'http://localhost:8000/api/style/1'\n```\n\n---\n\n#### `GET` `/api/style/\u003cid\u003e`\n\nGet a particular style by id, public styles can be requested unauthenticated,\nprivate styles can only be obtained by the corresponding user making the request.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given style to download |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/style/1'\n```\n\n---\n\n#### `PATCH` `/api/style/\u003cid\u003e`\n\nUpdate a style - auth required - users can only update their own styles\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given style to download |\n\n*Example*\n\n```bash\ncurl \\\n    -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"name\": \"New Name\", \"style\": \"New Mapbox Style Object Here\"}' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/style/1'\n```\n\n---\n\n#### `POST` `/api/style/\u003cid\u003e/private`\n\nUpdate a public style and mark it as private.\n\nNote: Once a style is public other users may have cloned it. This will not\naffect cloned styles that were made when it was public.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given style to download |\n\n*Example*\n\n```bash\ncurl -X POST \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/style/1/private'\n```\n\n---\n\n#### `POST` `/api/style/\u003cid\u003e/public`\n\nUpdate a style to make it public.\n\nIt will then appear to all users in the global styles list\nand other users will be able to download, clone, and use it\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given style to download |\n\n*Example*\n\n```bash\ncurl -X POST \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/style/1/public'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eSchema\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/schema`\n\nReturn a JSON object containing the schema used by the server or return a 404 if no schema file is in use.\n\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/schema'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eAuthentication\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/auth`\n\nReturns a JSON object containing the servers auth permissions as defined by the default\nauth rules or the custom JSON auth as defined in the `Custom Authentication` section\nof this guide\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/auth'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eVector Tiles\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n\u003cp align=right\u003e\u003cstrong\u003eAdmin Only\u003c/strong\u003e\u003c/p\u003e\n\n#### `DELETE` `/api/tiles`\n\nRemove all tiles from the integrated tile cache\n\n*Example*\n\n```bash\ncurl -X DELETE 'http://localhost:8000/api/tiles\n```\n\n---\n\n#### `GET` `/api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e`\n\nRequest a vector tile for a given set of coordinates. A [Mapbox Vector Tile](https://www.mapbox.com/vector-tiles/) is returned.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cz\u003e` | `REQUIRED` Desired zoom level for tile\n| `\u003cx\u003e` | `REQUIRED` Desired x coordinate for tile\n| `\u003cy\u003e` | `REQUIRED` Desired y coordinate for tle\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/tiles/1/1/1'\n```\n\n---\n\n#### `GET` `/api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e/meta`\n\nReturn any stored metadata about a given tile.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cz\u003e` | `REQUIRED` Desired zoom level for tile\n| `\u003cx\u003e` | `REQUIRED` Desired x coordinate for tile\n| `\u003cy\u003e` | `REQUIRED` Desired y coordinate for tle\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/tiles/1/1/1/meta'\n```\n\n---\n\n#### `GET` `/api/tiles/\u003cz\u003e/\u003cx\u003e/\u003cy\u003e/regen`\n\nAllows an authenticated user to request a new tile for the given tile coordinates,\nensuring the tile isn't returned from the tile cache.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cz\u003e` | `REQUIRED` Desired zoom level for tile\n| `\u003cx\u003e` | `REQUIRED` Desired x coordinate for tile\n| `\u003cy\u003e` | `REQUIRED` Desired y coordinate for tle\n\n*Example*\n\n```bash\ncurl -X GET \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/tiles/1/1/1/regen\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eWebhooks\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/webhooks`\n\nReturn a JSON object containing a list of all webhooks maintained by the server\n\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/webhooks'\n```\n\n---\n\n#### `GET` `/api/webhooks/\u003cid\u003e`\n\nReturn a JSON object containing information about a specific webhook\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e` | `REQUIRED` ID of the webhook to retrieve\n\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/webhooks/1'\n```\n---\n\n#### `POST` `/api/webhooks/\u003cid\u003e`\n\nUpdate a webhook ID with the given webhook data\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e` | `REQUIRED` ID of the webhook to update\n\n\n*Example*\n\n```bash\ncurl\n    -X POST\n    -H \"Content-Type: application/json\" \\\n    -d '{ \"name\": \"webhook name\", \"url\": \"https://example.com\", \"actions\": [\"meta\", \"user\", \"delta\", \"style\"] }' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/webhooks'\n```\n\n#### `DELETE` `/api/webhooks/\u003cid\u003e`\n\nDelete a given webhook\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e` | `REQUIRED` ID of the webhook to delete\n\n*Example*\n\n```bash\ncurl -X DELETE 'http://localhost:8000/api/webhooks/1'\n```\n---\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eUser Options\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/users`\n\nGet a list of users (up to 100) or filter by a given user prefix.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `filter` | `Optional` Desired search prefix for username              |\n| `limit`  | `Optional` Optionally limit the number of returned results |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/users'\n```\n\n---\n\n#### `GET` `/api/user/create`\n\nCreate a new user, provied the username \u0026 email are not already taken\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `username` | `REQUIRED` Desired username, must be unique |\n| `password` | `REQUIRED` Desired password |\n| `email`    | `REQUIRED` Desired email, must be unique |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/user/create?username=ingalls\u0026password=yeaheh\u0026email=ingalls@protonmail.com\n```\n\n---\n\n#### `GET` `/api/user/session`\n\nReturn a new session cookie and the `uid` given an Basic Authenticated request.\n\n*Example*\n\n```bash\ncurl -X GET \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/user/session\n```\n\n---\n\n#### `GET` `/api/user/info`\n\nAllows an authenticated user to obtain information about their own account\n\n*Example*\n\n```bash\ncurl -X GET \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/user/info'\n```\n\n---\n\u003cp align=right\u003e\u003cstrong\u003eAdmin Only\u003c/strong\u003e\u003c/p\u003e\n\n#### `GET` `/api/user/\u003cid\u003e`\n\nObtain information about any user in the system by their numeric User ID.\n\nNote the information returned is the same information that a user is able to\nlookup about themself with the `GET /api/user/info` endpoint.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e`     | `REQUIRED` User ID to obtain user information of |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/user/create?username=ingalls\u0026password=yeaheh\u0026email=ingalls@protonmail.com\n```\n\n---\n\u003cp align=right\u003e\u003cstrong\u003eAdmin Only\u003c/strong\u003e\u003c/p\u003e\n\n#### `PUT` `/api/user/\u003cid\u003e/admin`\n\nAllows an admin to add another user to the admin pool.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e`     | `REQUIRED` User ID to obtain user information of |\n\n*Example*\n\n```bash\ncurl -X PUT \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/user/1/admin'\n```\n\n---\n\u003cp align=right\u003e\u003cstrong\u003eAdmin Only\u003c/strong\u003e\u003c/p\u003e\n\n#### `DELETE` `/api/user/\u003cid\u003e/admin`\n\nAllows an existing admin to remove another user from the admin pool.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e`     | `REQUIRED` User ID to obtain user information of |\n\n*Example*\n\n```bash\ncurl -X DELETE \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/user/1/admin'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eDownloading via Clone\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/data/clone`\n\nReturn a Line-Delimited GeoJSON stream of all features currently stored on the server.\n\nNote: All streaming GeoJSON endpoints will send the Unitcode End Of Transmission, EOT\n(`0x04`) on stream completion. This can be used to ensure that a stream did not exit early.\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/clone'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eDownloading via Query\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/data/query`\n\nReturn a Line-Delimited GeoJSON stream of all features that match the given query.\n\nThe query must be a valid SQL query against the `geo` table. Note that the `geo` is\nthe only table that this endpoint can access. Only read operations are permitted.\n\nNote: All streaming GeoJSON endpoints will send the Unitcode End Of Transmission, EOT\n(`0x04`) on stream completion. This can be used to ensure that a stream did not exit early.\n\nIE:\n\n```SQL\nSELECT count(*) FROM geo\n```\n\n```SQL\nSELECT props FROM geo WHERE id = 1\n```\n\n*Options*\n\n| Option          | Notes                                                        |\n| :-------------: | ------------------------------------------------------------ |\n| `query=\u003cquery\u003e` | SQL Query to run against Geometries                          |\n| `limit=\u003climit\u003e` | `Optional` Optionally limit the number of returned results   |\n\n*Examples*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/query?query=SELECT%20count(*)%20FROM%20geo'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/query?query=SELECT%20props%20FROM%20geo%20WHERE%20id%20%3D%201'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eBoundaries\u003c/h3\u003e\n\n\u003cdetails\u003e\n\nBoundaries allow downloading data via a set of pre-determined boundary files.\n\n#### `GET` `/api/data/bounds`\n\nReturn an array of possible boundary files with which data can be extracted from the server with\n\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `filter` | `Optional` Desired search prefix for username              |\n| `limit`  | `Optional` Optionally limit the number of returned results |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/bounds'\n```\n\n---\n\n#### `GET` `/api/data/bounds/\u003cbounds\u003e`\n\nReturn line delimited GeoJSON `Feature` of all the geometries within the specified boundary file.\n\nNote: All streaming GeoJSON endpoints will send the Unitcode End Of Transmission, EOT\n(`0x04`) on stream completion. This can be used to ensure that a stream did not exit early.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cbounds\u003e` | `REQUIRED` One of the boundary files as specified via the `/ap/data/bounds` |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/bounds/us_dc'\n```\n\n---\n\n#### `POST` `/api/data/bounds/\u003cbounds\u003e`\n\nCreate or replace a boundary with the given name.\n\nNote: Boundaries must be a `Polygon` or `MultiPolygon` Feature GeoJSON.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cbounds\u003e` | `REQUIRED` the name of the bounds to create or replace |\n\n*Example*\n\n```bash\ncurl -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"type\": \"Feature\", \"properties\": {}, \"geometry\": { \"type\": \"Point\", \"coordinates\": [ 1.1, 1.1 ] } }' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/data/bounds/us_dc'\n```\n\n---\n\n#### `DELETE` `/api/data/bounds/\u003cbounds\u003e`\n\nDelete a bounds file with the given name.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cbounds\u003e` | `REQUIRED` the name of the bounds to create or replace |\n\n*Example*\n\n```bash\ncurl -X DELETE \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/data/bounds/us_dc'\n```\n\n---\n\n#### `GET` `/api/data/bounds/\u003cbounds\u003e/stats`\n\nReturn statistics about geometries that intersect a given bounds\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cbounds\u003e` | `REQUIRED` One of the boundary files as specified via the `/ap/data/bounds` |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/bounds/us_dc/stats'\n```\n\n---\n\n#### `GET` `/api/data/bounds/\u003cbounds\u003e/meta`\n\nReturn GeoJSON feature representing the bound\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cbounds\u003e` | `REQUIRED` One of the boundary files as specified via the `/ap/data/bounds` |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/bounds/us_dc/meta'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eDownloading Individual Features\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/data/feature`\n\nReturn a single GeoJSON `Feature` given a query parameter\n\n*Options*\n\n| Option            | Notes                                                     |\n| :----:            | --------------------------------------------------------- |\n| `key=\u003ckey\u003e`       | `Optional` Key value to retrieve a given feature by       |\n| `point=\u003clng,lat\u003e` | `Optional` Query for a single feature at the given point  |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/feature?key=123'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/feature?point=1.1324%2C-45.322'\n```\n\n---\n\n#### `GET` `/api/data/feature/\u003cid\u003e`\n\nReturn a single GeoJSON `Feature` given its' ID.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given feature to download |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/feature/1542'\n```\n\n---\n\n#### `GET` `/api/data/feature/\u003cid\u003e/history`\n\nReturn an array containing the full feature history for the provided feature id.\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Numeric ID of a given feature to download |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/feature/1542/history'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eDownloading Multiple Features\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/data/features`\n\nReturn streaming Line-Delimited GeoJSON within the provided BBOX or Point\n\nNote: All streaming GeoJSON endpoints will send the Unicode End Of Transmission, EOT\n(`0x04`) on stream completion. This can be used to ensure that a stream did not exit early.\n\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `bbox=\u003cminX,minY,maxX,maxY\u003e` | `Optional` Bounding Box in format `left,bottom,right,top` |\n| `point=\u003cLng,Lat\u003e` | `Optional` Point to query for intersections |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/features/?bbox=-122.51791%2C37.60447%2C-122.35499%2C37.83244'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/features/?point=-95.2734375%2C36.03133177633187'\n```\n\n#### `GET` `/api/data/features/history`\n\nReturn streaming Line-Delimited GeoJSON of all versions of features that fall within the provided BBOX or Point. This includes the current version of the feature. Features in `delete` state will not be included as their geometries are not recorded.\n\nNote: All streaming GeoJSON endpoints will send the Unicode End Of Transmission, EOT\n(`0x04`) on stream completion. This can be used to ensure that a stream did not exit early.\n\n\n*Options*\n\n| Option | Notes |\n| :----: | ----- |\n| `bbox=\u003cminX,minY,maxX,maxY\u003e` | `Optional` Bounding Box in format `left,bottom,right,top` |\n| `point=\u003cLng,Lat\u003e` | `Optional` Point to query for intersections |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/features/history?bbox=-122.51791%2C37.60447%2C-122.35499%2C37.83244'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/data/features/history?point=-95.2734375%2C36.03133177633187'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eFeature Creation\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `POST` `/api/data/feature` *Auth Required*\n\nCreate, Modify, or Delete an individual GeoJSON `Feature`\n\nThe Feature must follow format defined in [Feature Format](#feature-format).\n\nThe feature also must contain a top-level String `message` attribute describing the changes being made (The delta message)\n\n*Example*\n\n```bash\ncurl \\\n    -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"action\": \"create\", \"message\": \"Random Changes\", \"type\":\"Feature\",\"properties\":{\"shop\": true},\"geometry\":{\"type\":\"Point\",\"coordinates\":[0,0]}}' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/data/feature'\n```\n\n---\n\n#### `POST` `/api/data/features` *Auth Required*\n\nCreate, Modify, and/or Delete many features via a GeoJSON `FeatureCollection`\n\nThe Features in the FeatureCollection must follow format defined in [Feature Format](#feature-format).\n\nThe FeatureCollection also must contain a top-level String `message` attribute describing the changes being made (The delta message)\n\nNote that a mix of `create`, `modify`, and `delete` operations are allowed\nwithin each `FeatureCollection`\n\n*Example*\n\n```bash\ncurl \\\n    -X POST \\\n    -H \"Content-Type: application/json\" \\\n    -d '{\"type\":\"FeatureCollection\",\"message\":\"A bunch of changes\",\"features\": [{\"action\": \"create\", \"type\":\"Feature\",\"properties\":{\"shop\": true},\"geometry\":{\"type\":\"Point\",\"coordinates\":[0,0]}}]}' \\\n    -u 'username:password' \\\n    'http://localhost:8000/api/data/features'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eDeltas\u003c/h3\u003e\n\n\u003cdetails\u003e\n\n#### `GET` `/api/deltas`\n\nReturns an array of the last `limit` defined number of deltas (default: 20). with their corresponding metadata. Does not include geometric\ndata on the delta. Request a specific delta to get geometric data.\n\nThe deltas endpoint has 2 modes. The first is a fixed list of the last `n` deltas. The second is listing deltas by time stamp. the query parameters\nfor these two modes are mutually exclusive.\n\n*Limit Options*\n\nReturn the last `n` deltas starting at the specified `offset`.\n\nWhere `n` defaults to 20 and can be up to 100 by utilizing the `limit` parameter\n\n| Option              | Notes |\n| :-----------------: | ----- |\n| `offset=\u003coffset\u003e`   | `OPTIONAL` Returns deltas before the given offset |\n| `limit=\u003climit\u003e`     | `OPTIONAL` Increase or decrease the max number of returned deltas (Max 100) |\n\n*Date Options*\n\nReturn deltas between a given `start` and `end` parameter.\n\nThe `start` parameter should be the most recent TIMESTAMP, while the `end` parameter\nshould be the furthest back in time.\n\nIE: `start` \u003e `end`.\n\n```\n   |---------|------|\nCurrent    start   end\n Time\n```\n\n- If both `start` and `end` are specified, return all deltas by default\n- If `start` or `end` is specified, return last 20 deltas or the number specified by `limit`\n\n| Option           | Notes |\n| :--------------: | ----- |\n| `start=\u003cstart\u003e`  | `OPTIONAL` Return deltas after n time - ISO 8601 compatible timestamp |\n| `end=\u003cend\u003e`      | `OPTIONAL` Return deltas before n time - ISO 8601 compatible timestamp |\n| `limit=\u003climit\u003e`  | `OPTIONAL`  Increase or decrease the max number of returned deltas (Max 100) |\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/deltas'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/deltas?offset=3'\n```\n\n```bash\ncurl -X GET 'http://localhost:8000/api/deltas?offset=3\u0026limit=100'\n```\n\n---\n\n#### `GET` `/api/deltas/\u003cid\u003e`\n\nReturns all data for a given delta as a JSON Object, including geometric data.\n\n*Options*\n\n| Option     | Notes |\n| :--------: | ----- |\n| `\u003cid\u003e` | `REQUIRED` Get all data on a given delta\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/delta/4'\n```\n\n\u003c/details\u003e\n\n---\n\n\u003ch3 align='center'\u003eOpenStreetMap API\u003c/h3\u003e\n\nThe primary goal of the hecate project is a very fast GeoJSON based Interchange. That said, the tooling the OSM community has built around editing is unparalleled. As such,\nHecate provides a Work-In-Progress OpenStreetMap Shim to support a subset of API operations as defined by the [OSM API v0.6](httpl://wiki.openstreetmap.org/wiki/API_v0.6) document.\n\n\u003cdetails\u003e\n\n*Important Notes*\n- All GeoJSON types can be downloaded via the API and viewed in JOSM\n- MultiPoints\n    - Are represented using an OSM  `Relation`\n    - The type will be `multipoint`\n    - The member type will be `point`\n- MultiLineStrings\n    - Are represented using an OSM `Relation`\n    - The type will be `multilinestring`\n    - The member will be `line`\n- Uploading `Way` \u0026 `Relation` types are not currently supported, attempting to upload them may produce undesirable results.\n\nThe following incomplete list of endpoints are implemented with some degree of coverage with the OSM API Spec but are likely incomplete/or written with the minimum flexibility required to\nsupport editing from JOSM. See the code for a full list.\n\n#### `GET` `/api/capabilities`\n#### `GET` `/api/0.6/capabilities`\n\nReturn a static XML document describing the capabilities of the API.\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/capabilities'\n```\n\n---\n\n#### `GET` `/api/0.6/user/details` *Auth Required*\n\nReturns a static XML document describing the number of unread messages that a user has. Every n minutes JOSM checks\nthis and displays in the interface if there is a new message, to cut down on errors it simply returns a 0 message response.\n\n*Example*\n\n```bash\ncurl -X GET 'http://localhost:8000/api/0.6/user/details'\n```\n\n---\n\n#### `PUT` `/api/0.6/changeset/create` *Auth Required*\n\nCreate a new changeset and set the meta information, returning the opened id.\n\n*Example*\n\n```bash\ncurl \\\n    -X PUT \\\n    -d '\u003cosm\u003e\u003cchangeset\u003e\u003ctag k=\"comment\" v=\"Just adding some streetnames\"/\u003e\u003c/changeset\u003e\u003c/osm\u003e' \\\n    'http://localhost:8000/api/0.6/changeset/create\n```\n\n---\n\n#### `GET` `/api/0.6/changeset/\u003cchangeset_id\u003e/upload` *Auth Required*\n\nUpload osm xml data to a given changeset\n\n*Example*\n\n```bash\ncurl \\\n    -X POST \\\n    -d '\u003cdiffResult version=\"0.6\"\u003eNODE/WAY/RELATIONS here\u003c/diffResult\u003e' \\\n    'http://localhost:8000/api/0.6/changeset/1/upload'\n```\n\n---\n\n#### `PUT` `/api/0.6/changeset/\u003cchangeset_id\u003e/close` *Auth Required*\n\nClose a given changeset, preventing further modification to it\n\n*Example*\n\n```bash\ncurl -X PUT 'http://localhost:8000/api/0.6/changeset/1/close'\n```\n\n\u003c/details\u003e\n\n---\n","funding_links":[],"categories":["Rust","Geospatial Library"],"sub_categories":["Rust"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2FHecate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2FHecate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2FHecate/lists"}