Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 3.56 KB

custom_osm.md

File metadata and controls

52 lines (31 loc) · 3.56 KB

How to create a custom OSM file

If you don't want to bother yourself editing the public version of the OSM data, deal with the community and so on, you can easily create your own OSM file and do there whatever you want. Here is a step-by-step guide on how to do it.

  1. Download the JOSM editor from the official website or directly from the Windows Store with one click.

  2. Create a new layer (Ctrl + N).

  3. Add imagery to see the map (Ctrl + Shift + N). You can use any map provider you want, in this example I'm using Bing.

Add imagery

  1. Download the OSM data: File -> Download data (Ctrl + Shift + Down).

Download OSM data

  1. Draw the area of your ROI (region of interest). You don't need precision here, just ensure that it's large enough to cover the area you want to work with.
    After selecting the area, click Download.
    If you see the error message "Download area too large", download it in parts.

Draw the area

  1. Now you should see all the data from the selected area.

  2. You need to remove all the relations, otherwise the file can not be read by the osmnx library. To do it, go to the Relations tab, select everything and delete it.

Remove relations

  1. Pay attention to the fact, that removing relations may lead to some areas to disappear, which was not defined separately from another objects. You can't do anything with it; if you miss something, you'll need to add it manually.

  2. You can start editing your map. You can add new objects, remove existing ones, change their properties, etc. And there will be no one to tell you that you're doing something wrong or reverse your changes.

  3. Pay attention to the fact that if you simply delete the object it will result a broken OSM file. Instead of simply removing something, you need to Purge it. To see this option, you need to enable the Expert mode in the settings.

Enable expert mode

  1. After it, you will see the Purge option in the Edit menu. Use it to remove the object properly.

Purge object

  1. Save the file: File -> Save as (Ctrl + Shift + S).
    Now, you can use this file in the generator.
    Friendly reminder: save your file in some safe place, so you won't lose your changes. It's also recommended to use version control systems like Git to track your changes, so you can easily revert them if something goes wrong.

Troubleshooting

If your custom OSM file is not working, throws errors or outputs a blank map try the following approach:

  1. Open your OSM file in any text editor.
  2. Search for action='delete'. If there are any occurences, the file cannot be handled properly. Delete all elements that contain the action delete attribute and save the file.

Actions which could lead to this issue:

  • Deleting elements. Workaround: Use Purge instead of Delete to completely remove them from the OSM file.
  • Combine Way (shortcut "C") when combining two or more ways (e.g. roads) together. No workaround for now. You have to manually delete the marked elements from the OSM file.