Related Plugins and Tags

QGIS Planet

XKCD on Map Projections

Recently, XKCD strayed into our territory with this page about map projections: To be honest, I’ve always like Gall-Peters myself, if only as a way to illustrate how map projections distort the appearance of continents. It’s quite effective at conveying this concept, because it distorts things in the opposite direction of the universally familiar Mercator. [...]

XKCD on Map Projections

Recently, XKCD strayed into our territory with this page about map projections:

Map Projections

To be honest, I've always like Gall-Peters myself, if only as a way to illustrate how map projections distort the appearance of continents. It's quite effective at conveying this concept, because it distorts things in the opposite direction of the universally familiar Mercator. If you're using it as a legitimate map projection, though, I honestly don't know what to say to you.

Free SSL Certifications for your web site

Alex Mandel on #qgis IRC channel pointed me to this site: https://www.startssl.com/ which issues level 1 SSL certs for free. We are in the process of getting a certificate issued for QGIS.org but the site is generally useful for others who would like to obtain an SSL cert for their site easily.

Free SSL Certifications for your web site

Alex Mandel on #qgis IRC channel pointed me to this site: https://www.startssl.com/ which issues level 1 SSL certs for free. We are in the process of getting a certificate issued for QGIS.org but the site is generally useful for others who would like to obtain an SSL cert for their site easily.

A nice article : Teaching with FOSSGIS

Here is a nice article about teaching a semester course with FOSSGIS that William Kinghorn put me on to: However, most students are shocked to discover how many capable FOSS GIS software packages exist and are excited that they can just download and install them, even on a Mac. They ask questions like, “Why isn’t [...]

A nice article : Teaching with FOSSGIS

Here is a nice article about teaching a semester course with FOSSGIS that William Kinghorn put me on to:

However, most students are shocked to discover how many capable FOSS GIS software packages exist and are excited that they can just download and install them, even on a Mac. They ask questions like, "Why isn't everyone using QGIS?" Frequently students end the semester wanting more.

See the article here:  http://www.directionsmag.com/articles/experiences-teaching-free-and-open-source-gis-at-the-community-college/212522

Interviews from the Zurich QGIS Developer Meeting

At the recent get-together, I made a bunch of short clips with most of the attendees. These are presented below (or on my youtube channel). My apologies if you need to tilt your head 90′ left for some of them, YouTube’s online video editor is still a work in progress it seems… Just play the [...]

Interviews from the Zurich QGIS Developer Meeting

At the recent get-together, I made a bunch of short clips with most of the attendees. These are presented below (or on my youtube channel). My apologies if you need to tilt your head 90' left for some of them, YouTube's online video editor is still a work in progress it seems... Just play the first video and the rest will follow automatically.

[advanced_iframe securitykey="da39a3ee5e6b4b0d3255bfef95601890afd80709" src="http://www.youtube.com/embed/videoseries?list=PL5812807A37E198E0&hl=en_GB" height="315" width="560"]

View on YouTube directly

Zurich QGIS Developer Meeting Summary, November 2011

I am writing this sitting on the plane making the ~25 hour return trip from Zurich to Swellendam (via Dubai) and as has become tradition, I thought I am making this summary of the activities at our bi-annual QGIS developer meeting. The developer meetings themselves have become a huge propellant to the project – bringing together [...]

Zurich QGIS Developer Meeting Summary, November 2011

I am writing this sitting on the plane making the ~25 hour return trip from Zurich to Swellendam (via Dubai) and as has become tradition, I thought I am making this summary of the activities at our bi-annual QGIS developer meeting. The developer meetings themselves have become a huge propellant to the project - bringing together developers and users from all areas of the project and providing a forum for us to plan and discuss things at a level of detail that simply isn't possible via email, IRC and so on. The meeting also acts as a catalyst where a few moments spent between two people can provide the needed knowledge transfer to enable new contributions of code, bug fixes, documentation or whatever else is needed to cross a barrier that would otherwise prevent a person from helping the project.

We have now held developer meetings in Hannover, Vienna, Pisa, Wroclaw, Lisbon and Zurich and due to the kind contributions of our project sponsors have increasingly been able to cover the costs of attendees. This year all the meals were paid for by sponsors / donations, as well as the travel and accommodation for some developers. A number of Zurich residents also opened the doors of  their homes to provide accommodation for attendees. In addition each attendee contributed time out of their personal and professional lives that if we were to pay for this time in professional fees would amount to a massive investment.

