{"id":20815510,"url":"https://github.com/abiddiscombe/opennames-to-json","last_synced_at":"2026-08-11T18:33:00.325Z","repository":{"id":157258460,"uuid":"613468014","full_name":"abiddiscombe/opennames-to-json","owner":"abiddiscombe","description":"A script to convert Ordnance Survey Open Names CSV files into a JSON array of WGS84 Features","archived":false,"fork":false,"pushed_at":"2024-07-26T14:33:17.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-06T19:50:20.429Z","etag":null,"topics":["csv","geojson","go","golang","opennames","ordnancesurvey"],"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/abiddiscombe.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":"2023-03-13T16:15:58.000Z","updated_at":"2024-08-02T14:00:06.000Z","dependencies_parsed_at":"2024-07-26T16:29:21.962Z","dependency_job_id":null,"html_url":"https://github.com/abiddiscombe/opennames-to-json","commit_stats":{"total_commits":10,"total_committers":1,"mean_commits":10.0,"dds":0.0,"last_synced_commit":"f62d701e7cd8073709ff876285d9d6dd186a88f5"},"previous_names":["abiddiscombe/opennames-to-json","abiddiscombe/opennames-to-geojson"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/abiddiscombe/opennames-to-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiddiscombe%2Fopennames-to-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiddiscombe%2Fopennames-to-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiddiscombe%2Fopennames-to-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiddiscombe%2Fopennames-to-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abiddiscombe","download_url":"https://codeload.github.com/abiddiscombe/opennames-to-json/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abiddiscombe%2Fopennames-to-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36533715,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-08-06T04:43:03.162Z","status":"online","status_checked_at":"2026-08-11T02:00:06.871Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["csv","geojson","go","golang","opennames","ordnancesurvey"],"created_at":"2024-11-17T21:23:43.952Z","updated_at":"2026-08-11T18:33:00.306Z","avatar_url":"https://github.com/abiddiscombe.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OS OpenNames to JSON\n\n\u003e 🚀 Refactored from [Deno](https://deno.com/) to [Go](https://go.dev) as part of my ongoing learning! \\\n\u003e This version can process more of the dataset in less time (Apple M1: Deno - 98 sec, Go - 34 sec).\n\nOrdnance Survey (OS) Open Names is a [comprehensive dataset of place names, roads numbers and postcodes for Great Britain](https://www.ordnancesurvey.co.uk/products/os-open-names). It's an [OGL](http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/) dataset provided in the British National Grid `EPSG:27700` CRS.\n\nThis code **converts the OS Open Names CSV dataset into a JSON array consisting of multiple GeoJSON Features**. It's designed for bulk importing into MongoDB using [MongoDB Compass](https://www.mongodb.com/products/tools/compass). The bulk importer expects a JSON array of features, not a GeoJSON object - and therefore this script won't create a valid GeoJSON file.\n\nThe following metadata is included by default: `id`, `type`, `localType`, `name1`, `name1Lang`, `name2`, `name2Lang`, `geomX`, `geomY`. Geometry is converted to `lat-lon` values, and the `name2` and `name2Lang` are often empty strings.\n\n## Running\n\nI'm not creating prebuilt binaries for this script at this time.\n\n1. Install [Go](https://go.dev/dl/) on your machine. I do this via Homebrew on MacOS.\n\n2. Copy the `/Data` directory from [OS Open Names](https://osdatahub.os.uk/downloads/open/OpenNames) into the root of this repository. This directory contains ~819 CSV files each representing a distinct region.\n\n3. Run the script with `go run main.go`. The output is stored in a newly created `output.json` file.\n\nIf you choose to host this dataset with MongoDB you [must create a `2dsphere` index to handle geospatial queries](https://www.mongodb.com/docs/manual/core/indexes/index-types/geospatial/2d/). I also strongly advise creating indexes for any other columns you plan to query against.\n\n## Credits\n\n[MIT License](./LICENSE). Feel free to refactor to suit your needs.\n\nThis script relies on the awesome [wroge/wgs84](https://pkg.go.dev/github.com/wroge/wgs84/v2) and [paulmach/orb](https://pkg.go.dev/github.com/paulmach/orb) packages for coordinate transformation and GeoJSON parsing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiddiscombe%2Fopennames-to-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabiddiscombe%2Fopennames-to-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabiddiscombe%2Fopennames-to-json/lists"}