JOSM/Plugins/BuildingsTools

From OpenStreetMap Wiki
Jump to navigation Jump to search
BuildingsTools icon BuildingsTools
Plug-in for drawing rectangular or round/circular buildings

Buildingstools is plug-in for simple drawing of rectangular or round/circular buildings.

The problem it solves

Drawing many rectangular buildings in JOSM can be tedious. One needs to draw a rough rectangle in 5 mouse clicks, then use the Tools... "Orthogonalize Shape" function, then insert "building=yes" tag in the resulting polygon.

As an alternative, at the beginning of an editing session, you can activate angle-snap mode by pressing A. Then one needs to draw an exact rectangle in 5 mouse clicks. At the end of an editing session, press Ctrl+F to open the search dialogue. Type: new -closed untagged type:way to select rectangles that you failed to close due to misclicking, investigate them in the selection window and merge the end nodes and ortogonalize them (you may add temporary tags to mark them). Then search for new closed untagged type:way, tag them with "building=yes". This method is especially useful for multi-part buildings or those that are not a simple rectangle.

Due to improvements in JOSM, now it can be done somewhat quicker than before, for example using Extrude (instead of drawing and orthogonalizing the outline) which reduces the number of clicks, and then adding building=yes to all your buildings at once when you're finished drawing them. But even like that - it's still relatively complex and time consuming.

Here comes BuildingsTools - the plugin which makes it all much faster and allows a mapper to add complete buildings in just 1 to 3 mouse clicks!

Installation

Drawing a building over Bing Imagery

Install the plugin per the instructions at JOSM/Plugins#Installation. You can also Watch a demonstration video for a simple (while a relatively old) tutorial on how to install and also use the plugin.

Usage

The plugin adds a new "Draw buildings" button on the toolbar to the left, which you can then use by clicking on it, or just by pressing the B button.

Rectangular buildings mode (default): To automatically create a rectangular building object - you have to draw a line along one side of the building, then click on the opposite side. You can activate this mode by Alt+R, if circle buildings mode is active.

Circle buildings mode: From the More Tools -> Draw buildings modes -> Set building shape to circle menu or keyboard short cut Alt+Z (if you have NVIDIA Panel used by this shortcut, it will not work in JOSM) your can configure the plugin to draw round buildings. To then draw a round building click once on the outer edge of a round building and draw a line to the other side and click once on the edge of the building on the other side. You can return to rectangular buildings by typing Alt+R.

Two-click building drawing mode: If selected way is orthogonalized or drawn using BuildingTools, 2-click building drawing mode is enabled, which allows for an even quicker mapping of buildings sets by just clicking on two corners of the new building. Selecting "Auto-select building" option in settings helps to use it most effectively when mapping a lot of buildings.

One click drawing: By default circles can be created by simply clicking, dragging, and releasing, because they have neither an orientation nor aspect ratio. For rectilinear shapes, If either the Building Width/Diameter parameter is set to a non zero-value, or elements that can be aligned to are selected before mapping the next shape, it is possible to create them using just one click.

! Probably outdated info, as nothing is snapping by default now: Temporarily disable all snaps by pressing Ctrl key. This helps when mapping an isolated house that isn't parallel to the nearby street.

Plugin options and additional features

To open plugin options, press Ctrl+Alt+B . Or another way, you can select More Tools -> Draw buildings modes -> Set buildings size in the JOSM menu on the top, which opens the same window.

  • Rectangle/Circle Selectors - here you can also select which shape you'd like to draw.
  • Building Width/Diameter [rational number to 3 d.p.]: If you want to draw many shapes with the same width, you can set a constant width (in meters) here. The first click sets a corner/diameter position and generates a line with the specified width, while the second is used to set the direction (and length). This makes it possible to draw a rectangle by just tracing a line along one of its sides e.g. the wall of a building. When drawing rectangles, using a negative value reflects the shape to be drawn along the line you trace i.e it'll appear on the other side of your cursor: this can be useful depending on the properties of imagery you're using (such as the direction in which shadows are cast), or your preferences. 0 is the default value and disables this feature.
  • Length step [positive rational number to 3 d.p.]: Building length snaps to multiples of the parameter. This feature can work in concert with building width to draw rectangles with defined dimentions. When drawing circles with building width/diameter set to 0, this feature can serve as a more versatile version of it because the lenght then represents the diameter. 0 is the default value and disables this feature.
  • Use Address Dialog: Plugin has built-in addressing dialog. It remembers the street name and automatically increments or decrements house numbers (+2 or -2).
  • Auto-select building: Select newly created building if nothing is currently selected. Works closely with 2-click drawing mode, as when a way is selected, BuildingTools snaps walls angle to each segment of that way. For example, after you drew one set of buildings, press Esc key to deselect currently selected building and draw a building from second series - then it will be automatically selected and next buildings now will be aligned to it.
  • Auto-select replaces existing selection - Causes every new added building to now be the one selected (and the next building aligned to it instead), instead of first one in the series.
  • Use address nodes under buildings - When there is a node with "building" tag with address information within a newly created building, add tags and relation memberships is copied to new building and original node is removed.

"Advanced..." submenu:

  • Building tags [key/value pairs]: Add or modify the default building=yes tagging to whatever set of tags you desire. It doesn't even need to be buildings, you might find it useful for mapping other commonly rectangular features such as leisure=pitch and amenity=parking. The default tagging can be adjusted in the "Advanced Preferences": opening the menu JOSM -> Settings -> Advanced Preferences and then open the entry with key "buildings_tools.tags".
  • Big buildings mode: When mapping in two-clicks mode, you usually click the first corner of the building and move your mouse to another. If you see that the walls don't fit to what you see on WMS image, you are supposed to press Shift and draw one wall, clicking on the third corner afterwards. In big buildings mode, you just click on first corner, press Shift and click on the opposite corner, rotating the building outline afterwards. (This can be activated in the "Advanced" dialog.)
  • Rotate crosshair: When mapping in two-clicks mode, it's more useful to have cross-hair cursor rotated to be parallel to the walls of the newly created building.
  • Disable click+drag: When this setting is enabled, the mode forces you to click once to start drawing the shape and again to create it. This effectively limits the minimum number of clicks required to create a shape to two. When using a touch screen, with this setting enabled it may be impossible to draw shapes in this working mode.
  • Switch between circle and rectangle modes: When this setting is enabled, the shape the tool will draw can be toggled via the same keyboard shortcut used to enter this working mode.

Mapping with oblique corners

Drawing a building with oblique corners

In past there was a lot of problems with buildings with oblique corners because they cannot be orthogonalized. Now it's relatively easy to draw such buildings. One can set a constant width in Buildings size dialog, draw two intersecting buildings and then use tools... "Join overlapping areas" function ( Shift+J).

Developer

Created by User:Upliner. Please submit your bug reports and feature requests.

Source code: SVN (note: this repository was archived on Oct 14, 2022, so link probably needs updating).

See also