top logo
 

Last update:
Sat May 25 03:55:16 2013

A Django site.

Alpha in QGIS colour ramps. Oh yeah!

Here is a preview of a new cool feature coming in QGIS 2.0. Alpha channel in colour ramps.

ramp.png

Fancy!

The best part is it even works on raster layers.

ramp2.png

How bloody awesome is that!

Mathieu Pellerin made a cool made showing of this new feature on our flickr map group


On being an open source contributor

Joining an open source project has been one of the best things I did for my career. To better myself in the process of improving QGIS. To grow as a GIS professional. To learn to be part of team and respect each others ideas even if don't agree. To be open to ideas that others have spent a lot of time on. To not just be single tool pusher and learn a wider range of toolkits. To work with people who you have never seen in person, or even talked to.

How did it feel to join an open source project? Scary but awesome I would say. Scary in that that everyone would read my code - my very amateur code. Scary in that I had never really joined an open source project before and wasn't sure what everyone would think of my work, or my ideas.
Scary because there are so many people better at this than me and they might think I'm crap.

However all of this fear is outweighed by the awesome feeling of knowing that people benefit from the work you, and the rest of the team, put in. Sometimes even the small things can make a huge difference to what people can do with your software - and yes I did use "your software" on purpose. Contributing to open source means you, personally, are part of the software. Being a contributor, for me at least, gives you a deeper relationship with the project. The kind of relationship that sees you staying up at night when the rest of the family is in bed trying out a new idea, fixing some annoying bug, or writing a blog post about being an open source contributor. All for free! - well mostly. Some call it obsession I prefer passion.

It's not pretty roses all the time. Passion can lead to burnout. Trying to be involved in most of the major parts of the project can result in stretching yourself thin. A project that never sleeps makes this even harder. The wave of ideas can sometimes be a distraction from just getting stuff done. Rejection of your work can be hard to handle the first time, you just have to remember it's never personal. Most of these are just personal demons that need to be managed but they do sneak up if you enjoy what you do. Having a family - and an xbox - helps to ground you and make sure you don't spend all your free time on the computer hacking away.

Like I said, and despite personal demons, joining an open source project has been one of the best things I did. There is an emotional kick working on something and seeing it used by other people. I didn't expect my expression based labeling addition would get such good remarks but it did and that helped push me further into becoming a QGIS contributor.


QGIS Map Flickr group

Want to show of some the cool maps you have made using QGIS 1.9/2.0?

Mathieu has now setup a new Flickr group to collect and show of cool maps that have been made using the new features in the upcoming QGIS 2.0.

The group can be found at http://www.flickr.com/groups/qgis/pool

Here is one I uploaded a few days ago

http://farm8.staticflickr.com/7350/8715654343_71f64d4d75_b.jpg

and a cool one from Anita

http://farm8.staticflickr.com/7370/8720379249_fdf4625967_b.jpg

Anyone can join and submit to the group.

There are just a few rules:

  • No Screen shots of the application
  • Only output from the composer or Save Image As..
  • List data sources used
  • List any new QGIS features used e.g blending, label buffers, etc
  • Only post maps you are proud of or you would show your mother

A QGIS Map Book might be on the cards in the future so keep that in mind when uploading a map to the group.

Now go forth and make awesome maps!


Installing QGIS using apt on windows (OSGeo4W)

Here is a handy tip to be able to install and update OSGeo4W packages, things like QGIS, GRASS, etc, using the apt utility from OSGeo4W. apt is a command line utility that you can install using OSGeo4W and then run using the OSGeo4W Shell.

First install apt via OSGeo4W

osgeo.png

Now open the OSGeo4W Shell

shell.png

from here you can run the apt utility.

The basic commands are apt update, apt install {package}, apt upgrade

Installing nightly QGIS

For a quick example we will install qgis-dev.

From the shell we can just run:

apt setup
apt update
apt install qgis-dev

qgis-dev-install.png

apt will install all the needed dependencies

Done!

Script for updating nightly QGIS

So the good thing about using apt is if you wanted to make a quick batch file that you can run to update to the nightly build it's as simple as

