So some good news for QGIS users who also need/want to use MapInfo. QGIS via GDAL 2.0 can support MapInfo TAB file editing. In all older versions of GDAL there was only support for read and/or write but not both.
MapInfo TAB editing has been supported in GDAL 2 but up until this point QGIS has only be built against GDAL 1.xx. GDAL 2.x is now the default GDAL release in OSGeo4w.
From Jurgen:
2.0.2 is now the default GDAL in OSGeo4W and the nightlies (qgis-ltr-dev,
qgis-rel-dev and qgis-dev) already picked it up.
With the next release the regular packages (2.14 and 2.8) will also be updated
to use it
Even if you don’t want to make the switch to full QGIS you can now use both bits of software and edit in both.
QGIS will still only support a single geometry type per layer so if you open a mixed tab file you will get the geometry type selector. You can load the layer 3 times if you need the 3 different geometry types.
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:)
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.
The easiest way install Python libraries is to use easy_install and pip. easy_install and pip are package managers for Python. From the easy_install page:
Easy Install is a python module (easy_install) bundled with setuptools that lets you automatically download, build, install, and manage Python packages.
pip is a tool for installing and managing Python packages, such as those found in the Python Package Index. It’s a replacement for easy_install.
To get easy_install you need to install Python setuptools and you are good to go. Sounds easy! However the setuptools installer assumes that you have the normal standalone Python installed which writes it’s install location to the registry, and when you run the installer it will say that it can’t find Python on the system. What the!?
If you have installed QGIS, or any other tool from the OSGeo4W install, you will see that OSGeo4W bundles its own version of Python in: C:\OSGeo4W\apps\python27. This is the Python that is used when calling python in the OSGeo4W shell. It seems someone on the OSGeo wiki has made a bootstrapped installer for setuptools that will install setuptools and easy_install into the C:\OSGeo4W\apps\python27 folder for you.
Most of the time any Python packages that are needed by your OSGeo4W tools are bundled in the installer and can be downloaded using the OSGeo4W installer, however there have been cases when I wanted to install a non OSGeo4W package into my setup by using easy_install or pip. Like bottle and flask in the example above.
As QGIS is such a fast moving project I have decided to make this a regular blog post in order to highlight some new features added to QGIS. If you haven’t already, don’t forget to check out round one.
Remember that some of these features may still only be new which might change between now and the next official released version. With that out of the way lets get listing.
Atlas integration
If you are a regular user of QGIS Python plugins, and who isn’t, then you would have used the awesome Atlas plugin developed by Vincent Picavet. This great tool can be used to generate mapbooks, or an atlas as some people like to say, using a coverage layer and a print composer. What makes this even more awesome is that it is now built into the print composer.
The builtin atlas function also gives you the ability to use an expression to do runtime text replacement, including access to all the fields on the coverage layer. The coverage layer doesn’t even have to be a region layer, it can be a simple point layer, or even a line layer. You can see the result of me running the atlas generation from the above example here
Big thanks to Oslandia for integrating this great feature, and the companies sponsoring the work.
New Python console
This new addition comes from the great work that Salvatore Larosa has been doing to add a better Python console to QGIS.
The new Python console includes attribute auto complete, syntax highlighting, better copy and paste, uploading to codepad, the ability to run code from a file, etc. You don’t realise how much difference there is until you go back to using the old one in version 1.8.
Tabbed and groups in builtin forms
One of the things I really loved about QGIS, coming from MapInfo, was the builtin forms. Just having the ability to enter data using controls like combo boxes, calendar widgets, etc makes you one step closer to having better data. This feature is the exact reason I setup a 67 year old for kerb data collection.
As good as they are the builtin forms have an issue of ending up with as a big scrolling list with lots of fields; also the lack of the ability to group or put fields on tabs in the UI meant you had to create a custom form. Well not any more.
There is now a combo box on the Fields tab that allows you to build a generated form but also add tabs and group boxes. You can even have the same field shown more then once on the form, handy for something like an ID field that you would like to show on each tab.
With this new ability the builtin forms can get me 95% of the way for data entry jobs, the other 5% I just make a custom form – but that is very rare.
Sextante
Sextante is a great and powerful analytical framework that has been added to the core of QGIS thanks to Victor Olaya. This is not a feature that I use a lot but this is only due to most of my work being in development and not analysis, however that doesn’t mean that it’s not a really cool feature.
One of the greatest things about the Sextante toolbox is that it allows you to integrate other great open source tools like GRASS, SAGA, R, OTB, etc, right into your QGIS workflow and view the results in the canvas. It even includes a modeller so that you can build a connected diagram of all the bits of your process, even if it crosses between programs.
For me what is even better is that you can use Sextante in your plugins or custom Python code. Sextante has a Python interface – well the whole thing is written in Python – that you can use to run a Sextante supported algorithm.
“(InaSAFE) is very beneficial for all of us. It’s a good example of our partnership.”
Dr Susilo Bambang Yudhoyono – President of Indonesia
Some of the improvements include:
A new loadFromTemplate method, in the API, that can do text replacement in the QGIS composer template.
Better support for EPSG:4326 scale bars
Multipage in one composer
Automatic overview frame in map frame
HTML frame
Zebra style grid frame border
More control of grid labels. Inside, outside, disabled
etc, etc
These are great additions to the QGIS composer and I have already used the overview frame feature along with the new atlas integration to make some quick nice looking map books. \
Last Thursday and Friday was our first local Australian FOSS4G event which was hosted at the CSRIO building in Brisbane. Very big thanks to CSRIO for hosting the event. The venue was setup perfectly for hosting an event like this, including dual projectors for presenting, video calls over to Perth, etc.
The first day was done using a un-conference style of event. This is the first time I’ve been to a un-conference and I liked the format a lot. Once everyone was there on the first morning we collected ideas from people and everyone voted on which ones they would like to see. After we had picked enough topics Shaun and I made a program for the day and we started.
The second day was a code sprint. I worked on converting a MapBasic scripts from one of the guys to QGIS, and Jody enlisted the others to help check the headers of the GeoServer project so that it can finally pass OSGeo incubation.
Overall I think it was a very successful event. I would like to make these a yearly event if we can, provided that we have people to talk, or projects to work on.
Another quick announcement for today. The local FOSS4G-AU chapter is holding un-conference and code sprint in Brisbane on the 15 and 16th of November 2012.
Ben Caradoc-Davies made the announcement on the mailing list the other day:
The Free and Open Source Software for Geospatial Australia (FOSS4G-AU)
2012 Unconference and Code Sprint will be held at CSIRO’s Queensland
Centre for Advanced Technologies (QCAT), Pullenvale QLD.
15 November: Unconference
16 November: Code Sprint
This is a participant-organised event: please add your unconference and code sprint topic suggestions to the wiki. Organisers are welcome; please speak up.
I’m very please to announce the Australian QGIS User Group. Chris Scott (DMS) and I created this group because the interest in QGIS here is growing fast and it would be nice to have a place where us Aussies can hang out and chat about QGIS stuff, discuss local issues, organize local events, put shrimps on the barbie.
My ultimate goal would be to turn this into a full user group much like the Swiss QGIS User Group but for now we will keep it light.
Everyone is free to view the content of the home page and the Google group, however you have to request to join the Google Group to post. This is only so that we can keep it local and not reduce the official QGIS mailing lists.
So in saying all that. If you live in Australia. Use QGIS, or are interested in QGIS. Feel free to join the group.
Something that I need to do now and then is generate points along a line at supplied distance. I had never really looked into doing it in QGIS until this question poped up on gis.stackexchange.com. This is a quick blog post because I thought it was a pretty handy little thing to do.
In the development version there is a new method on QgsGeometry called interpolate. This method takes a distance and returns a point along a line at that distance. Perfect! We can then just wrap this in a loop and generate a point increasing the distance as we move along
from qgis.core import (QgsFeature, QgsGeometry,
QgsVectorLayer, QgsMapLayerRegistry,
QgsField)
from PyQt4.QtCore import QVariant
from qgis.utils import iface
def createPointsAt(distance, geom):
length = geom.length()
currentdistance = distance
feats = []
while currentdistance < length:
# Get a point along the line at the current distance
point = geom.interpolate(currentdistance)
# Create a new QgsFeature and assign it the new geometry
fet = QgsFeature()
fet.setAttributeMap( { 0 : currentdistance } )
fet.setGeometry(point)
feats.append(fet)
# Increase the distance
currentdistance = currentdistance + distance
return feats
def pointsAlongLine(distance):
# Create a new memory layer and add a distance attribute
vl = QgsVectorLayer("Point", "distance nodes", "memory")
pr = vl.dataProvider()
pr.addAttributes( [ QgsField("distance", QVariant.Int) ] )
layer = iface.mapCanvas().currentLayer()
# Loop though all the selected features
for feature in layer.selectedFeatures():
geom = feature.geometry()
features = createPointsAt(distance, geom)
pr.addFeatures(features)
vl.updateExtents()
QgsMapLayerRegistry.instance().addMapLayer(vl)
The above code might look a bit scary at first if you have never done any Python/pyqgis but hopefully the comments will ease the pain a little. The main bit is the createPointsAt function.
Cool! If we want to use this we can just stick it in a file in the .qgis/python folder (lets call it pointtools.py) and then run import pointtools in the python console.
So lets have a go. First select some objects then run the following in the Python Console
import pointtools
pointtools.pointsAlongLine(40)
That will generate a point every 40 meters along then selected lines
To generate nodes along different lines, select the new features, then call pointtools.pointsAlongLine(40) in the Python console.
Simple as that!
(Who knows, someone (maybe me) might even add this as a core object function in QGIS in the future)