OpenStreetMap

Efficiently merging government park boundaries in JOSM

Posted by JoshD on 5 February 2012 in English (English)

Lately I've been working on merging my county's park data into OSM using JOSM (this is more technically known as conflation). I've also been modifying JOSM and some plugins to try and improve the efficiency with which I do this, considering the county has 22,500 acres of parkland in 416 parks, not counting the parks which the county does not operate, but for which the county still has boundary data. I thought I'd share my process so far, in hopes that others with similar tasks might find some useful tips, and perhaps learn how others accomplish similar tasks or how I might be able to improve my process. Be sure to at least have the utilsplugin2 plugin installed.

First of all, I converted the government-provided (and appropriately licensed) Shapefile to an OSM.XML file using ogr2osm and a simple translation script to set the name, operator, and leisure=park tags.


  1. Create new layer (blank)
  2. Open government OSM file
  3. Select and zoom to a feature to merge (click and press 3)
  4. Merge feature to OSM layer (Ctrl+Shift+M) and delete (D) from government layer
  5. Switch to OSM layer (Shift+A, then 1)
  6. Download corresponding area from OSM database (Ctrl+Shift+D)
  7. The next step will vary:

    • If the feature doesn't exist in OSM yet, then you're done
    • If the government feature is of higher spatial accuracy, select the two features and run Replace Geometry (Ctrl+Alt+G), resolving any tag/membership conflicts
    • If the government feature doesn't have better spatial accuracy, but has better tags, copy and paste them (Ctrl+C on the government feature then Ctrl+Shift+V on the OSM feature), then delete the government feature

  8. Switch back to the government layer (Shift+A, then 2)
  9. Repeat with next feature, go to step 3

Note that the Replace Geometry action can "upgrade" a node to a way or to a relation, or replace a way with a way. It can't yet "upgrade" a way to a relation or replace a relation with a relation, but those are on my TODO list.

One obvious way to improve this include downloading a large area at once, though this may be problematic if the features are spread over a very large area. I really should get back to working on the conflation plugin I started almost a year ago, but got stuck on the design.

How many others are doing this kind of merging? Any suggestions?

Location: Harmon Place, West Springfield, Fairfax, Virginia, 22152, United States of America

Comment from skorasaurus on 11 February 2012 at 19:05

Thanks for detailing this !

I'd also like to import the parks in my area (they're also available as a shapefile), although it's admittedly not high on my priority list. If I ever get around to it (or the more likely scenario, I can point another user to this if they wonder how), I'll keep this in mind and bookmarked !

Hide this comment

Comment from JoshD on 11 February 2012 at 21:53

Thanks! I've put a link to this diary entry on the wiki:
http://wiki.openstreetmap.org/wiki/Manual_conflation

Hide this comment

Leave a comment

Parsed with Markdown

  • Headings

    # Heading
    ## Subheading

  • Unordered list

    * First item
    * Second item

  • Ordered list

    1. First item
    2. Second item

  • Link

    [Text](URL)
  • Image

    ![Alt text](URL)

Login to leave a comment