@echo off
set OSGEO4W_ROOT=C:\OSGeo4W
set PATH=%OSGEO4W_ROOT%\bin;%PATH%

apt update
apt install qgis-dev
pause

Now you can just run the batch file to update your QGIS to the nightly build.

Extra tip

If you just want to upgrade all the packages you have installed you can do:

apt setup
apt upgrade

Simple


SVG textures + blend modes = Cool QGIS Maps

Did you know you can use textures to fill a polyon in QGIS? No? Well you do now!

The cool thing is you can get results like this with a simple SVG and a texture.

texture.png

So how do you do it? Lets give it a go.

First grab a texture you want from http://texturelib.com/

Install Inkscape, or any other tool that can create svgs with textures.

Drag and drop your texture into Inkscape and embed the texture into the SVG:

textureembed.png

Twaek any settings you need in Inkscape and save it somewhere QGIS can find.

Tip: You can configure extra search paths for svg in Options -> System -> SVG Paths

inkscape.png

Open QGIS and load a polygon layer

Change the symbol type for the style to SVG fill and selet your SVG

texturepicker.png

Hit apply.

Opps that's not right

textureresult1.png

Enter the handy blend modes added by Nyall.

Change the blend mode to Soft Light and move the layer to the top of the drawing list

textureresult2.png

SWEEEET!!!!

Now go and make some pirate maps.


Australian QGIS User Forums - Wrap up

I had a feeling this year was going to be a good one for QGIS. The recent success of the first Australian QGIS User Group in Perth, and the most recent one in Melbourne can only reinforce this. Both events had a great turn out of around fifty people.

The Perth event was run as three presentations followed by a discussion session.

  • Mapping Projects with QGIS (Jeremy Taylor - City of Belmont)

  • Custom Plugin Development (Shane French - Department of Environment and Conservation)

  • All the New Cool Stuff in QGIS 2.0 (Nathan Woodrow - Digital Mapping Solutions)

With a bit more time to prepare we added a workshop session to the Melbourne event:

Workshops

  • Styling and managing style libraries (Chris Scott - Digital Mapping Solutions)

  • Working with the composer (Nathan Woodrow - Digital Mapping Solutions)

  • Custom QGIS forms and Python (Nathan Woodrow - Digital Mapping Solutions)

  • General Q&A

Presentations

  • A GIS officers journey into the light (Barrett Higman - Alpine Shire Council)

  • QGIS in Victoria Police (Nyall Dawson - Victoria Police)

  • All the New Cool Stuff in QGIS 2.0 (Nathan Woodrow - Digital Mapping Solutions)

There was a great mix of users, even a few non users keen to check QGIS out for the first time. I was extremely happy with how both days turned out and the feedback so far has been fantastic. A massive thanks must go to DMS who sponsored both events.

users.jpg

I also thought I might give filming and screen recording my workshop a go. Seemed to turn out alright, for a first attempt anyway. A few mistakes here and there but live things never go 100% :)

On a side note it was also a pleasure to be able to talk about my adventures with QGIS at the Melbourne Open GIS meetup. Big thanks to Simon for asking me to talk.


My toolset

I am a big fan Scott Hanselman and this post was inspired by his 2011 Ultimate Developer and Power Users Tool List for Windows with some extra stuff thrown in. I have nowhere close to the amount of tools that Scott does but I thought it would be cool to share my setup anyway.

