Related Plugins and Tags

QGIS Planet

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

Alt Text

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.

Alt Text

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.

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.

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.

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'

  • qgis tags:
  • qgis
  • sql

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.

'Quick Tip: Using coalesce to check for NULL or zero'

  • qgis tags:
  • qgis
  • sql

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!

  • Open Source
  • qgis tags:
  • FOSSGIS
  • gis
  • Open Source
  • oracle
  • osgeo
  • qgis
  • qgis-editing
  • Quantum GIS

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 :)

QGIS gets Oracle support!

  • Open Source
  • qgis tags:
  • FOSSGIS
  • gis
  • Open Source
  • oracle
  • osgeo
  • qgis
  • qgis-editing
  • Quantum GIS

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 :)

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.

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.


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

Back to Top

Sustaining Members