This year the QGIS project has had two silver sponsors and the increasing levels of sponsorship are really a fantastic enabler for us to move the project forward significantly. I am looking forward to the day when funding levels have reached the level that a number of us can be employed by the project to work on improving it in a general way rather than meeting the specific needs of a single client.  For more information on how to sponsor or donate to the project, please see http://qgis.org/en/sponsorship.html.

Our host for the meeting was the Institute of Cartography, ETH Zurich. We would especially like to thank the following people who facilitated the meeting:

  • Ionut Iosifescu for helping to organize the meeting and arranging for permission for ETH to host it.
  • Prof. Lorenz Hurni,  department head at the institute for generously agreeing to host the meeting.
  • Corina Pachlatko - the secretary for organization and providing food/coffee!
  • The State of Vorarlberg (our latest silver sponsor) for their donation which covered the costs for attendee travel and accommodation and really helped to jump start proceedings.
  • Peter Oberholzer  from the City of Uster for covering food expenses.
  • Marco Hugentobler, Pirmin Kalberer and Mathias Walker from Sourcepole for helping to organise the meeting.
  • The City of Uster paid for the food/bread/supermarket bills.
  • Andreas Neumann who helped to organise the event and donated his time and money to make it happen.

There are many more who worked hard behind the scenes to make the event happen, and we extend our thanks to you all! The food provided was really tasty including these delicious salty 'pretzel' things:

Delicious food and snacks kept the attendees going at full

Delicious food and snacks kept the attendees going at full tilt!

I was given the opportunity to present a talk  at the University the day before the developer meeting commenced. The talk was well attended and sought to show the profound present and potential future impacts the project has on society by highlighting a number of developers and users that I have encountered through my involvement in the project. My apologies to those who didn't get a mention, I know there are many more people out there who should be included in the presentation for the important contributions they make.

QGIS For Humanity audience

Although we call it a developer meeting, these get togethers are not only for developers, but also for anyone who wants to be involved in the project or to get some face to face time with members of the QGIS community. There were a number of main discussion points during the meeting that I am aware of which I am going to try to hightlight below, but bear in mind there were also many other discussions and activity which I was not involved in, so hopefully others will blog about what I have missed below.

Topology

Undoubtedly a hot topic for the meeting was topology - in particular future support for PostGIS 2.0's new topological data model. Sandro Santilli was the main instigator of this discussion. Sandro is a developer on the PostGIS and GEOS projects and having 'from the coalface' input from him is highly invaluable. There was a lot of discussion about whether it would be possible to unify the editing functionality in QGIS between some or all of:

  • simple feature editing built into QGIS
  • GRASS topological editing
  • PostGIS topological editing

At the moment the concensus seems to be that these three systems need to remain discrete due to major differences in the underlying data models, but if anyone comes up with a sane way to unify editing functionality between these it would certainly be welcomed with open arms. Sandro was able to relay a lot of incredibly useful and detailed insight into the PostGIS topological data model to other developers which will prove invaluable in the future as we adopt this new PostGIS capability within QGIS. Inevitably the topology discussions made their way to the dinner table too as you can see below:

In in-depth explanation of topology using condiments and sugar packets!

QGIS Web Client

There was a great session held on the QGIS Web Client where we discussed future plans and key areas for improvement in the QGIS Web Client. I finally merged in some changes to the web client that we implemented for the Norwegian Trekking Association including a 'ready to run' sample hello world project. Mathias Walker incorporated his improvements that include 'out of the box' search capability for QGIS layers and the ability to search for GeoNames places and zoom to them directly. There was also a lot of discussion about support the web map context standard, implementing support for plugins, improving the documentation, supporting tiled WMS requests, and many other useful improvements which are outlined on this wiki page.

QGIS Web Client Updates

QGIS Documentation