Editors\IDEs

  • Sublime Text 2\Notepad++ : These two text editors are the best of the bunch. Sublime Text 2 has a nice simple interface, good text editing features, and simple to configure. Sublime doesn't fill every need so Notepad++ fills any gaps.

  • Visual Studio 2010 : I'm mostly a C++ and Python guy now due to QGIS but every now and then I need to do some C#.

  • Qt Creator : If you are working with Qt and C++ this is the IDE for it. Built in Qt help files, form designer, good editor (good for someone who can't use vim). Qt Creator is like Visual Studio for Qt C++ but less...bloated.

  • Aptanta Studio 3 : Since starting Python I have tried a bunch of editors and have settled on Aptanta Studio 3 for now. I find it works constantly, has some nice IDE features, built in unit test runners, and is FREE. If I'm working on a single Python file I will normally use Sublime Text 2 but anything project based like QMap or a QGIS plugin will be done in here.

Dev Tools

  • git : Everyone uses git and if you don't you should.

  • svn : -_- Ok it was good at the time, but see above.

  • ConEmu : I bloody love this program. If you are still using cmd.exe to do anything just stop now! Go and download this. Tabs, better copy and paste, resize-able window, predefined tasks, and heaps more. Trust me you will be more productive. I found it though one of Scott's posts and haven't stopped using it since.

GIS

  • QGIS : Obviously

  • MapServer : The company I now work for uses MapServer as the base for their product, although that isn't the only reason that I like it of course.

  • GRASS\SAGA GIS : Great powerful tools for vector and raster progressing.

  • ILWIS : I first used this when I did a bushfire project ( the second round was done in QGIS ) however while I don't use it much anymore it still has some cool ideas.

  • PostGIS : Great relational spatial database

  • SQL Server 2008\2012 Express : It's not that bad. 2012 has better spatial support. QGIS supports 2008/2012.

Handy tools

  • Bins : This is a nifty little tool that I found tonight. Lets you group icons into "Bins" in the Windows taskbar so you don't end up with mess of icons. Handy! Not free but only $5

  • Fences : Another one from Scott's blog. Handy for sorting out your mess of a desktop.

  • Greenshot : Great for taking screens shots. Export to Paint, Dropbox, Imgur, file, clipboard, printer. Built-in image editor for annotations. And it's free.

  • Dropbox : It always pains me to hear people say "oh my computer crashed and I lost all my documents", and if it's your sister in law two days before an assignment is due then it's even worse. Use Dropbox, or SkyDrive, or something but keep more then one copy of important stuff.

  • Paint.NET\GIMP : Even as a developer one needs an editing program. These are the two best free ones you can get.

  • Expression Encoder 4 : I have plans to do some screencasting in the future so I am giving this a run to see how things work out. This has a ten minute limit on the free version, but you don't really want to hear me talking for more then ten minutes anyway.

  • Total Commander : This is one of the best tools you can get for working with your file system. No drag and drop here. Full keyboard control and speed. Can take a bit to getting used to however it will increase your productivity.

  • UtlraMon : I can't even work with one screen anymore and this tool helps you get the most out of your monitors. Multi screen taskbar, shortcuts for predefined window locations and more.

Chat

  • Skype : I don't really use Skype a lot but when I have it always works well. Anytime I have to be away from the family in the future I plan on calling using Skype.

  • Irssi : Good ol' IRC. I have played around with a whole bunch of IRC clients on Windows and Linux but never found one that I liked apart from Irssi. Sure it runs in a console window but IRC is just text anyway so who cares. I like to tweak things so Irssi scratches that itch for me. NathanW on #qgis.

Online

  • Trello : Another one in the bloody love list. A simple to use but powerful, well I don't really know how to describe it so you can just check it out. I use it for personal task management, work projects, software projects, event planning.

  • GitHub : I really like GitHub it really does add a nice social experience to development that most sites fail on.

  • gis.stackexchange.com : Personally I really think they hit the nail on the head when building this Q&A site. I try to spend as much time as I can on here answering QGIS questions.

If anyone has anything extra they can recommend feel free to leave a comment.


Leaving! Getting a New QGIS Job!

This week is my last week at Southern Downs Regional Council. On Monday I'm starting a new job. A QGIS related job. WIN!

I have worked at Southern Downs Regional Council for the last seven years and have been grateful for every year. The people, the work, the experience, has all be excellent. It has been a great seven years and I never imagined that I would be leaving, maybe at the ten year mark, but here it is. Starting at SDRC right out of high school without any skills or knowledge of what GIS is or was I grew to love it very quick. Learning GIS, evidently, lead me to programming. Nothing to crazy at first, some VBA here, some MAPBASIC there, MapInfo added the ability to call .NET dlls so I got into VB.NET, which lead me to C#, QGIS entered about three years ago which started me down the road of C++ and Python. Throw in some GPS surveying, data collection, database stuff, bushfire mapping, planning scheme mapping, floods, and you have yourself a nice skill set that you never expected to learn - hell some early school teacher even told my parents I would never do anything useful because "I only did computers".

So enough with the rambling personal history lesson and more about the new stuff. My new job is a Technical Consultant/QGIS Specialist with Digital Mapping Solutions(DMS), a great - of course they are great why else would I work for them - Australian GIS company. DMS were/are the sponsors of the QGIS MS SQL provider and run QGIS training courses around Australia. My new role will be focused around QGIS and QGIS clients in Australia, although it's not limited to that. I'm really looking forward to promoting, using, and helping other people use QGIS in Australia. I really do think there is a good market for it here, and if the growing interest over the last year is anything to go by I feel it is going to be a really interesting year. Working from home, meeting new people, learning awesome skills, pimping QGIS, what's not to love!

My blog will continue as normal, if not more. Expect to see more QGIS in Australia, hopefully we can get some regular meetups happening.

I do have to give credit to the QGIS team and community. Without the great team and community around QGIS I very much doubt any of this would have happened


Perth QGIS User Forum/Group

I have a feeling this year is going to be a interesting one for QGIS in Australia. What's a better way then to start the year of with two great events on the same day in Perth, Australia. A QGIS User Forum/Group, and the regular Perth GeoRabble

Here is the official invitation to the upcoming QGIS User Group/Forum in Perth, Australia.

Inaugural Australian QGIS Forum

Digital Mapping Solutions is pleased to support, what will hopefully be, the first of many inspiring QGIS user forums. The goal for this event is to provide a casual environment where people can see QGIS in action as well as discuss and share their QGIS experiences and thoughts. The event will feature a variety of real-world demonstrations by QGIS users from a cross-section of industries.  There will also be a presentation by Nathan Woodrow, an active member of the open source GIS community, developer on the QGIS project and an OSGeo advocate.  Finally, there will be plenty of time for discussion during the presentations and networking over lunch. Whether you are already a QGIS user who is looking for an opportunity to share your experiences with others or if you are a potential user who is curious as to how QGIS can enhance your GIS toolkit, this is the event for you.

Event Details
Date and Times
Thursday  March 14th 2013

10.00am - Registration
10.20am - Welcome and  introduction
10.30am - Presentations commence
12.00pm - Open discussion
12.30pm - Lunch
1.30pm - Finish
Location
Kailis Bros Fish Market & Cafe
Function Room
101 Oxford Street 
LEEDERVILLE WA  6007
RSVP
To register please email joanne.smith@mapsolutions.com.au
on or before Friday March 8th 2013

Please let us know if you have any access issues or specific dietary requirements when you register.
Places are limited so please register your interest today.

and the invitation to the GeoRabble event:

Announcing GeoRabble Perth #5  - Return to Yesteryear -
Thursday, March 14, 2013
Venue: Upstairs at the Leederville Hotel
Time: Door @ 5:30pm for a 6:00pm start of presentations
Speakers:
Mike Bradford
Tom Gardner
More Speakers and the event sponsor to be announced very soon

As you can see from the QGIS Perth User Group invitation I will be attending and presenting - practice makes prefect - so I'm really looking forward to the event. Still not sure what I'm going to cover yet though.


My QGIS git workflow

I thought it might be handy to post the git workflow that I use when working on QGIS, or any project for that matter.

In the following examples upstream = https://github.com/qgis/Quantum-GIS.git. If you have cloned from your github fork of QGIS you can add upstream using:

$ git remote add upstream https://github.com/qgis/Quantum-GIS.git

The first thing we need to do is pull down the latest changes from the main QGIS repo aka upstream

$ git fetch upstream
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (1/1), done.
remote: Total 7 (delta 6), reused 7 (delta 6)
Unpacking objects: 100% (7/7), done.
From github.com:qgis/Quantum-GIS
   18cd145..89bdb10  master     -> upstream/master

Now that we have the changes in our local repo we need to bring our master branch up to date with the latest changes from upstream. I use rebase here because I don't want to see merge master into master etc etc each time I want to bring my master branch up to date. In the end I want my local master branch to reflect upstream/master exactly

$ git rebase upstream/master
First, rewinding head to replay your work on top of it...
Fast-forwarded master to upstream/master.

Note: You can combine the two into one call using: git pull upstream master --rebase

In order to do any work in git you should really be using branches. We can check a new one out using:

$ git checkout -b working
Switched to a new branch 'working'

This will checkout a new working branch off my local master branch and switch to it.

Lets do some work.

$ git commit -a -m "Add some feature"
[working 8cd2f4b] Add some feature

$ git commit -a -m "More feature stuff"
[working 72d30ad] More feature stuff

$ git commit -a -m "bug fix"
[working 25b10e5] bug fix

$ git commit -a -m "bug fix"
[working 211e387] bug fix

Note: The -a means add any changed files to the commit. You can also use git add. I'm trusting you already understand how to add files to a commit.

Now at this point I could merge my changes into the master branch and push it up, or if you don't have commit rights you can issue a pull request. However having heaps of "fix this", "fix that" commits is pretty ugly. This is where git rebase can come in handy.

We can check which commits we have added that are not in master by doing:

$ git log --oneline master..
211e387 bug fix
25b10e5 bug fix
72d30ad More feature stuff
8cd2f4b Add some feature

git2.png

There we can see we have four commits that differ and that 8cd2f4b is the first commit we made. I really want to merge all the commits into one to make this a little cleaner.

$ git rebase -i 8cd2f4b^

Note: ^ means go back one commit from the one listed. git rebase doesn't include the commit that you list so you have to go back one before it.

pick 8cd2f4b Add some feature
f 72d30ad More feature stuff
f 25b10e5 bug fix
f 211e387 bug fix

# Rebase 89bdb10..7d02daf onto 89bdb10
#
# Commands:
#  p, pick = use commit
#  r, reword = use commit, but edit the commit message
#  e, edit = use commit, but stop for amending
#  s, squash = use commit, but meld into previous commit
#  f, fixup = like "squash", but discard this commit's log message
#  x, exec = run command (the rest of the line) using shell
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.

I have changed all but the first commit to f this will merge all the commits into the first one. The latest commit is at the bottom so you should read the rebase screen from bottom up.

[detached HEAD d5620a5] Add some feature
 1 file changed, 3 insertions(+)
 create mode 100644 test.txt
Successfully rebased and updated refs/heads/working.

git1.png

At this point I normally merge it into master and push it upstream, but if you don't have commit rights then you can push it up to your github repo and open a pull request.

# Push them up for review
$ git push myrepo working

Important Note:

git rebase -i will change the commit hash for anything that is included in the range of commits. Make sure you only rebase commits that are not public yet. Only rebase commits that in your local repo.


QGIS plugin InaSAFE wins Open Source award

How cool is this! The InaSAFE project, a QGIS plugin, has just won a Open Source Rookie Of the Year award. The award is given by Black Duck who make products such as ohloh.net.

The award also got mentioned in Wired.

Talk about some awesome publicity of QGIS and how it can be used for serious tasks.


New Site! WordPress to Jekyll and Amazon S3

Like a lot of other people I have decided to move my blog off WordPress and onto a static page based system, mainly Jekyll. I'm not going to go over all the reasons in detail, you can always Google It as I'm swapping for most of the same reasons that everyone else is.

In case you don't like Google, or want my spin, this is a summary of the reasons that made me switch:

  • Static site - Blogs are static content. I don't need any fancy PHP to generate dynamic content on the fly.

  • Google Analytics - I'm a sucker for stats. WordPress had them but I want more.

  • GitHub - It's just text after all. I can keep my site on GitHub and version it.

  • I really hate the WordPress blog post editor - You can't tell me that you like it. Now I just write in my posts in Vim, Sublime Text 2, or whatever, and run Jekyll-S3 to push it up. Done.

  • Theme - I have always switched around my theme on WordPress because I was never really happy. Now I can just control it how I like. (I wasn't go to pay WordPress for the ability to tweak the stylesheets) - However because I am not really good with design I'm going for a simple look. More content less flair.

  • Amazon S3 - Free Hosting! Win! (Well free for a bit then cheap as hell after that)

So that's pretty much it. Was it worth it? I guess only time will tell. Now just to get my search ranking back up.

P.S As I have said I'm not great at design so if you have any feedback let me know.

New Site! WordPress to Jekyll and Amazon S3

Like a lot of other people I have decided to move my blog off WordPress and onto a static page based system, mainly Jekyll. I'm not going to go over all the reasons in detail, you can always Google It as I'm swapping for most of the same reasons that everyone else is.

In case you don't like Google, or want my spin, this is a summary of the reasons that made me switch:

  • Static site - Blogs are static content. I don't need any fancy PHP to generate dynamic content on the fly.

  • Google Analytics - I'm a sucker for stats. WordPress had them but I want more.

  • GitHub - It's just text after all. I can keep my site on GitHub and version it.

  • I really hate the WordPress blog post editor - You can't tell me that you like it. Now I just write in my posts in Vim, Sublime Text 2, or whatever, and run Jekyll-S3 to push it up. Done.

  • Theme - I have always switched around my theme on WordPress because I was never really happy. Now I can just control it how I like. (I wasn't go to pay WordPress for the ability to tweak the stylesheets) - However because I am not really good with design I'm going for a simple look. More content less flair.

  • Amazon S3 - Free Hosting! Win! (Well free for a bit then cheap as hell after that)

So that's pretty much it. Was it worth it? I guess only time will tell. Now just to get my search ranking back up.

P.S As I have said I'm not great at design so if you have any feedback let me know.


New Site! WordPress to Jekyll and Amazon S3

Like a lot of other people I have decided to move my blog off WordPress and onto a static page based system, mainly Jekyll. I'm not going to go over all the reasons in detail, you can always Google It as I'm swapping for most of the same reasons that everyone else is.

In case you don't like Google, or want my spin, this is a summary of the reasons that made me switch:

  • Static site - Blogs are static content. I don't need any fancy PHP to generate dynamic content on the fly.

  • Google Analytics - I'm a sucker for stats. WordPress had them but I want more.

  • GitHub - It's just text after all. I can keep my site on GitHub and version it.

  • I really hate the WordPress blog post editor - You can't tell me that you like it. Now I just write in my posts in Vim, Sublime Text 2, or whatever, and run Jekyll-S3 to push it up. Done.

  • Theme - I have always switched around my theme on WordPress because I was never really happy. Now I can just control it how I like. (I wasn't go to pay WordPress for the ability to tweak the stylesheets) - However because I am not really good with design I'm going for a simple look. More content less flair.

  • Amazon S3 - Free Hosting! Win! (Well free for a bit then cheap as hell after that)

So that's pretty much it. Was it worth it? I guess only time will tell. Now just to get my search ranking back up.

P.S As I have said I'm not great at design so if you have any feedback let me know.


Quick Tip: Using coalesce to check for NULL or zero

Here is a quick tip that you can use in QGIS expressions, T-SQL, or even PostgresSQL.

Normally if you have a column that you need query on to find all the NULL or zeros you have to do something like this:

COLA IS NULL OR COLA = 0

Well that isn't too bad. Sure yeah it's fine for one column but what if you have three and you need to check them all together

(COLA IS NULL OR COLA = 0) AND (COLB IS NULL OR COLB = 0) AND (COLC IS NULL OR COLC = 0)

That is pretty long and gets hard to read pretty quick.

To cut this down we can use the coalesce function - T-SQL, PostgresSQL, QGIS Expression. The coalesce function returns the first non-NULL value out of an expression, or list of values. So if you do something like this:

coalesce(NULL, "A", 0)

You will get "A" because the first value is NULL. The function will just evaluate each value/expression until something turns up that isn't NULL.

Using that logic we can replace the above function with the following:

coalesce(COLA, 0) = 0 AND coalesce(COLB, 0) = 0 AND coalesce(COLC, 0) = 0

To me that is a lot clearer and readable.

Quick Tip: Using coalesce to check for NULL or zero

Here is a quick tip that you can use in QGIS expressions, T-SQL, or even PostgresSQL.

Normally if you have a column that you need query on to find all the NULL or zeros you have to do something like this:

COLA IS NULL OR COLA = 0

Well that isn’t too bad. Sure yeah it’s fine for one column but what if you have three and you need to check them all together

(COLA IS NULL OR COLA = 0) AND (COLB IS NULL OR COLB = 0) AND (COLC IS NULL OR COLC = 0)

That is pretty long and gets hard to read pretty quick.

To cut this down we can use the coalesce function – T-SQL, PostgresSQL, QGIS Expression. The coalesce function returns the first non-NULL value out of an expression, or list of values. So if you do something like this:

coalesce(NULL, "A", 0)

You will get “A” because the first value is NULL. The function will just evaluate each value/expression until something turns up that isn’t NULL.

Using that logic we can replace the above function with the following:

coalesce(COLA, 0) = 0 AND coalesce(COLB, 0) = 0 AND coalesce(COLC, 0) = 0

To me that is a lot clearer and readable.


Filed under: qgis Tagged: qgis, sql


Quick Tip: Using coalesce to check for NULL or zero

Here is a quick tip that you can use in QGIS expressions, T-SQL, or even PostgresSQL.

Normally if you have a column that you need query on to find all the NULL or zeros you have to do something like this:

COLA IS NULL OR COLA = 0

Well that isn't too bad. Sure yeah it's fine for one column but what if you have three and you need to check them all together

(COLA IS NULL OR COLA = 0) AND (COLB IS NULL OR COLB = 0) AND (COLC IS NULL OR COLC = 0)

That is pretty long and gets hard to read pretty quick.

To cut this down we can use the coalesce function - T-SQL, PostgresSQL, QGIS Expression. The coalesce function returns the first non-NULL value out of an expression, or list of values. So if you do something like this:

coalesce(NULL, "A", 0)

You will get "A" because the first value is NULL. The function will just evaluate each value/expression until something turns up that isn't NULL.

Using that logic we can replace the above function with the following:

coalesce(COLA, 0) = 0 AND coalesce(COLB, 0) = 0 AND coalesce(COLC, 0) = 0

To me that is a lot clearer and readable.


QGIS gets Oracle support!

Seems this is a good day for QGIS Oracle users. According this commit made by Jürgen QGIS now has built-in Oracle support. Win!

Native Oracle support can now see QGIS being opened up to a wider user base yet again. A large user base normally means more people willing to sponsor awesome new features and bug fixes. Having seen the growth in the user base from having native MS SQL Server 2008+ support I can imagine what it will be like with Oracle.

The list of formats QGIS can open and edit is getting larger and larger with each release. Is there a future for vendor lock in? I can’t see it.

Standard disclaimer about latest dev build and new features :)


Filed under: Open Source, qgis Tagged: FOSSGIS, gis, Open Source, oracle, osgeo, qgis, qgis-editing, Quantum GIS

QGIS gets Oracle support!

Seems this is a good day for QGIS Oracle users. According this commit made by Jürgen QGIS now has built-in Oracle support. Win!

Native Oracle support can now see QGIS being opened up to a wider user base yet again. A large user base normally means more people willing to sponsor awesome new features and bug fixes. Having seen the growth in the user base from having native MS SQL Server 2008+ support I can imagine what it will be like with Oracle.

The list of formats QGIS can open and edit is getting larger and larger with each release. Is there a future for vendor lock in? I can't see it.

Standard disclaimer about latest dev build and new features :)


New QGIS PDF and HTML manuals

A quick update from the QGIS documentation team today on the mailing list. The QGIS 1.8 manual is now available in HTML and PDF form.

HTML manual can be found at: http://docs.qgis.org/html/en/docs/user_manual/index.html

PDF manual at: http://docs.qgis.org/pdf/QGIS-1.8-UserGuide-en.pdf

This has been part of an ongoing effort from the documentation team since before the 1.8 release to bring our all our documentation into reStructedText rather then LaTeX. Moving to reStructedText allows quicker updates and a larger range of final output formats.

I would like to thank everyone who has been involved in this process as I know what a grueling process updating documentation can be.

Community notice

Just remember you don't have to be a programmer to contribute to an open source project. If you think you could contribute to the updating of the QGIS documentation please contact the team on the mailing list.


bottom

Powered by Django!