Related Plugins and Tags

QGIS Planet

OSM Building Count Stats

Here is a little update to my last post. I quickly whipped up a web app for the little stats script I wrote. It is available at http://osm.linfiniti.com. The stats only update once per hour so as not to hammer the osm export server. The code is all open source (https://github.com/timlinux/osm-reporter), written in python and... Read more »

OSM Building Count Stats

Here is a little update to my last post. I quickly whipped up a web app for the little stats script I wrote.

OSM Reporter Screenshot

It is available at http://osm.linfiniti.com. The stats only update once per hour so as not to hammer the osm export server. The code is all open source (https://github.com/timlinux/osm-reporter), written in python and Flask. I don't really have time to work on it more right now but hopefully others will pick up on it and improve it. Here are some todo items:

* User defined mapping areas
* SAX parser instead of DOM to support larger OSM files
* [STRIKEOUT:table sorting (most ways first)]
* graphing record accession per user over time
* choosing feature types to report on

Hopefully someone will give me some nice patches :-)

Holiday OpenStreetMap project for Swellendam

If you even visited my lovely home town of Swellendam in the Western Cape of South Africa on http://openstreetmap.org, you might have noticed that the building footprints for the town are almost non-existent. Building footprints provide a valuable way to understand impacts of flood and other natural hazards, as well as being a valuable source... Read more »

Holiday OpenStreetMap project for Swellendam

If you even visited my lovely home town of Swellendam in the Western Cape of South Africa onhttp://openstreetmap.org, you might have noticed that the building footprints for the town are almost non-existent. Building footprints provide a valuable way to understand impacts of flood and other natural hazards, as well as being a valuable source of context information when browsing the town map. It's Christmas holiday season here in South Africa, schools have finished exams and students have time on their hands.

This year Linfiniti Consulting is sponsoring 3 students (from left to right: Jaocoline, Barbara and Nico in the image below) to capture all of the building footprints in Swellendam. Of course I was inspired by seeing the awesome work done by  AIFDRGFDRRACCESS and BNPB and the HOT team in Indonesia.

image0

As well as building footprints they will also capture the building:levels and building:walls attributes so that we can in the future create a nice 3D extruded model of the towns buildings. The students are new to the OpenStreetMap project and have a lot to learn about capturing data fast and accurately, so it should be a great holiday challenge for them!

If you want to grab the current dataset for the area they are going to be working on, you can get it here (in osm format). I wrote a quick and dirty script to get the osm dump from our area and calculate how many ways each person has captured. The script is a simple python flask app. I will probably flesh it out a little as time goes by to make some pretty graphs and reports. In the mean time it just produces something like this:

JPM : 3
Firefishy : 114
uip : 1
CorliJ : 1
thomasF : 11
Chalky White : 1
Burger : 137
Sumarie : 5
Jacoline : 188
timlinux : 28
Tromilemi : 2

Visualising QGIS data with Blender

Anton Westholm just published this great article on using QGIS and blender to create 3D visualisations: http://kodex.tumblr.com/post/37038839550/visualising-qgis-data-with-blender

Visualising QGIS data with Blender

Anton Westholm just published this great article on using QGIS and blender to create 3D visualisations:

http://kodex.tumblr.com/post/37038839550/visualising-qgis-data-with-blender

image0

InaSAFE 1.0 Launched

