{"id":13856818,"url":"https://github.com/russss/datasette-geo","last_synced_at":"2025-05-13T03:43:52.280Z","repository":{"id":66646147,"uuid":"184140481","full_name":"russss/datasette-geo","owner":"russss","description":"A Datasette plugin to make Spatialite databases effortlessly explorable","archived":false,"fork":false,"pushed_at":"2019-05-01T09:48:21.000Z","size":539,"stargazers_count":10,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-01T06:17:00.917Z","etag":null,"topics":["datasette","geojson","geospatial","mapbox-gl-js","maps","python","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/russss.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}},"created_at":"2019-04-29T20:35:51.000Z","updated_at":"2024-02-20T16:10:36.000Z","dependencies_parsed_at":"2023-02-22T17:16:09.218Z","dependency_job_id":null,"html_url":"https://github.com/russss/datasette-geo","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"d4cecc020848bbde91e9e17bf352f7c70bc3dccf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russss%2Fdatasette-geo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russss%2Fdatasette-geo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russss%2Fdatasette-geo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/russss%2Fdatasette-geo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/russss","download_url":"https://codeload.github.com/russss/datasette-geo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253870822,"owners_count":21976610,"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":["datasette","geojson","geospatial","mapbox-gl-js","maps","python","sqlite"],"created_at":"2024-08-05T03:01:14.531Z","updated_at":"2025-05-13T03:43:52.237Z","avatar_url":"https://github.com/russss.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Datasette Geo\n\n**Work in progress. Don't expect this to work yet, especially since it depends on a lot of unmerged Datasette features.**\n\nA [Datasette](https://github.com/simonw/datasette) plugin to make [Spatialite](https://www.gaia-gis.it/fossil/libspatialite/index) databases effortlessly explorable.\n\n## Features\n* [All the good stuff from Datasette](https://datasette.readthedocs.io/en/stable/)\n* Better representation of Spatialite geometries in table views\n* Fast, scalable map viewing using Mapbox GL and an integrated Mapbox Vector Tile server\n* GeoJSON export endpoints\n* Maybe more?\n\n![Datasette Geo Screenshot](doc/screenshot.png)\n\n## Installation\nAs covered above, please don't try to install this yet. It currently relies on a raft of patches to Datasette, which will\nhopefully be merged soon.\n\n## Database Preparation\nThe database you're using needs to have the geographic data stored in Spatialite geometry columns. These columns must be indexed, which you can do with the following SQL:\n```sql\n\tSELECT CreateSpatialIndex('table_name', 'column_name');\n```\n\n## Configuration\n\nYou'll need to make sure the Spatialite module is loaded by Datasette, [as described in the docs](https://datasette.readthedocs.io/en/stable/spatialite.html).\n\nAfter this, Datasette Geo should work out of the box, automatically detecting the Spatialite column in your tables\nand rendering them. You may want to increase your `sql_time_limit_ms` configuration setting to allow enough time for\nlarge vector tiles to be rendered.\n\n## Base Maps\nBy default, Datasette Geo uses the standard [OpenStreetMap](https://openstreetmap.org) raster tiles as a base map, as they require no authentication to access. Please note if you deploy Datasette Geo with these tiles, you must comply with the OSM\n[Tile Usage Policy](https://operations.osmfoundation.org/policies/tiles/).\n\nRaster tiles are not as fast and pretty as using a vector tile source, so you can configure Datasette Geo to use\na vector tile source instead. Note that (to my knowledge) all available vector tile services are paid services although\nMapbox and MapTiler have free tiers:\n\n### Mapbox\nYou'll need a Mapbox account so you can fetch an [access token](https://account.mapbox.com/access-tokens/). \nYou'll also need a style URL, which can either be one of Mapbox's [default styles](https://docs.mapbox.com/api/maps/#mapbox-styles)\nor a custom style generated with [Mapbox Studio](https://studio.mapbox.com/).\n\nConfigure it in your `metadata.json`:\n```json\n    \"plugins\": {\n\t    \"datasette-geo\": {\n\t\t\"mapbox_token\": \"\u003cMapbox access token\u003e\",\n\t\t\"style\": \"mapbox://styles/mapbox/light-v10\"\n\t    }\n    }\n```\n### MapTiler\n[MapTiler](https://maptiler.com) is another source of vector tile data which is cheaper than Mapbox. By way of full disclosure,\nthey currently sponsor some of my personal projects with free vector tile access.\n\n[Choose your map](https://cloud.maptiler.com/maps/) and you'll be given a vector style URL:\n```json\n    \"plugins\": {\n\t    \"datasette-geo\": {\n\t\t\"style\": \"https://api.maptiler.com/maps/positron/style.json?key=\u003cMapTiler key\u003e\"\n\t    }\n    }\n```\n\n### Custom Style File\nYou can generate a custom [Mapbox GL style file](https://docs.mapbox.com/mapbox-gl-js/style-spec/) using a tool like\n[Maputnik](https://maputnik.github.io/), or by hand-writing it if you're especially keen. Note that you will\nstill need to define a tile source in the style file. Add it to your Datasette project static directory, and reference it in `metadata.json`\nlike so:\n```json\n    \"plugins\": {\n\t    \"datasette-geo\": {\n\t\t\"style\": \"/static/mystyle.json\"\n\t    }\n    }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussss%2Fdatasette-geo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frussss%2Fdatasette-geo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frussss%2Fdatasette-geo/lists"}