I finally had the chance to migrate the QGIS Documentation from SVN to GIT and we created a number of new GIT repositories to provide hosting for the QGIS Manual, the QGIS Python Cookbook, the latex version of the Gentle Introduction to GIS and so on. Otto Dassau, Yves Jacolin and myself had some in-depth discussions on the possibility of migrating the documentation from LaTeX to ReStructured Text (.rst). Although this won't happen immediately, it is something we have put on the roadmap for after the 1.8 documentation update. One of the cool things about GitHub is that it allows in place editing and committing of files in the repository if you are logged in with your GitHub  account, so in the future documentation editors will be able to do their work without needing any knowledge of GIT. We also spent some time evaluating the rst2odt tool which will allow us to generate LibreOffice documents from where we can export pdf's, word documents and so on, as well as apply custom styles to the documentation and do some post-processing before making a print ready document. Although .rst is not completely intuitive (compared to e.g. writing the document in a word processor) but the feeling was that .rst is easier to  learn than LaTeX while still offering support for generating a diff between versions which is vital for documnt translators to see what has changed between successive versions.

Otto Dassau - QGIS Documentation Lead

Yves Jacolin - French documentation team

Release management

I am very pleased to welcome Werner Macho to the release team. Putting out a new release of QGIS is a lot of work and now that we are doing maintenance 'point' releases, the work is only increasing. Werner has kindly volunteered to do the maintenance 'point releases while I work on the new major and minor releases. In otherwords, after I put out 1.8.0, Werner will apply backportable patches & bugfixes to the 1.8 branch to generate 1.8.1, 1.8.2  etc. releases from that branch. We used the developer meeting as an opportunity for me to train Werner in the release process, using 1.7.2 for our exercises - which will be coming to your desktop in the near future. We also had some participation on the IRC channel from Alexander Bruy (from the Ukraine) who was helping to backport fixes to the 1.7 branch.

Due to some demand for a new minor version release (i.e. QGIS 1.8), and the fact that we have not yet broken backwards API compatibility in master, we have decided that 1.7.x will not be the last release before version 2.0 after all, so I have branched 1.8 and you can expect to see it released in the next month or so (exact timetable for release still to be announced).

Werner Macho - release assistant

By the way, Werner has decided to resume his studies to complete a GIS Master's degree - if anybody has a part time job for him over the next two years, please contact him!

Android

Marco Bernasocchi also attended the hackfest. Marco implemented Android build support for QGIS during his Google Summer of Code project earlier this year. During the hackfest Marco kindly took the time to show me how the build chain works and updated his scripts to improvme them and cater for updates in the Qt Android sdk. Marco went on to set up everything on my server and we will be providing a nightly build of QGIS for Android on this extremely smart looking website:

http://android.linfiniti.com/

He also worked on some bugs with shapefile support and the QGIS Android implementation is slowly heading towards a 1:1 fidelity with the desktop build. Note that Marco's work is at the moment a straight port of to the Android platform - making a stripped down, dedicated touch based user interface is on the roadmap for the future. Various people have already offered to sponsor new development work for the QGIS-Andoid platform - if you would like to see something specific added, please contact Marco Bernasocchi directly.

Benchmarking

Radim Blazek has been doing some interesting work on benchmarking QGIS vector performance over successive versions of the QGIS codebase. Having a rigorous benchmarking strategy will allow us to understand when vector rendering optimisations have been effective, and when a change in the code base has been  costly in terms of perfomance.

Radim Blazek

Radim also spent some time showing me what is needed at release time to support the new customisation framework that will be in QGIS 1.8.

Plugin repository

Alessandro Passoti spent the meeting improving the new plugin repository to get it ready for prime-time. I have added the new repository as a default repository in the plugin manager now so that we can start to see broader testing and usage of the repository from 1.8 forwards. Alessandro also implemented support for the new ini based metadata standard for plugins that will take effect from 2.0. Switching to ini based metadata will speed up QGIS start time because the plugin loader will no longer need to try to dynamically load each plugin to get its metadata from its __init__.py file.

Alessandro Passoti

Unit Tests

