Massive Change Detection - QGIS plugin
QGIS 2 plugin that applies change detection algorithms on satellite imagery for building reports for urban planning.
Add plugins repository
To install this plugin, you need to add our QGIS Repository first. Go to
Plugins -> Manage and Install Plugins.
On the Settings tab, enable
Show also experimental plugins, and add a
Dymaxion Labs with the following URL:
After that, press
Reload all repositories button to load our plugins index
Install external dependencies
This plugin makes use of some additional Python dependencies. In a terminal, run the following:
pip install --user fiona numpy opencv-python rasterio shapely
Finally, go to
Plugins -> Manage and Install Plugins, and in
Not Installed tabs, search for Massive Change Detection. Click
This is a processing plugin, you will have to enable the Processing Toolbox on QGIS to use it properly.
Step 1: Generate change detection raster
The first step is to generate a change detection raster based on two raster images. The algorithm detects changes between the "old"/"before" image and the "new"/"after" image and generates a new binary raster of changes.
Both input rasters must be coregistered and be of the same size and resolution. If you have images of different size and/or resolution, you will need to manually superimpose and clip them first. You can use Orfeo Toolbox to do this (see Superimpose).
Suppose you have two raster layers loaded on QGIS:
Massive Change Detection -> Pixel-based algorithms -> Multiband Difference from the Processing Toolbox.
before.tif layer on
Input old layer and
after.tif layer on
Input new layer. You can use automatic thresholding (Otsu's method) or manually set a
threshold by unchecking
Automatic thresholding and choosing a proper value on
Threshold value. You can adjust the post-processing filter and its kernel
size for better results. Finally click
Run to process the image.
Step 2: Build report of changes
The second step is to build a changed lots report based on a vector layer of lots and a change detection raster. Lots vector layer must be in the same projection as rasters.
Massive Change Detection -> Report -> Generate changed lots data from
the Processing Toolbox.
Use your change detection raster (already generated on Step 1) on
Input change detection layer, select one of your input raster images (
Input image layer. Then set your lots vector layer on
Input lots vector layer field, and select the lot id field on
Lot id field.
The selection threshold is related to the percentage of detected change in a particular lot. For example, 0.5 means that a lot that has changed more than 50% of its area is marked as changed.
This algorithm will generate both a new vector layer of changed lots and a table (CSV) layer.
Clone the repository inside your QGIS plugin directory. On Ubuntu this would
cd ~/.qgis2/python/plugins/ git clone https://github.com/dymaxionlabs/massive-change-detection cd massive-change-detection
Install packages for test and code coverage.
pip install --user -r requirements.txt
If you have installed QGIS from source use
scripts/run-env-linux.sh to set up
the environment variables so that Python can find QGIS inside your virtual
environment. For example, if it is
source scripts/run-env-linux.sh /opt/qgis2
Run tests and build code coverage reports with
You can find the list of supported locales is in the
LOCALES definition on
Makefile. If you want to add a new language, you have to add it there first.
Prepare translations strings with
make transup. This command will search all
translated strings in the repository and generate
Edit the translations files (files ending in
Finally compile translation strings with
Please report any bugs and enhancement ideas using the GitHub issue tracker:
Feel free to also ask questions on our Gitter channel, or by email.
Any help in testing, development, documentation and other tasks is highly appreciated and useful to the project.
For more details, see the file CONTRIBUTING.md.
Source code is released under a GNU GPL v3 license. Please refer to LICENSE.md for more information.