I have been working a lot in Indonesia this year on the InaSAFE project. InaSAFE is a QGIS plugin (also available as a web extension for GeoNode) for assessment of scenarios following a natural disaster such as a flood, earthquake, volcano, tsunami etc. This month the InaSAFE team (which consists of developers from around the... Read more »

InaSAFE 1.0 Launched

image0

I have been working a lot in Indonesia this year on the InaSAFE project. InaSAFE is a QGIS plugin (also available as a web extension for GeoNode) for assessment of scenarios following a natural disaster such as a flood, earthquake, volcano, tsunami etc. This month the InaSAFE team (which consists of developers from around the world, funded by AUSAID and The World Bank / GFDRR) launched version 1.0 of InaSAFE - which involved a phenomenal amount of work from everybody  on the project. The 1.0 release was made at the AMCDRR, a high level conference for disaster risk reduction in Asia, and was even demonstrated to the President of Indonesia which was a great feather in the cap of QGIS and InaSAFE.

You can get your copy by simply opening QGIS (1.7.4 or 1.8), clicking Plugins -> Fetch Python Plugins, then type 'inasfe' in the filter box and select InaSAFE 1.0 from the list provided. InaSAFE is completely Free and Open Source (GPL v3) and you can get source code from our github project.

Quick setup of Ubuntu 12.04 to work with QGIS SEXTANTE

In the last few weeks we merged the work from the QGIS SEXTANTE project into the official QGIS repository’s master branch. This means basically that in QGIS 2.0 SEXTANTE will be a default plugin, available immediately on installation of QGIS. SEXTANTE uses a pluggable architecture, providing front ends to SAGA, GRASS, Orpheo Toolbox, MMQGIS and... Read more »

Quick setup of Ubuntu 12.04 to work with QGIS SEXTANTE

In the last few weeks we merged the work from the QGIS SEXTANTE project into the official QGIS repository's master branch. This means basically that in QGIS 2.0 SEXTANTE will be a default plugin, available immediately on installation of QGIS. SEXTANTE uses a pluggable architecture, providing front ends to SAGA, GRASS, Orpheo Toolbox, MMQGIS and other useful tools. If you are familiar with ArcGIS then thing 'Arc Toolbox' here and you should have a notion of what SEXTANTE will do for you. If you are running Ubuntu 12.04 it is pretty easy to install the needed backends to fully benefit from SEXTANTE using these few commands:

sudo add-apt-repository ppa:otb/orfeotoolbox-stable-ubuntugis
sudo apt-get update
sudo apt-get install python-saga python-otb grass saga otb-bin otb-wrapping-python otbapp

 If you open QGIS now, all the SAGA and OTB tools should be available to you.

Note: you should use a recent GDAL from the ubuntugis-unstable ppa to avoid GTiff issues.

Improved python console in QGIS master

Today we got another nice new feature in QGIS master – a pimped out python console! The improvements were implemented by Salvatore Larosa with some hints and help from Larry Shaffer. Read on for more details!   There are a number of improvements which center around Salvatore using the PyScintilla editor widget. Probably the most... Read more »

Improved python console in QGIS master

Today we got another nice new feature in QGIS master - a pimped out python console! The improvements were implemented by Salvatore Larosa with some hints and help from Larry Shaffer. Read on for more details!

There are a number of improvements which center around Salvatore using the PyScintilla editor widget. Probably the most significant improvements are syntax hightlighting and code completion. Here is a screeny to whet your appetite. If you are anxious to try it out and don't compile QGIS yourself, try grabbing one of the nightly builds in a day or two.

The new QGIS python editor

The feature still needs some tweaking but it is already usable and useful to dolts like me who can't remember the QGIS API.

Actually it is not illegal to sell Free Software, but it can be bad form

We (the QGIS PSC) had a nice message from a QGIS user today:   I’m a GIS user located in the U.S. and I recently received an email offering several FREE GIS softwares for the low price of $785. I’m not sure how I got on the email list, but it really made me angry that someone... Read more »

Actually it is not illegal to sell Free Software, but it can be bad form

We (the QGIS PSC) had a nice message from a QGIS user today:

I’m a GIS user located in the U.S. and I recently received an email offering several FREE GIS softwares for the low price of $785. I’m not sure how I got on the email list, but it really made me angry that someone was selling these great FREE programs. I’m not sure if there are any legal actions that could prevent someone from doing this, but I do want to get the word out, which is why I am contacting your team.

The GIS Bundle - 6 GIS Applications for $785. <web site url>

Please forward this information on to anyone that you think it may concern.

Thank you for your time and efforts,

[Name Redacted]

We took a look at the site in question - here is what it looks like:

image0

I haven't included any hyperlinks to their site here because I don't want to drive traffic to it - but if you are really curious, you can lift the URL from the above screenshot and take a look (but please be sensible before you click that buy button!).

It is something of a tradition in FOSS that the software is provided at no cost and you pay (if you want to) for the support services that companies provide around this software. But nothing in e.g. the GPL precludes you from selling shrink wrapped copies of the software as long as you comply with the license and make the source code available along with any modifications you may have made. The intrepid entrepreneur in this case seems to be doing just that (though I haven't USD 785 to shell our to confirm this). As Gary Sherman (QGIS founder) replied to the original poster:

They are within their rights---it's been happening in open source for years (e.g. RedHat, SuSE, etc.). In the case of Linux distributions, they actually do some work to create the distribution and bring together a wide array of packages into a cohesive system.

There is nothing to be done about it, except maybe stepping up our marketing program to let people know they can get the goods for free :)

I would urge folks out there who have $785 lying around that they don't know what to do with to rather donate it to their favourite project and grab your copy of the software for free rather than supporting someone who is on the surface giving nothing back to the community.

Making your QGIS command line applications quiet

Here is a quick tip on how to make QGIS less noisy on the command line. I write quite a few command line based apps (typically in python these days) and I got kinda bored of looking at the reams of stuff that gets put onto stdout like this: src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libheatmapplugin.so :... Read more »

Making your QGIS command line applications quiet

Here is a quick tip on how to make QGIS less noisy on the command line. I write quite a few command line based apps (typically in python these days) and I got kinda bored of looking at the reams of stuff that gets put onto stdout like this:

src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libheatmapplugin.so : ..invalid (no type)
src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libinterpolationplugin.so : ..invalid (no type)
 src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libmemoryprovider.so : ... loaded ok (null file filters)
 src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libmssqlprovider.so : ... loaded ok (null file filters)
 src/core/qgsproviderregistry.cpp: 219: (QgsProviderRegistry) Checking /usr/local/qgis-master//lib/qgis/plugins/libofflineeditingplugin.so : ..invalid (no type)
 src/providers/ogr/qgsogrprovider.cpp: 1579: (createFilters) Driver count: 56
 src/providers/ogr/qgsogrprovider.cpp: 1782: (createFilters) Unknown driver REC for file filters.
 src/providers/ogr/qgsogrprovider.cpp: 1782: (createFilters) Unknown driver Memory for file filters.
 etc...

You can quiet away 99% of this output using 3 environment variables:

export QGIS_DEBUG=0
export QGIS_LOG_FILE=/tmp/inasafe/realtime/logs/qgis.log
export QGIS_DEBUG_FILE=/tmp/inasafe/realtime/logs/qgis-debug.log

Of course you could also pipe the stuff out to /dev/null if you don't care to ever see it again.... Here is the total output of my command line app now after setting these environment variables:

timlinux@waterfall:~/dev/python/inasafe-realtime$ scripts/make-shakemap.sh
Processing latest shakemap
Application state:
Prefix: /usr/local/qgis-master/
Plugin Path: /usr/local/qgis-master//lib/qgis/plugins
Package Data Path: /usr/local/qgis-master//share/qgis
Active Theme Name:
Active Theme Path: ://images/themes//
Default Theme Path: ://images/themes/default/
SVG Search Paths: /usr/share/qgis/svg/
 /home/timlinux/.qgis//svg/
 /usr/local/qgis-master//share/qgis/svg/
User DB Path: /usr/local/qgis-master//share/qgis/resources/qgis.db
Creating Warped VRT.

Remote debugging QGIS plugins using PyCharm

Wow it’s been a long time since I posted anything here….but I’m back with another (hopefully) useful howto. Over the last six months or so I have made a rather dramatic shift away from using VIM as my primary development environment for everything to using IDE’s for my python development work. I spent the first... Read more »

Remote debugging QGIS plugins using PyCharm

Wow it's been a long time since I posted anything here....but I'm back with another (hopefully) useful howto. Over the last six months or so I have made a rather dramatic shift away from using VIM as my primary development environment for everything to using IDE's for my python development work. I spent the first 4 or so of those months using Eclipse PyDev which is excellent but has certain issues, particularly from a QGIS context. Most of the issues relate to my not being able to get it to reliably recognise the QGIS API after adding the QGIS python directories to the package search path and the lack of decent refactoring tools. In my java programming days of yore, I used to love the refactoring tools that Eclipse provided, but unfortunately these are not carried through to PyDev.

Lately I have been using PyCharm which is a dedicated python IDE also written in Java (ironic). I'm not going to attempt to review all of PyCharm here (Guido van Rossum already did that but bear in mind the review is two years old and the software has surely advanced a lot since then). I will say there are two things that I find not as pleasant to use in PyCharm (compared to PyDev) - its PyLint and PEP8 checkers. In the projects I work on we follow PEP8 very strictly and not having a proper integrated tool for this is a real PITA. There are work arounds however so it is not a lost cause, but it would be nice if the developers took this a little more seriously:

On the other hand, I simply do not see the value of highlighting PEP 8 violations in the editor, especially in the middle of code modifications. We'd rather spend our time implementing inspections that report actual problems with the code, and not formatting nit-picks. - Dmitry Jemerov

One other big downside to PyCharm is that it is not open source software which goes against the grain somewhat. They do however provide free licensing to those using it for bona fide open source development work, so don't let the price tag deter you if you are planning to use if for a FOSS project.

Read on to see how I use PyCharm for QGIS development...

PyCharm for QGIS remote debugging

Why use PyCharm? Well it happens to be a really nice platform for QGIS python / python plugin development. For this article I am going to focus on the steps needed to remote debug python scripts / plugins running inside QGIS. The process is conceptually the same as remote debugging using Eclipse/PyDev - which I have blogged about previously. I am going to start with the assumption that you have your PyCharm set up and your plugin basics in place and now you are at the point where you wish to debug your software while it is running in QGIS. Let me prefix this by saying that I very seldom need to use this technique since our code is heavily tested (by means of a python test suite) so in most cases I can just debug a particular test directly without needing to remotely attach to a python process in QGIS. So the first thing you need to do is set up a python debug server (provided as part of PyCharm). To do this,  choose edit configurations from the task list:

Create a new run configuration

Next click on the little '+' icon and choose python remote debug:

image1

Set the following options:

  • Local host name: localhost
  • Port: 53100

Note that you can use any high port that you like (assuming it is unused).

You will notice that on the dialog it gives you some handy hints as to what needs to be inserted into your code in order to enable the trace point.

Creating the debug server run configuration

The next thing you need to do is add a couple of lines to the module that you wish to debug (this is also described in the above dialog). First, in your imports add this:

from pydev import pydevd

And then in the place where you wish execution to halt, add this line:

pydevd.settrace('192.168.1.62',
                port=53100,
                stdoutToServer=True,
                stderrToServer=True)

You can also try using 'localhost' instead of your IP address.

The last thing you need to have in place before you can test is pydevd needs to be in your PYTHONPATH in the context of the running plugin. In my case I simply extracted the pydevd egg supplied in the root of the PyCharm installation into my plugin directory:

cp ~/apps/pycharm-2.5.2/pycharm-debug.egg .
unzip pycharm-debug.egg

There are a number of other ways you could do this, for example by changing your code to add the pydev directory into sys.path.

Ok now you are all set. One thing to remember is that the settrace line is just the initial breakpoint - you can set additional breakpoints in your code using normal PyCharm debugging techniques. Now launch your PyCharm debug server configuration by clicking the little run icon next to it (highlighted in red below):

Start the debug server

After this you will see some output like this in the PyCharm run panel:

Starting debug server at port 53100
Waiting for connection...

Next fire up your copy of QGIS and open the plugin that will trigger your settrace. When the trace point is hit, PyCharm will enter debug mode and highlight the trace line in blue like this:

PyCharm debugging a remote process

Now you can step through your code, inspect variables and generally have a productive time understanding your code. I'll hopefully post a follow up article on how to set up PyCharm for QGIS development in the future! Happy hacking!

Interview – Anna Mason from MapAction

Today I had a chance to do a quick interview with Anna Mason from MapAction.     The interview is an mp3 audio file recorded on my phone. My apologies if the sound quality isn’t the best. Click on the link below to download the mp3 file. Anna Mason MapAction Interview 23 May 2012  ... Read more »

Interview - Anna Mason from MapAction

Today I had a chance to do a quick interview with Anna Mason from MapAction.

Angoram

The interview is an mp3 audio file recorded on my phone. My apologies if the sound quality isn't the best. Click on the link below to download the mp3 file.

Anna Mason MapAction Interview 23 May 2012

You can see more MapAction pics on their flickr page. After the interview, Anna did mention that in addition to the ESRI software mentioned in our chat, they are also heavy users of QGIS and OpenStreetmap data. MapAction are doing awesome work and I am really pleased that organisations such as this exist!

Back to Top

Sustaining Members