Skip to content
OpenStreetMap Live Conflation
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
static
README.md
config.json
config.ru
process.lua
server.rb
vector_tiles.mbtiles

README.md

OpenStreetMap Live Conflation

OSM Live Conflation provides a visual interface for manually merging third-party datasets into OpenStreetMap.

Your third-party data is encoded into vector tiles (Mapbox MVT format). The UI enables mappers to select items from the vector tiles and either transfer their attributes to existing OSM objects, or create new objects. By calling the OSM API to find nearby features and then matching based on proximity and tag similarity, the most likely candidates are presented first. Once the mapper has merged their chosen features, the resulting changes can be uploaded direct to the OSM API.

Requirements

The server is written in Ruby. The sqlite gem is required (to serve vector tiles in .mbtiles format), and either rack (for a local webserver) or Phusion Passenger (for deployment). If deploying with Phusion Passenger, use the supplied config.ru and point your Apache root to /srv/yoursitename/static .

Vector tiles are prepared using tilemaker. You are recommended to build the latest version from source.

Getting up and running

Make sure your input data is in shapefile format, EPSG 4326 projection (simple WGS84 lat/long). You can convert most vector formats to shapefile using ogr2ogr, for example:

ogr2ogr -f "ESRI Shapefile" -t_srs "EPSG:4326" shp OOCIE_Extract_20190214.gdb.zip

Then create vector tiles from the data using tilemaker. To do this you'll need to write two config files, examples of which are provided.

  • config.json lists the shapefiles that you want to read; what zoom levels each should show up at; and the bounding box for your project.
  • process.lua is a Lua script that reads the shapefile attributes and converts them to OSM tags. This is where you put your tag remapping logic. attribute_function is called with a table (hash) of shapefile attributes and must return a table (hash) of OSM tags.

Make sure you're in the directory containing these two files, then simply

tilemaker --output vector_tiles.mbtiles

The result is an .mbtiles file containing vector tiles with all your data. (An example is provided: delete this before creating your own.)

You can now spin up the server. To run it locally:

ruby server.rb vector_tiles.mbtiles

Then open the site at http://localhost:8080/index.html .

Using OSM Live Conflation

Screen layout

Your source data is on the left, OSM on the right.

The points and lines from your source data are overlaid on a satellite map. Clicking on any of these will identify OSM candidates to be modified, or a new geometry to be created. Use the 'Next >' button to page through the candidates. Each candidate is highlighted on the OSM map (top right) as you do so.

Once you've chosen one, you can use the checkboxes to deselect any tags you don't want to be applied. Click 'Accept' to make the change. The source feature is temporarily removed from the left-hand map when you do so.

To upload your changes, enter your OSM username and password into the input fields; click 'Upload'; and enter a changeset comment.

Using vector tiles in iD

You can also load your vector tiles directly into iD, OpenStreetMap's default online editor.

In iD, click the 'Map data' icon on the right, then '...' by 'Custom Map Data'. In the dialogue that appears, enter a URL like https://url.of.your.server/{z}/{x}/{y}.pbf .

About this project

Work on this project was supported by the Open Data Institute via Oxfordshire County Council: https://theodi.org/article/the-projects-were-funding-to-explore-open-geospatial-data-in-local-government/

See https://github.com/systemed/conflation/issues/1 for a to-do list of identified enhancements.

Map rendering is via Mapbox GL and Leaflet.

MIT licence, (c) Richard Fairhurst 2019.

You can’t perform that action at this time.