Mapping CERN building numbers to Open Street Map object IDs enables buildings to be located on an OSM simply using their number. This repository contains the code to generate these mappings, together with the latest output in a JSON file.
- CERN buildings appear on Open Street Maps since their descriptions have been imported from the Cadastre Francais on the French territory and the SwissTopo on the Swiss territory
- Buildings are stored as OSM "ways" which trace their outer perimeters
- Example: B28
- The outer perimeter of each CERN site is also stored as an OSM "way"
- Examples: Meyrin Site, Prevessin site, P1 ATLAS, P2 ALICE, P5 CMS, P8 LHCb
- The OSM metadata is stored in a DB which can be queried using the Overpass API
- Using the overpass API it is possible to identify all buildings within the CERN perimeter
- And OSM maps can be rendered and visualised using MapBox
- Run the Overpass API to identify CERN buildings:
- Use an area query (for Meyrin site) and select only buildings:
- http://overpass-api.de/api/interpreter?data=[out:json][timeout:25];area(3600027005)-%3E.searchArea;(way[%22building%22=%22yes%22](area.searchArea););out%20meta;
- N.b: an overpass area id is the osm id plus 2400000000 (for a way) or plus 3600000000 (for a relation)
- Use an area query (for Meyrin site) and select only buildings:
- Queries for all CERN sites are contained in the bash script: osm_building_queries
- Run build_osm_mappings.py on the output files to strip out just the building number-osm id pairs
- Output to a file called "cern_osm_mappings.json"