{"id":37212483,"url":"https://github.com/whosonfirst/go-whosonfirst-browser-sqlite","last_synced_at":"2026-01-15T00:26:52.912Z","repository":{"id":65194095,"uuid":"229141330","full_name":"whosonfirst/go-whosonfirst-browser-sqlite","owner":"whosonfirst","description":"A Go package that implements a SQLite-enabled instance of the whosonfirst/go-whosonfirst-browser tool.","archived":true,"fork":false,"pushed_at":"2024-05-16T15:31:49.000Z","size":14276,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T06:29:49.022Z","etag":null,"topics":["golang","sqlite","whosonfirst","whosonfirst-browser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/whosonfirst.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":"2019-12-19T21:26:09.000Z","updated_at":"2024-05-16T15:32:02.000Z","dependencies_parsed_at":"2024-06-20T05:46:54.476Z","dependency_job_id":"64296d3b-7419-4ef9-9f20-180f2e021756","html_url":"https://github.com/whosonfirst/go-whosonfirst-browser-sqlite","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/whosonfirst/go-whosonfirst-browser-sqlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-browser-sqlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-browser-sqlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-browser-sqlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-browser-sqlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whosonfirst","download_url":"https://codeload.github.com/whosonfirst/go-whosonfirst-browser-sqlite/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whosonfirst%2Fgo-whosonfirst-browser-sqlite/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28439701,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T22:37:52.437Z","status":"ssl_error","status_checked_at":"2026-01-14T22:37:31.496Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["golang","sqlite","whosonfirst","whosonfirst-browser"],"created_at":"2026-01-15T00:26:52.133Z","updated_at":"2026-01-15T00:26:52.895Z","avatar_url":"https://github.com/whosonfirst.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-whosonfirst-browser-sqlite\n\nA Go package that implements a SQLite-enabled instance of the `whosonfirst/go-whosonfirst-browser` tool.\n\n## Important\n\nThis package has been replaced by the [go-whosonfirst-spelunker](https://github.com/whosonfirst?q=go-whosonfirst-spelunker\u0026type=all\u0026language=\u0026sort=) packages and will no longer be actively maintained.\n\n## Description\n\nThe `go-whosonfirst-browser-sqlite` package implements a SQLite-enabled instance of the [go-whosonfirst-browser](https://github.com/whosonfirst/go-whosonfirst-browser) tool.\n\nThis package does not expose any new functionality not already provided by the `whosonfirst/go-whosonfirst-browser` package. Instead it imports the necessary packages to support loading data from a SQLite database and then launches the default `whosonfirst-browser` application.\n\n### Important\n\nThis is work in progress. Although there is a detail example of how to use this package below complete documentation remains incomplete. In the meantime you should consult the documentation for [go-whosonfirst-browser](https://github.com/whosonfirst/go-whosonfirst-browser).\n\n## Tools\n\nTo build binary versions of these tools run the `cli` Makefile target. For example:\n\n```\n$\u003e make cli\ngo build -mod vendor -o bin/whosonfirst-browser cmd/whosonfirst-browser/main.go\n```\n\n### whosonfirst-browser\n\n```\n$\u003e ./bin/whosonfirst-browser -h\n  -cache-source string\n    \tA valid go-cache Cache URI string. (default \"gocache://\")\n  -enable-all\n    \tEnable all the available output handlers.\n  -enable-data\n    \tEnable the 'geojson' and 'spr' and 'select' output handlers.\n  -enable-geojson\n    \tEnable the 'geojson' output handler. (default true)\n  -enable-geojson-ld\n    \tEnable the 'geojson-ld' output handler. (default true)\n  -enable-graphics\n    \tEnable the 'png' and 'svg' output handlers.\n  -enable-html\n    \tEnable the 'html' (or human-friendly) output handlers. (default true)\n  -enable-png\n    \tEnable the 'png' output handler.\n  -enable-select\n    \tEnable the 'select' output handler.\n  -enable-spr\n    \tEnable the 'spr' (or \"standard places response\") output handler. (default true)\n  -enable-svg\n    \tEnable the 'svg' output handler.\n  -nextzen-api-key string\n    \tA valid Nextzen API key (https://developers.nextzen.org/).\n  -nextzen-style-url string\n    \tA valid Tangram scene file URL. (default \"/tangram/refill-style.zip\")\n  -nextzen-tile-url string\n    \tA valid Nextzen MVT tile URL. (default \"https://{s}.tile.nextzen.org/tilezen/vector/v1/512/all/{z}/{x}/{y}.mvt\")\n  -path-geojson string\n    \tThe path that GeoJSON requests should be served from. (default \"/geojson/\")\n  -path-geojson-ld string\n    \tThe path that GeoJSON-LD requests should be served from. (default \"/geojson-ld/\")\n  -path-id string\n    \tThe that Who's On First documents should be served from. (default \"/id/\")\n  -path-png string\n    \tThe path that PNG requests should be served from. (default \"/png/\")\n  -path-select string\n    \tThe path that 'select' requests should be served from. (default \"/select/\")\n  -path-spr string\n    \tThe path that SPR requests should be served from. (default \"/spr/\")\n  -path-svg string\n    \tThe path that SVG requests should be served from. (default \"/svg/\")\n  -proxy-tiles\n    \tProxy (and cache) Nextzen tiles.\n  -proxy-tiles-cache string\n    \tA valid tile proxy DSN string. (default \"gocache://\")\n  -proxy-tiles-timeout int\n    \tThe maximum number of seconds to allow for fetching a tile from the proxy. (default 30)\n  -proxy-tiles-url string\n    \tThe URL (a relative path) for proxied tiles. (default \"/tiles/\")\n  -reader-source string\n    \tA valid go-reader Reader URI string. (default \"whosonfirst-data://\")\n  -select-pattern string\n    \tA valid regular expression for sanitizing select parameters. (default \"properties(?:.[a-zA-Z0-9-_]+){1,}\")\n  -server-uri string\n    \tA valid aaronland/go-http-server URI. (default \"http://localhost:8080\")\n  -static-prefix string\n    \tPrepend this prefix to URLs for static assets.\n  -templates string\n    \tAn optional string for local templates. This is anything that can be read by the 'templates.ParseGlob' method.\n```\n\n## Example\n\n### Creating a SQLite database for browsing\n\nThe `go-whosonfirst-browser-sqlite` package doesn't create or index records in a SQLite database for browsing. It only _consumes_ SQLite databases and specifically SQLite databases that have indexed records using the table definitions and logic defined in the [go-whosonfirst-sqlite-features](https://github.com/whosonfirst/go-whosonfirst-sqlite-features) package.\n\nThere are three ways to create a SQLite database to be consumed by the `go-whosonfirst-browser-sqlite` package:\n\n1. Read the documentation and use the code in the `go-whosonfirst-sqlite-features` package and produce a SQLite database manually.\n2. Use the command lines tools that are part of the [go-whosonfirst-sqlite-features-index](https://github.com/whosonfirst/go-whosonfirst-sqlite-features-index) package to create a SQLite database from one or more sources that can be indexed by the [go-whosonfirst-index](https://github.com/whosonfirst/go-whosonfirst-index) packages.\n3\u003e Use the command line tools that are part of the [go-whosonfirst-dist](https://github.com/whosonfirst/go-whosonfirst-dist) package to create a SQLite database from one or more Who's On First-style data repositories on GitHub.\n\nThis example demonstrates option #3. It uses the `wof-dist-build` tool (part of the `go-whosonfirst-dist` package) to create a single \"combined\" SQLite database from data in (8) different repositories in [sfomuseum-data](https://github.com/sfomuseum-data) GitHub organization. The tool is also configured to index \"alternate\" geometries as well as any relations defined in a record's hierarchy. By default the `wof-dist-build` tool indexes only \"common\" tables but because the `-build-sqlite-all` flag is set it will index the search and rtree (used for spatial indexing) related tables as well. \n\nHere's what that looks like:\n\n```\n$\u003e bin/wof-dist-build \\\n\t-combined \\\n\t-combined-name sfomuseum-data-2020 \\\n\t-git-organization sfomuseum-data \\\n\t-workdir /usr/local/data/dist \\\n\t-build-sqlite-all \\\n\t-index-alt-files \\\n\t-index-relations \\\n\t-index-relations-reader-uri https://static.sfomuseum.org/data \\\n\t-compress-all=false \\\n\t-timings \\\n\t-verbose \\\t\n\tsfomuseum-data-whosonfirst \\\n\tsfomuseum-data-publicart \\\n\tsfomuseum-data-architecture \\\n\tsfomuseum-data-maps \\\n\tsfomuseum-data-exhibition \\\n\tsfomuseum-data-enterprise \\\n\tsfomuseum-data-aircraft \\\n\tsfomuseum-data-collection\n\n...time passes\n\n17:11:07.335325 [wof-dist-build] STATUS local sqlite is /usr/local/data/dist/sfomuseum-data-2020-latest.db\n17:11:15.144435 [wof-dist-build] STATUS time to build UNCOMPRESSED distributions for sfomuseum-data-2020 29m44.95956821s\n17:11:15.144478 [wof-dist-build] STATUS time to remove uncompressed files for sfomuseum-data-2020 1.1µs\n17:11:15.144485 [wof-dist-build] STATUS time to build COMPRESSED distributions for sfomuseum-data-2020 29m44.959632175s\n17:11:15.144588 [wof-dist-build] STATUS time to build distributions for 7 repos 29m44.959831649s\n17:11:15.144605 [wof-dist-build] STATUS ITEMS map[sfomuseum-data-2020:[]]\n17:11:15.144913 [wof-dist-build] STATUS Wrote inventory /usr/local/data/dist/sfomuseum-data-2020-inventory.json\n```\n\nA couple things to note:\n\n* By default the `wof-dist-build` tool compresses the products it creates but because the `-compress-all=false` flag is set we can use our SQLite database as soon as it's finished being indexed.\n\n* The `wof-dist-build` is still configured to always write a `-inventory.json` file even if there aren't any compressed distributions. This will be fixed in future releases. Until then, the `-inventory.json` file can be assumed to be safe to delete.\n\n### Loading a SQLite database for browsing\n\nHere's how to load the SQLite database created, in the example above, for browsing:\n\n```\n$\u003e bin/whosonfirst-browser \\\n\t-enable-all \\\n\t-nextzen-api-key {NEXTZEN_APIKEY} \\\n\t-reader-source 'sql://sqlite3/geojson/id/body?dsn=/usr/local/data/dist/sfomuseum-data-2020-latest.db' \\\n\t-search-database-uri 'sqlite://?dsn=/usr/local/data/dist/sfomuseum-data-2020-latest.db'\n```\n\nThe if you visit `http://localhost:8080/search/?term=T2` in a web browser you should see this:\n\n![](docs/images/wof-browser-search-t2.png)\n\nIf you click on the third link or visit `http://localhost:8080/id/1477855607` you'll see this:\n\n![](docs/images/wof-browser-t2.png)\n\n## See also\n\n* https://github.com/whosonfirst/go-whosonfirst-browser\n* https://github.com/whosonfirst/go-reader-database-sql\n* https://github.com/whosonfirst/go-whosonfirst-sqlite-features\n* https://github.com/whosonfirst/go-whosonfirst-sqlite-features-index\n* https://github.com/whosonfirst/go-whosonfirst-dist\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-browser-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-browser-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhosonfirst%2Fgo-whosonfirst-browser-sqlite/lists"}