Two Minute Tutorials: Drawing Buildings in JOSM

Two Minute Tutorials: Drawing Buildings in JOSM


JOSM, short for Java OpenStreetMap Editor is an advanced desktop editor for adding and changing map data on OpenStreetMap. It’s free and open source, and one of the things it’s great for is drawing buildings quickly. To download JOSM, go to josm.openstreetmap.de There are a few options for downloading, choose one of the green ones. josm.jnlp is a good option. Note that JOSM works best with a mouse rather than a trackpad. You may need to install a newer version of the Java library once you download JOSM. Open up josm.jnlp. You’ll see a gray screen with some news and updates and a number of buttons. Next we’ll need to add the buildings plugin. To do that, click the button that looks like two sliders — that’s the preferences. The fourth button down looks like a plug, that’s the Plug-In menu. Click it. Now search for “buildings.” You’ll see one called “buildings_tools” Check its box then click “ok”. It will download, and you’ll need to restart JOSM. There are a few other settings we need to change also. Go the JOSM menu, then Preferences or Settings. The second button looks like a globe. That’s the connection settings. Make sure you’re logged in with your OpenStreetMap username and password. Then at the second from the bottom button, which is “settings for the remote control feature” make sure Remote Control is checked. This will let the HumanitarianOpenStreetMap Team Tasking Manager use JOSM to download your task. Click OK and we’re ready to map. There are a few ways to start editing in JOSM — either zoom to an area or have the Humanitarian OpenStreetMap Team’s Tasking Manager open an area. The second is probably more likely for what we’ll be working on, so let’s do that. Go to tasks.hotosm.org, and select a task. There’s more on the Tasking Manager in other tutorial videos. Click your square, then click “start mapping” and then instead of “Edit with iD editor,” click the dropdown and select “Edit with JOSM.” Then click that button. Back in JOSM, it will show you outlines of data — maybe some roads, buildings and other features. Next you need to add imagery. Click the “Imagery” menu at the top, then select Bing, which is the default. Bing is also the default for the iD editor. Note that some tasks might suggest other imagery, like Mapbox or another source. Make sure to read the instructions for each task. You’ll notice some parts of the imagery are clear, and some are covered by cross-hatched lines. The clear area is the border of your square from the Tasking Manager Don’t edit outside it! Then we can start drawing buildings with the buildings tool. The tool will draw perfect rectangles with only a few clicks. Let’s zoom in to find a building. To zoom, use your mouse wheel and to pan, click with the right mouse button and drag. Now click the building button or B on your keyboard and trace it. Just three clicks and we have a building. If a building has right angles but is not a rectangle, we can still draw it using the buildings tool, by joining multiple rectangles together. Draw one part first then the other part. Make sure they overlap a little. Then click the selector tool that looks like a finger or the S button on your keyboard. Click one of the rectangles, click shift on your keyboard then click the other rectangle and click “shift-J” for join. Make sure you are highlighting the building itself and not a corner when you select. The other great thing about the building tool is that it will allow you to quickly draw many parallel buildings. For example, here are a number of buildings all aligned the same way. Let’s draw the first one. After drawing it, select it, and keep it selected. Then click the building tool again and draw the next. It will automatically be parallel to the first building. This way you can draw many parallel buildings quickly. Make sure to deselect that building when you’re done. You’ll probably want to zoom in too, to make sure you get each part of the building. In this case, these last two buildings have a little extra part. We want to make sure we add that. Like before, we draw overlapping rectangles. And selecting each part and clicking shift-J When you’re done, we need to save the edits. In JOSM we are actually editing them only on our desktop so we need to upload them back to OpenStreetMap. Click the upload button, and it will automatically add a comment if you are using the Tasking Manager. This is the same comment as you’d add using the browser-based iD editor. If everything is ok, you’ll get a success message. If there are any errors with what you’ve drawn, it will tell you. Here’s one error message. Let’s hit cancel and see what’s wrong It will highlight the error on the map and it will also appear on the “Validation Results” section on the right side of the screen. In this case I forgot to join the two parts of those buildings together. Let’s select them, click shift-J for join, and let’s upload again. But first, let’s fix the edge of that building. Something else you can do with JOSM is simplify shapes by combining vertices or corners. In this case, we joined two rectangles together, but they weren’t perfectly aligned so there’s an extra corner. Let’s zoom in and fix that. Click on one of the vertices that should be joined together and then click the M button on your keyboard for merge. It will combine those two points together and now we have a straight line. Click the Q on your keyboard to square the building, and let’s upload it. No error messages this time, so we fixed it. Another neat trick is the ability to copy and paste buildings like if there are many buildings that are the same size. This is often pretty common in urban areas. So first I’ll draw one building. Then I’ll select it, hit copy on my keyboard, either control or command C move the mouse and put it where the next building is and paste it there with control or command V. Do that again to the next place. And you’re adding multiple buildings really quickly. It’s important you only do this when buildings are the same size and shape and also facing the same way. If a building is a complicated shape you can draw it using either the building tool or the line tool. Let’s use the line tool on this one. So click on the line tool, and just like in iD start clicking on the corners in order to draw the outline. Then, just like in iD, we’ll need to tag this building. The building tool automatically tags the buildings but if we’re using the line we’ll need to tag it ourselves. Click “add” under Tags/Memberships. Start typing building for the key and it will auto-complete. Then in the next field for value, type yes. Hit OK and the building will turn red. And just like in iD, if this building is a rectangle or has right angles click Q to square those corners. If the area you’re working has circular buildings, you can also draw those. Click the line tool and trace the building. Then when you’re done, tag it building=yes like before Note that JOSM will remember the last tags you used and suggest those so in this case it was already tagged building=yes, we just had to hit OK and click the O on your keyboard to make it a perfect circle. Since these two round buildings are the same size, we’ll use copy and paste. Make sure to always upload your changes, and be careful with your drawing. JOSM is very powerful, but it’s also easy to make mistakes and change other data that’s right. Subtitles by the Amara.org community

4 thoughts on “Two Minute Tutorials: Drawing Buildings in JOSM”

  1. How can you tell that something is a building? What should i do if i am not sure? The images do not have a high resolution.
    Also, what do i do if some buildings are no longer there, do i remove the previously drawn building?

  2. hmm should I go with this or just use a custom svg for indoor navigation? what are the advantages? does it come with a out of the box efficient wayfinding solution?

Leave a Reply

Your email address will not be published. Required fields are marked *