Freehand Raster Georeferencer plugin updated for QGIS 3

A few weeks ago, I updated my Freehand Raster Georeferencer plugin for the newly released QGIS 3. I also included a few fixes for some issues as well as new features such as uniform scaling, a new “Georeference with 2 Points” tool (contributed by a user) or taking into account an existing world file. Those changes were backported to the plugin version for QGIS 2 so there should not be any difference between the QGIS 2 and 3 versions. See the updated doc for information.

toolbar

QGIS 3 was released at the end of February and included quite a few changes when it came to plugin development:

  • The most obvious change was that the version of Python used for plugins is now Python 3. My code was pretty much compatible, except that I had to switch to relative imports and drop the u from strings. I used the standard 2to3 tool to check the code.
  • The second most obvious change was the switch to PyQt 5 (instead of PyQt 4). Again, there were not a lot to changes: Basically, update the imported PyQt modules, as well as change the packages for widgets, now in PyQt5.QtWidgets instead of PyQt4.QtGui. I also had to rebuild the .py fils from the .ui with the pyuic5 tool.
  • I also had to update the metadata with the new QGIS 3 version (qgisMinimumVersion=3.0). I was not sure when I published the plugin for QGIS 3 if the QGIS 2 version would be kept available for users still on QGIS 2, but there was no problem: The QGIS plugin manager shows the latest published version of the plugin compatible with either QGIS 2 or 3, depending on which one is used.
  • Finally there were a lot of API changes. The project has released a list of backwards incompatible changes to help and mostly it was pretty clear what needed to be changed. Here are some more details on a few points:
    • The plugin is based around a QgsPluginLayer and I had to add 2 new classes that were not necessary in QGIS 2: one subclass of QgsDataProvider that needs to be returned by the dataProvider() method of my plugin layer + one subclass of QgsMapLayerRenderer that needs to be returned by the createMapRenderer() method.
    • Checking the visiblity of a QgsMapLayer used to be done with something like iface.legendInterface().isLayerVisible(layer). The QgsLegendInterface class has been removed and replaced by a layer tree API. Now, I am not sure if that is the best way but I performed the checking of the visibility of the map layer with iface.layerTreeView().layerTreeModel().rootGroup().findLayer(layer).itemVisibilityChecked()

The QGIS project has released a tool and some instructions for migrating plugins.

PS: I have my own consultancy and love to work on interesting problems. I have helped several startups and established companies deploy innovative GIS and Data Engineering solutions. Check out some showcases of my work at vellut.com. If you have a project that we can collaborate on, then please contact me at contact@vellut.com

Advertisements

“Freehand Raster Georefencer” plugin for QGIS

Some time ago, I released a plugin for QGIS called “Freehand Raster Georeferencer” that allows interactive raster georeferencing. It implements some tools (move, rotate, scale, stretch…) to manipulate a raster directly on the map, on top of the other layers. This is in contrast with the standard raster georeferencing tool of QGIS, which needs control points and then an export to be able to check the georeferencing.

move

Above, the Move tool.

Once the georeferencing is satisfactory, it is possible to export a new raster with a world file and then import it into QGIS in order to use all the available raster analysis tools. The main limitation of the plugin is the lack of support for all the GDAL raster formats: The plugin actually implements its own raster layer that uses Qt to perform reading and only some raster formats are supported (BMP, JPEG, PNG, TIFF).

The code is opensource and on Github. Here is some documentation on the tools.

PS: I have my own consultancy and love to work on interesting problems. I have helped several startups and established companies deploy innovative GIS and Data Engineering solutions. Check out some showcases of my work at vellut.com. If you have a project that we can collaborate on, then please contact me at contact@vellut.com

Paris in 3D with QGIS and three.js

Some time ago, I saw this article about using the Qgis2threejs plugin to export a QGIS map as a 3D visualisation in the browser, thanks to three.js and WebGL. When I recently tried to follow the post to reproduce the results, I had some problem sourcing the data (related to Vienna, Austria) so instead I searched for data related to Paris to create a similar scene. Here is the result corresponding to the screenshot above and another one with aerial photos, both showing the Montmartre area of Paris.

Continue reading Paris in 3D with QGIS and three.js

QGIS 2.0

qgisdesktopscreenshot

Version 2.0 of QGIS (formerly known as Quantum GIS) has just been released! The codename for this version is Dufour.

QGIS is a user-friendly Open Source Geographic Information System (GIS) licensed under the GNU General Public License  (GPL2). QGIS is an official project of the Open Source Geospatial Foundation (OSGeo). It runs on Linux, FreeBSD, Mac OSX, Windows and Android and supports numerous vector, raster and database formats and functionalities.

QGIS provides a continuously growing number of capabilities provided by core functions and plugins. You can visualize, manage, edit, analyze data and compose printable maps.

On top of the desktop software QGIS is well known for, the project also offers QGIS Server (to publish maps and data as OGC WMS and WFS) and a version for Android (coming soon).

Some additional links:

 

PS: I have my own consultancy and love to work on interesting problems. I have helped several startups and established companies deploy innovative GIS and Data Engineering solutions. Check out some showcases of my work at vellut.com. If you have a project that we can collaborate on, then please contact me at contact@vellut.com

GAMA (GIS & Agent-based Modelling Architecture)

GAMA15-roadtraffic

The “GIS and Agent-Based Modeling” blog reports on GAMA, an open source GIS-ABM tool that looks quite interesting:

GAMA is a simulation platform, which aims at providing field experts, modelers, and computer scientists with a complete modeling and simulation development environment for building spatially explicit agent-based simulations. It is being developed by several French and Vietnamese research teams under the umbrella of the IRD/UPMC International Research Unit UMMISCO since 2007.

GAMA provides the modeler with:

– The ability to use arbitrarily complex GIS data as environments for the agents.

– The possibility to run simulations composed of vast numbers of agents (up to millions).

– A way to conduct automated controlled experiments on various scenarios, with a systematic, guided or “intelligent” exploration of the space of parameters of models.

– The possibility to let users interact with the agents in the course of the simulations.

A demo video is also available.

On the Esri side, check out the (free) Agent Analyst extension.

PS: I have my own consultancy and love to work on interesting problems. I have helped several startups and established companies deploy innovative GIS and Data Engineering solutions. Check out some showcases of my work at vellut.com. If you have a project that we can collaborate on, then please contact me at contact@vellut.com

New map styles from Stamen Design

learnt today that Stamen Design have released new map styles for Open Street Map data. I really like the watercolor one, as it is quite different from what is usually seen on web maps. The other two are:

  • Toner: Very clean black & white
  • Terrain:  Features hill shading and natural vegetation colors

A Javascript API is provided in order to access the tiles. If you would like to roll your own maps (with TileMill, for example), the styling instructions are also available for Toner and Terrain.

PS: I have my own consultancy and love to work on interesting problems. I have helped several startups and established companies deploy innovative GIS and Data Engineering solutions. Check out some showcases of my work at vellut.com. If you have a project that we can collaborate on, then please contact me at contact@vellut.com