{"id":21042574,"url":"https://github.com/sliceosm/sliceosm-api","last_synced_at":"2025-04-29T08:56:34.809Z","repository":{"id":256243861,"uuid":"854668086","full_name":"SliceOSM/sliceosm-api","owner":"SliceOSM","description":"Web API for interacting with an .osmx database","archived":false,"fork":false,"pushed_at":"2025-03-03T19:40:26.000Z","size":3098,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-29T08:56:28.421Z","etag":null,"topics":["openstreetmap"],"latest_commit_sha":null,"homepage":"","language":"Go","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/SliceOSM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-09T15:17:27.000Z","updated_at":"2025-04-02T23:12:56.000Z","dependencies_parsed_at":"2024-09-09T20:34:41.304Z","dependency_job_id":"0c429860-f1ce-4ebd-970a-25f598df6a3f","html_url":"https://github.com/SliceOSM/sliceosm-api","commit_stats":null,"previous_names":["sliceosm/api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SliceOSM%2Fsliceosm-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SliceOSM%2Fsliceosm-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SliceOSM%2Fsliceosm-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SliceOSM%2Fsliceosm-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SliceOSM","download_url":"https://codeload.github.com/SliceOSM/sliceosm-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251470282,"owners_count":21594524,"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":["openstreetmap"],"created_at":"2024-11-19T14:06:15.789Z","updated_at":"2025-04-29T08:56:34.790Z","avatar_url":"https://github.com/SliceOSM.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sliceosm-api\n\nA lightweight web server for submitting extract tasks to an [OSM Express](http://github.com/bdon/OSMExpress) database.\n\n## Usage\n\n```\nUsage: ./sliceosm-api [OPTIONS] OSMX_FILE\n\nOptions:\n  -bind string\n        IP address and port to listen on\n  -exec string\n        Path to OSMX executable\n  -filesDir string\n        Result directory\n  -nodesLimit int\n        Nodes limit (default 100000000)\n  -sentryDsn string\n        Sentry DSN\n```\n\n## API\n\n### Quickstart example\n\n```sh\ncurl -X POST https://slice.openstreetmap.us/api/ -d '{\"Name\":\"none\",\"RegionType\":\"geojson\",\"RegionData\":{\"type\":\"Polygon\",\"coordinates\":[[[-77.4571,37.5530],[-77.4571,37.5272],[-77.4133,37.5272],[-77.4133,37.5530],[-77.4571,37.5530]]]}}'\n# 2637da98-20a1-428f-b6db-18ac2861b763\ncurl https://slice.openstreetmap.us/api/2637da98-20a1-428f-b6db-18ac2861b763\n# when Complete is true, fetch the file:\ncurl https://slice.openstreetmap.us/files/2637da98-20a1-428f-b6db-18ac2861b763.osm.pbf -o out.osm.pbf\n```\n\n### GET `/`\n\nReturns:\n\n- the last updated timestamp\n- the nodes limit for the server\n- the number of jobs in the queue\n\n### GET `/nodes.png`\n\nReturns an PNG-encoded representation of OSM node density.\n\n### POST `/`\n\nCreate a task.\n\nExamples of creating tasks: (your `.osmx` database must include Richmond, Virginia)\n\n```\ncurl -X POST http://localhost:8080 -d '{\"Name\":\"none\", \"RegionType\":\"bbox\", \"RegionData\":[37.5272,-77.4571,37.5530,-77.4133]}'\n\ncurl -X POST http://localhost:8080 -d '{\"Name\":\"none\",\"RegionType\":\"geojson\",\"RegionData\":{\"type\":\"Polygon\",\"coordinates\":[[[-77.4571,37.5530],[-77.4571,37.5272],[-77.4133,37.5272],[-77.4133,37.5530],[-77.4571,37.5530]]]}}'\n```\n\n- `RegionType` - one of `bbox`, `geojson`\n\n`bbox`: in `min_lat,min_lon,max_lat,max_lon` format\n\n`geojson`: a GeoJSON Geometry, either a Polygon or MultiPolygon \n\n* up to the configured nodes limit of the server.\n* Limit on the number of vertices in the input polygon.\n\nReturns a UUID or an error message.\n\n### GET `/{uuid}`\n\nGet a JSON Progress for a task submitted in the last 24 hours.\n\n```js\n{\n  \"Timestamp\": \n  \"CellsProg\": \"\",\n  \"CellsTotal\": \"\",\n  \"NodesProg\": \"\",\n  \"NodesTotal\": \"\",\n  \"ElemsProg\": \"\",\n  \"ElemsTotal\":\"\",\n  \"SizeBytes\":\"\",\n  \"Elapsed\":\"\",\n  \"Complete\":\"\"\n}\n```\n\n## File Server\n\nThese paths are not served through the API, but by a static fileserver.\n\n### GET `/{uuid}_region.json`\n\nGet the GeoJSON submitted for this task. Valid immediately after the task is accepted by the server.\n\n```json\n{\n  \"Uuid\":\"\",\n  \"SanitizedName\": \"abcd\",\n  \"SanitizedRegionType\":\"\",\n  \"SanitizedRegionData\":\"\"\n}\n```\n\n### GET `/{uuid}.osm.pbf`\n\nDownload the result `osm.pbf`. This appears once the Get `/{uuid}` API reports `Completed`.\n\n## Building\n\nCross-compile the `sliceosm-api` ARM linux binary:\n\n```\nGOOS=linux GOARCH=arm64 go build\n```\n\nExample crontab for updating an osmx database and cleaning up results older than one day:\n\n```\nPATH=/home/osmx/OSMExpress:$PATH\n* * * * * /bin/sleep 8 \u0026\u0026 /usr/bin/python3 /home/osmx/OSMExpress/utils/osmx-update /mnt/planet.osmx https://planet.openstreetmap.org/replication/minute/ \u003e\u003e /home/osmx/osmx-update.log 2\u003e\u00261\n0 0 * * * find /mnt/www/files/ -type f -mtime +1 -exec rm {} \\;\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsliceosm%2Fsliceosm-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsliceosm%2Fsliceosm-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsliceosm%2Fsliceosm-api/lists"}