Objectifs d’apprentissage
In a previous session, you have already installed and configured JOSM as well as master basic operations in JOSM such as drawing points, lines, and polygons. You also used menu presets to add attributes to an object you created on the map. Finally, you are to the point where you can digitize and edit features on the map using JOSM.
In this session, we will look closely at the JOSM interface and learn how to stage the map editing process in JOSM and also how to maximize the tools that exist in JOSM.
In this section, we build on our command of basic tools and techniques to draw map features in JOSM and look closely at some advanced drawing tools. To follow along with this section and practice using advanced JOSM tools, please download in Edit tools then open JOSM and point to the edittools package. It will look like the figure below:
The display of editing file in JOSM
JOSM has some additional tools to make it easier to create high quality lines and polygons. These tools are found in the Tools menu at the top of JOSM. A quick glance reveals many functions that can help when drawing lines and polygons, and editing objects on the map. We discuss the most important of those tools in this section.
Options in JOSM Tools Menu
In applying the functions in this menu, you first must select a point, line or polygon in the map window. The sample file you already downloaded contains various elements that are labeled the names of different tools on the menu.
Experiment with each of the tools using this sample file. A description of some of the tools is provided below.
The result of the combine way operation in JOSM
Note
That if you want to combine ways that have different directions, you will see this warning:
If the ways are connected, they can be aligned in the same direction by selecting Reverse and Combine.
The example of ways which will be simplified in JOSM
The Concept of Making A Way That Turned into A Straight
The concept of perfect the shape of polygon
The common question is how to rotate a way or a polygon after the object was drew.
The concept of rotating an object in JOSM
After editing in OpenStreetMap, you will realize that you are spending a lot of time with each click on the menu and submenu. To overcome this, JOSM has a shortcut button that substitutes the lengthy menu process. You can simply select the object directly and press the button in your keyboard. Here are the most important shortcut keys.
After you have acquired some skill in editing the map, you may want to use the additional JOSM features to improve your mapping skills. JOSM allows you to install various plugins, extending the functionality of the software. In this session, we will look some of the more useful plugins that exist for JOSM.
buildings_tools: If you draw a lot of buildings, this tool will make the process faster and easier. Building Tools Plugin is useful to digitize the building. It allows you to digitize one side of square building and extend the shapes with ease, saving mouse clicks and saving time. After the plugin is installed, you will see the new button in left side of JOSM, that look like this:
![]()
- Open JOSM and make a new layer
- Select building_tools and double click to draw a way on the map
- Then drag your mouse and click again to draw a square as shown in the figure below
![]()
![]()
The process of drawing a building with building tools plugin
- The tool not only creates a square with a triple click, but it also will automatically apply the building=yes tag into the polygon.
Creating Complex Buildings
You can also create building more complicated buildings by first drawing some overlapping buildings and merging them together.
DirectUpload: If you collect a lot of GPS tracks and you want to save to the OSM database, this plugin will make it easier for bulk uploads.
editgpx: If you want to upload the GPS track from Garmin device, you may need to use this plugin. Due to a technical glitch, OSM will not receive GPS track that have been saved on an external memory card in Garmin, but this plugin can fix the file so they can be uploaded.
fieldpapers: This plugin loads Field Papers that have been scanned in JOSM.
imagery_offset_db: This plugin for mappers who discover areas where the Bing satellite imagery is not aligned. This will be explained in more detail in the next chapter.
mirrored_download: With this plugin, you can download OSM data with a wider area to edit.
print: To add Print function, if you want to print an area quickly and where it need not look very good.
utilsplugin2: To add additional tools and menus in JOSM.
If you haven’t done so already, install the plugin shown in the figure below following the instructions for JOSM Plugins.
The display of utilsplugin 2
After you install this plugin and restart JOSM, you will have a new menu at the top of JOSM labeled More Tools as shown in the figure below.
The option of more tools menu in JOSM
Create new layer and experiment with some of the new tools. We will explain some of the new tools that are very useful:
Adding node at intersections
Copying tag from the selected building
Replace Geometry in JOSM
Selection
Utilsplugin2 also provides a lot of tools in Selection menu. Try experimenting with each of these tools.
The display of menu in selection tools
One of the selection tools which we use frequently is Unselect Nodes: This tool deselects all points. This can be useful if you draw a square to select a lof of objects, but you don’t want to select a point that contains all the lines and polygons. An example is shown in the figure below.
The example cancel node in JOSM
There are some common mistakes that mappers make when they start using OpenStreetmap. In this chapter we’ll identify a few of the most frequent errors and offer some tips for better mapping.
Some objects should not connect...
When you are creating polygon and line that are not supposed to be connected, make sure that they are not merged together by sharing a node. For example, highway nodes should not be snapped to buildings, because no one likes a road that leads directly into a wall! If you want to disconnect two or more objects that share the same node, select node and go to Tools -> Unglue Ways or press G as shown in the figure below.
Building and Road Connected
Building and Road Separated
...but some objects should connect
Roads that intersect should always share a node as shown in the figure below. If they do not share in a common node, then the computer has no way of knowing that the roads actually connect to each other. Therefore if you see the roads are not connecting to each other, please fix it by selecting the node from the road that you want to connect then go to Tools -> Merge Node or press M in your keyboard and drag it.
Road must connect to each other
A common error is to have overlapping polygons when the objects they represent do not overlap in real life. A building can not overlap to another building. For example, a polygon drawn to represent a park outside a building should not overlap with the building. Instead it should be drawn next to the building.
The example of overlap building
There are some exceptions to this rule, such as school. Within a school yard you might identify individual buildings using polygons, yet you also might want to create a polygon around the entire school yard. In this case it is fine for the polygons to overlap, but the rule to follow here is to make sure that the buildings are completely inside the landuse polygon.
The example of overlap building that is true and false
The example of building given a false tag (left) and true tag (right)
A common error is adding tag on a node that makes up part of a line or polygon. This often happens when someone draws a building and then select one of the nodes that participate in the object. The way to avoid creating an improper way is by clicking directly on the line.
The wrong intersection (left) and true intersection (right)
When roads intersect each other at road corners, you should not create a curved line at intersection. Line should form an angle of 90° that represents the actual conditions.
To fix this, select an object and tag the object in accordance with the information that describes the object. Alternatively, the object can be removed if the object is in error.
The figure below shows an example of lines that should connect but do not.
The example of lines not connecting to each other
To fix it, you can select a node from the line that you want to connect, and then select the Draw Node tool to add a node at the end of the line. Alternatively, you can use the Merge Node tool (if the front line is not connecting, that is a node), the following stages are:
If the end of the first line is not yet connected, and there is not a point to connect to in the second line, you can use the Tools > Join Node to Way.
In the figure below, a linear feature runs directly through a building.
The example of way cross the building
To fix this, you need to use the latest satellite imagery so you can determine which objects are correctly placed. If you are already using the latest imagery, simply move the object to the appropriate place and delete any obsolete features.
Editing OpenStreetMap with JOSM is similar to editing with the iD editor. But because JOSM is a desktop application, it works a little bit differently. The general process of editing and adding to OpenStreetMap with JOSM will always follow this pattern:
In the following sections, we explore this pattern in greater detail.
The first step is to download the data for the area of interest that you want to map. Remember that you need to do this every time that you want to make changes to the map, because the map is often being updated by other users and you will want the latest data.
3. The pink box represents the area of interest that we would like to download for editing. Use your mouse to pan and zoom to an area that you know very well, such as your hometown or neighborhood. The controls are the same as in the JOSM map window. The right mouse button lets you drag the map, and your scroll wheel allows you to zoom in and out.
4. Draw a box around the area that you want to download. To draw a new box, click on the map, hold your left mouse button down, and drag your mouse to create a box. Release the mouse button to finish drawing the box.
5. When you are satisfied with the size and location of the box, click Download at the bottom of the window. JOSM will fetch the data for this area from OpenStreetMap and open it in your map window for editing.
If you followed along when we added our first points with the iD editor, you remember that beneath the map data there was a satellite image that helped us identify objects on the ground. This imagery was licensed from Microsoft Bing, which generously provides its imagery for OpenStreetMap users to use as a reference while contributing to the map.
To add the Bing satellite imagery in JOSM, click Imagery on the top menu of JOSM and selecting Bing Sat.
To this point, we have been doing some pre-edit steps in JOSM starting with downloading OSM data and adding satellite imagery as the background. Next, we’ll edit the map and add new objects on it.
You might rather see more or less data in your editing window. What you see will depend on the size of your editable area. Please note, the data you are working with is real data and the nodes, lines and polygon in your map area represents actual objects on the ground.
2. You do not need to hurry, take your time to understand the steps. If you are not really sure about the outline or identify of some object, you should leave these off the map.
3. If you want to move nodes, lines, or polygon, you can use Select Tools. Click the object that you want to move and drag it to where it should be.This step could be used to fix location of objects which have wrong position.
4. Use Draw Tool to draw nodes, lines, and polygon. Add description and information of your object using Presets menu. You have done this in previous chapter.
You might be notice that everytime you add new object to JOSM, your object will be added to layer panel at right side in JOSM. Your Panel Layer should looks like this:
Every item listed is a different source of data that you have open in JOSM. In the example shown in the figure above, Data Layer 1 is the OpenStreetMap data that we are currently editing. BingSat layer is satellite imagery that is used as a background in JOSM.
Those layers that are used as background images help us identify and digitize objects in JOSM. These include satellite imagery, but also GPS tracks and scans of Field Papers. We call these layers base layers and our OSM data layer is main layer that we use to digitize and edit, add objects, move objects, etc.
You should see your layer that you select will be hide in JOSM. If you want to show it again, you can click the show/hide button and it would be automatically show in JOSM.
4. Last, it is very important to know that you only can edit the Active layer in JOSM. If you can not edit your map in JOSM, it might be because your layer is not active. Most layer, such as GPS point, Field Papers, and Aerial Imagery cannot be edited. The only layer that can be edited are data from OpenStreetMap, which are usually called Data Layer 1.
Tag is just like a label that you put to an object. For instance, if we add an object in some area and that object is a mosque and its name is Masjid Raya Sabilal Muhtadin; amenity that we can use is place of worship and mosque as we know, is Muslim place of worship. Therefore, you can add a religion=Muslim tag to the mosque as well as any other information you can supply about that object. The tag will be saved as text, specifically as a key and value combination. In OpenStreetMap, you can see all information about an objects in properties panel at right side of your JOSM window as shown in the figure below.
Example Tag of object in JOSM
You can add, edit, and remove tags directly from properties panel. But, tags are automatically defined in English and sometimes it is confusing especially if you do not understand English. Hence, non-English speakers may find it is easier to manage tags using a Preset Menu. Needless to say, when you add or edit tag, the attribute of object will be change as well.
The third and final step to complete our edits is to upload changes we have made to the OpenStreetMap database. To save the changes, you must be connected to the internet.
1. Click File on the top menu, and then click :guilabel: Upload Data. This will open up the upload window. You can access this window more simply by clicking on the upload button, shown here:
2. The window that appears shows a list of the objects that you are adding and the objects you are modifying or deleting. In the box at the bottom you are asked to provide a comment about the changes that you are making. Type in here a brief description of your edits.
When you edit using JOSM, you should download, edit and upload your changes at regular intervals. Do not be afraid to upload your changes several times during an editing session. This insures your changes upload to OSM database completely and you face less risk of losing your work. There are some cases where you have not finished your work, or your internet connection may be suddenly turned off. If that happens, you can save your work locally in JOSM. These are the steps to save your work:
1. To save your OSM file, make sure your layer active. Click File > Save. Choose your location in your computer and give a name to your file. You also can save your file by click this button:
To see your edits on the map, take the following steps:
Contributing to OpenStreetMap is easy to learn, but difficult to master. Everybody makes mistakes, but the system works because even when one person does something the “wrong” way, there are always other mappers ready to help and fix errors. As you map more and more, the process will continue to get easier, and you will learn the “proper” way to do things. This chapter is devoted to helping you make quality contributions to OpenStreetMap. We will begin by discussing various editing techniques in JOSM that will improve your workflow, and how to avoid common mistakes that beginning mappers make. Lastly, we will then discuss the JOSM validator tool, which is an automated way of checking for errors.
There is a stage when you upload your work to OpenStreetMap when you get a window notification as in the figure below:
This is the way JOSM tells us that something is wrong with our data and it needs to be fixed before we upload it to the server.
JOSM comes with a validation tool that does an automated analysis of possible mistakes. This is useful for finding errors that you may have overlooked. When you run the validation tool, it returns two types of problems:
One thing to note is that if you download a large area of the map and run the validation tool, you may get a very long list of errors and warnings. This is because the validation tool works on the whole map in your editing extents, –not only the changes that you have made. So you may see mistakes that other mappers have made which you are free to fix or ignore. But the validation tool gives you the opportunity to look at the mistakes one by one and evaluate them.
Let’s learn how to use validation tool.
Validation Result Button
Validation Layer and Validation Result
5. Some errors can be automatically fixed, such as Duplicated node errors. You can click on the folder for these types of errors and click the Fix button in the window. Many errors, however, need to be corrected manually.
Awesome! You have successfully learned how to edit OpenStreetMap in JOSM and how to maximize some tools in JOSM to help us in editing our map. You also know about mistakes and errors that should be avoided when editing in JOSM.
In next chapter, we will learn how to use Global Positioning System (GPS) to collect data when doing a field survey and how to add it to OpenStreetMap.