Skip to content
QGIS plugin to fetch OSM data with the Overpass API
Python Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.tx
core
definitions
doc
qgis_plugin_tools @ a3964ff
quick_osm_processing
resources
test
ui
.flake8
.gitattributes
.gitignore
.gitlab-ci.yml
.gitmodules
.travis.yml
LICENCE
Makefile
README.md
__init__.py
metadata.txt
quick_osm.py
requirements_dev.txt

README.md

QuickOSM

Logo of QuickOSM

Versions

  • QuickOSM is maintained only for a maintained QGIS version (LTR, stable release and dev).
  • Current test status master on QGIS Master and LTR : Build Status
QuickOSM QGIS Min QGIS Max Branch
1.0 → 1.4 2.0 2.18 master_qgis2
1.5 → 1.7 3.0 3.2
1.8 → 3.4 master

Watch the Video tutorial

Install the QuickOSM plugin

  • QGIS Plugins menu → Manage and Install Plugins…
  • Search for QuickOSM and select it
  • Install Plugin

Try a quick query

  • Vector menu → QuickOSM -> QuickOSM
  • In the key field enter amenity
  • In the value field enter toilets
  • Set the name of the town/village to London
  • Run Query

The Overpass API takes a few seconds to respond, and after that you should get new point and polygon layers for the toilets of London! (nodes and ways in OpenStreetMap with the amenity=toilet tag on them)

Generalities

QuickOSM allows you to work quickly with OSM data in QGIS thanks to Overpass API.

  • Write some queries for you by providing a key/value
  • Choose to run the query on an area or an extent
  • Configure the query : which layers, which columns…
  • Open a local OSM (.osm or .pbf) with a specific osmconf in QGIS
  • Build some models with QGIS Processing

There are some useful tips, like automatic colours on lines (if the tag is present) or some actions (right-click in the attribute table) for each entities (edit in JOSM for instance).

Using QuickOSM in a Processing model or in a Python script

Since QGIS 3.4, QuickOSM is available in the Processing modeler. Here some useful algorithms in an appropriate order:

  • QuickOSMAdvanced, one of the Build query algorithms.
  • File ToolsDownload file.
  • Modeler ToolsString concatenation. Useful to concatenate the downloaded filepath with
    • |layername=points
    • |layername=lines
    • |layername=multilinestrings
    • |layername=multipolygons
  • QuickOSMOpen OSM file. Instead of the step above with the string concatenation.

Check a more detailed answer on stackexchange.

  • Vector TableExplode HStore field (QGIS ≥ 3.6)
  • Vector TableFeature filter

Since QGIS 3.6, you can export your Processing model as a Python script.

Development

  • QuickOSM uses a Git submodule.
    • For a new clone, including the submodule, do git clone --recursive https://github.com/3liz/QuickOSM.git.
    • For an existing clone, do git submodule init and git submodule update.
    • These command will populate the qgis_plugin_tools.
  • For panels, you can find a quick diagram in the doc folder.
  • For tests, it's using the unittest framework.
    • They are launched on GitHub using Travis, you can check the Travis status on each commits and pull requests.
    • You can launch them locally using the QGIS docker image:
      • make docker_test using the current LTR following the QGIS release schedule.
      • qgis_plugin_tools/docker_test.sh QuickOSM release-3_4 for QGIS 3.4
      • qgis_plugin_tools/docker_test.sh QuickOSM latest for QGIS Master or any other tags available on Docker Hub.
      • If you are using docker, do not forget to update your image from time to time docker pull qgis/qgis:latest.
      • Setting up your IDE to launch them by adding paths to your QGIS installation. I personally use PyCharm on Ubuntu.
      • Launching tests from QGIS Desktop app, in the Python console.
from qgis.utils import plugins
plugins['QuickOSM'].run_tests()

Authors

Etienne Trimaille : https://twitter.com/etrimaille

You can’t perform that action at this time.