We spent some time discussing the unit test framework. We already have a unit test framework but it has not been actively used and maintained. Having a good unit test framework is essential for Quality Control of our software and to prevent regressions (where fixing one bug breaks another feature that was previously working). I spent the monday working to improve the tests. Firstly they are now enabled by default when you build QGIS from source. Secondly they can now be run from within the build tree (and are no longer installed to the application prefix when you do make install). Next I have changed the tests so that they do not pop up the test report html page in the browser automatically (and subsequently block the next test from running. Also all the test reports are combined into a single file - /tmp/qgistest.html under Linux. I also started going through the test suites one by one making sure they all run and pass. I currently have 12 out of the 16 test suites passing and the rest should be done in the next week or so.

There are three important additions I want to make for the test suite:

  1. generating test stubs for all the core, gui and analysis library classes
  2. implementing our own CMake Dart server
  3. running nightly build & tests and submitting the results to our own dart server

The dart server will aggregate test results from anybody who runs the tests with an appropriate command line flag and will provide a fantastic way to monitor when changes to the code base break functionality on specific  platforms and architectures. Creating stubs for all classes in core, gui and analysis libraries will make the process of writing tests for developers trivial and thus pave the way to creating a comprehensive test portfolio for QGIS.

I have already written detailed notes on how to write tests in the CODING guide at the top of the QGIS source tree som time ago, and I hope that we can stimulate a renewed interest in having a good test suite within our developer community.

If anyone is able to fund my work in this area, please contact me as the work is time consuming and will be slow in coming if I can only do it in my spare time. Funding such work will have a broad reaching benifit across the project as a whole.

New Geometry Class

Marco Hugentobler used the developer meeting to start work on a new QgsGeometry class. The new class will allow us to support Arcs, splines, geometry collections and so on which are useful for people working in an engineering setting (and in a whole lot of other situations too). It's a somewhat major undertaking but is going to bring the project another great step forward!

Marco Hugentobler and QGIS protegé Florina Hugentobler

Conclusion

I have no doubt left out many important updates but hopefully others attending the meeting will also blog about their experiences to complete the picture. We are looking forward to our next meeting in Lyon, France next April. My thanks once again to all of the people who work on the project and who organised the meeting. Each time I attend these meetings I leave with renewed enthusiasm for our project and an ever increasing sense of awe over what has been achieved by a small group of intelligent, friendly and often humorous individuals!

QGIS presentation at ETH

Today is the start of our 7th? QGIS developer meeting. This time it is being hosted at the Institute of Cartography, ETH Zurich. Yesterday I gave a presentation about some of the people behind the project and tried to demonstrate the societal benefits that are being realised by a project such as QGIS. For those [...]

QGIS presentation at ETH

Today is the start of our 7th? QGIS developer meeting. This time it is being hosted at the Institute of Cartography, ETH Zurich. Yesterday I gave a presentation about some of the people behind the project and tried to demonstrate the societal benefits that are being realised by a project such as QGIS. For those interested, it is available here.

QGIS Presentation

Today the hackfest is kicking off with with various talks including an in depth discussion onPostGIS topologyand potential support for it within QGIS.

Adding a counter to postgresql query results

Just a quickie because I always forget this and need to look it up again. If you have a query in postgresql and you want to include a sequential identifier in the output, you can use the very handy ROW_NUMBER() function. Note, you need Postgresql 8.4+ I believe. Here is a quick example: create view [...]

Adding a counter to postgresql query results

Just a quickie because I always forget this and need to look it up again. If you have a query in postgresql and you want to include a sequential identifier in the output, you can use the very handy ROW_NUMBER() function. Note, you need Postgresql 8.4+ I believe. Here is a quick example:

create view vw_farms
as
select ROW_NUMBER() over (order by parcel.farm_name) as id,
parcel.farm_name,
parcel.geometry
from parcel
where parcel.farm_name != '' limit 10 ;

Which returns something like this:

 id |     farm_name
 ----+-------------------
  1 | ADDERLEY 66
  2 | ADDERLEY 66
  3 | ADDERLEY 66
  4 | ADDERLEY 66
  5 | ADDERLEY 66
  6 | AFDAKS RIVIER 575
  7 | AFDAKS RIVIER 575
  8 | AFDAKS RIVIER 575
  9 | AFDAKS RIVIER 575
 10 | AFDAKS RIVIER 575
(10 rows)

This function is documented in the Postgresql docs here.

One more thing - if you would like to use the above technique to bring a view into QGIS which does not otherwise meet QGIS' requirement that the view have a column derived from a primary key or a column with a unique constraint on it, you can cast the row number to int4 like this:

create view vw_farms
as
select int4(ROW_NUMBER() over (order by parcel.farm_name)) as id,
parcel.farm_name,
parcel.geometry
from parcel
where parcel.farm_name != '' limit 10 ;

The last step then is to explicitly tell QGIS to use this column as the primary key. Do this in the PostgGIS add layer dialog, by selecting the view and then selecting the id field from the combo box available in the primary key column as illustrated in the image below.

Specify the primary key column manually

jQuery: selecting a child element

The jQuery JavaScript library allows you to select any element on a webpage and modify it. I will assume you already know how it works, or at least what it's for. Now, say you have a table containing the following: <tr id="123" class="employee"> <td class="name">John Smit</td> <td><img src="..." class="image" /></td> </tr> <tr id="983" class="employee"> <td [...]

jQuery: selecting a child element

The jQuery JavaScript library allows you to select any element on a webpage and modify it. I will assume you already know how it works, or at least what it's for. Now, say you have a table containing the following:

<tr id="123" class="employee">
  <td class="name">John Smit</td>
  <td><img src="..." class="image" /></td>
</tr>
<tr id="983" class="employee">
  <td class="name">Juan Smith</td>
  <td><img src="..." class="image" /></td>
</tr>
<tr id="219" class="superhero">
  <td class="name">Mr. Incredible</td>
  <td><img src="..." class="image" /></td>
</tr>

Selecting only the employee elements (assuming that the class "employee" is not used elsewhere) can be done via '$(".employee")'. For example:

$(".employee").css("color", "red");

would set the names of both employees to red. Similarly, it's easy enough to select a specific row and hide the person's name:

$("#219.name").hide();

But what if you have a situation where a certain element is being passed to your function as an object? You have the variable 'myRow', for example; and it's an unknown (to you) element on your page. And now you want to hide only the image within that row. You don't know the id you've been given, you just have the object. Even if you get the object's id out via myRow.attr("id"), how can you pass it to your jQuery selector? And how can you select and hide the image? Using something like

$("#219.image").hide();

would not work, because (even assuming you get the ID in there somehow) the "image" element is two levels down. The row with id 219 does not have a child of the "image" class. It has a classless child which in turn has a child of the "image" class. So the selector "#219.image" will return nothing. This seems like quite the unsolvable problem. (EDIT: see the comments for a way to do this without jQuery as suggested by Barry Rowlingson.)

It turns out that jQuery already has a neat, pre-packaged solution for this conundrum. It's the .find() function, and in our example, it could be used like this:

myRow.find(".image").hide();

Very simple, and very useful! Pass it an element on your page, and you can select any child of a given class.

Batch backup of postgres tables with bash

Here is a little batch script I wrote to backup my postgresql databases all in one go. I use similar scripts on my servers but this on is a bit different in that it has an outer loop to backup the three different instances of postgres I have running on my system, each in turn [...]

Batch backup of postgres tables with bash

Here is a little batch script I wrote to backup my postgresql databases all in one go. I use similar scripts on my servers but this on is a bit different in that it has an outer loop to backup the three different instances of postgres I have running on my system, each in turn (I am running 8.4, 9.0 and 9.1).

#!/bin/bash
MYDATE=$(date +%d-%m-%Y)
for PORT in 5432 5433 5434
do
  echo "Backups on port $PORT"
  export PGPORT=$PORT
  LIST=$(psql -l | awk '{ print $1 }' | grep '^[a-z]' | grep -v template | grep -v postgres)
  for ITEM in $LIST
  do
    NAME=${ITEM}-${MYDATE}.dmp
    echo "Backing up $ITEM to $NAME"
    pg_dump -Fc -f $NAME ${ITEM}
  done
done

The 'LIST' variable uses a little awk and grep to pull out just the database names from each running instance.  To restore any of the dumps, you can do:

createdb foo; pg_restore foo.dmp | psql foo

Booleans between Python and JavaScript

Just a quick note on something I noticed earlier this week. Since we've been using a combination of Django and JavaScript for our websites, we're passing a lot of values around between the two, including booleans. Unexpectedly, something stopped working as soon as I started sending Python booleans to a Django template. The template was [...]

Booleans between Python and JavaScript

Just a quick note on something I noticed earlier this week. Since we've been using a combination of Django and JavaScript for our websites, we're passing a lot of values around between the two, including booleans. Unexpectedly, something stopped working as soon as I started sending Python booleans to a Django template. The template was supposed to create valid JSON, but the JavaScript on the other end didn't seem to know whether the original (Python) boolean was true or false.

The answer turned out to be quite simple: whereas Python uses an initial upper-case letter for its booleans, JavaScript does not. So don't just pass Python booleans on to a Django template if JavaScript is getting that value next. Instead, evaluate the boolean variable beforehand and pass the strings "true"/"false" on to your template accordingly.

Back to Top

Sustaining Members