Profile Tool is a plugin for QGIS which makes it possible to generate (elevation) profiles for line features. The plugin is available through the default QGIS plugin repository. While testing the plugin, I found some aspects of using the tool might require additional instructions.
After installing and enabling the plugin, you will find the “Terrain profile” button in the plugin toolbar:
The basic use case is as follows:
- Load the elevation raster and select this raster layer in the layer list.
- Press the “Terrain profile” button. This opens the plugin panel which consists of a graph area on the left and a raster layer list on the right. The raster layer you had selected will be added to the raster layer list.
- If you have “Selection: Temporary polyline” enabled, you can now draw a line in the map area. Double-click left to end drawing the line. (If you are paying close attention, you might have noticed the instructions in the status bar.)
- After you have finished drawing the line, the graph area will update and display the profile.
If you want to add another raster layer to the plugin, you need to first select the raster layer in the QGIS layer list and then press the “Add Layer” button in the Profile Tool panel.
To generate the profile for an existing line feature, you need to change the selection mode from “Temporary polyline” to “Selected polyline”. Then you need to select the vector layer which contains the line feature you want to use in the QGIS layer list. Finally, you can click on the line feature in the map area to select it. (Note that this selection is independent of any selections you might have going on using the default QGIS feature selection tools.)
If you change from the Profile Tool to any other tool such as “Pan Map” or “Identify”, you have to click the “Terrain profile” button again to re-enable drawing/selection a line for the Profile Tool.
Due to a bug, it is currently not possible to export the profile graph. An alternative is to open the “Table” tab of the Profile Tool panel which provides access to the profile data and copy the data into your preferred graphing application such as Calc or Excel.
If you want to see the Profile Tool in action, I recommend watching the introduction video by Lene Fischer (University of Copenhagen).
Group Stats is a plugin for QGIS which makes it easy to calculate statistics for feature groups in a vector layer. Note that the plugin is still marked “experimental” so you have to allow experimental plugins in order to install it. I tried this plugin for the first time today and decided to write this post because it didn’t seem immediately obvious how to use it.
The plugin button is added to the vector toolbar and of course you can access it via vector menu.
The example I want to show is: How to calculate the total area of each Corine Land Cover (CLC) class per state.
After adding state information to the CLC datasets by intersecting CLC and state geometries from Natural Earth we can get started with Group Stats.
The big area on the left will display the results. The input fields are on the right. The general idea is to drag and drop fields and/or functions into the “columns”, “rows” and “values” sections. (Double-clicking field names does not do anything.) To remove fields again, you have to drop them back into the field list.
To calculate the total area of of each Corine Land Cover (CLC) class per state, I chose land cover classes as columns, state names as rows and sum of areas as values:
It’s also possible to add multiple functions in the columns/rows input sections to calculate different statistics at once:
Group Stats can be used in many cases that otherwise require a Spreadsheet software. The results can be exported to CSV easily. Usability could certainly be improved by allowing common interactions such as removing fields by pressing the delete key or adding fields by double-clicking.
Gistutor.com features a nice tutorial covering raster-based terrain analysis techniques with QGIS and “Raster based terrain analysis” plugin.
Topics covered include: slope analysis, aspect analysis, ruggedness index analysis, total curvature analysis, and shaded relief.
Kudos to Mapperz on gis.stackexchange.com for the pointer.
QGIS wiki now has it’s own section listing QGIS video tutorials.
If you know of any tutorials not listed yet, leave a comment and I’ll add them.
Together with the newly started “How to I do that in QGIS” tutorial collection, this will hopefully become the number one reference for both new users doing their first GIS-related work and advanced uses interested in the latest QGIS features.
The OSGeo Education and Curriculum Project provides a knowledge base for everyone interested in working with geoscience in general and open source GIS specifically. Everybody is invited to contribute and upload/link their educational material to the database for the benefit of the community.
The database already contains a number of QGIS related materials, e.g. “GIS Basics with Quantum GIS” by Micha Silver.
SpatiaLite doesn’t need to be installed , just get SpatiaLite and unpack it in – for example –
~/apps (tested on Ubuntu 9.4):
~$ mkdir apps
~$ cd apps
~/apps$ wget http://www.gaia-gis.it/spatialite/spatialite-tools-linux-x86-2.3.1.tar.gz
~/apps$ tar xvfz spatialite-tools-linux-x86-2.3.1.tar.gz
Now you should be able to run it. Let’s create a test database:
~/apps$ cd ~/temp
~/temp$ ~/apps/spatialite-tools-linux-x86-2.3.1/bin/spatialite testdb.sqlite
Then we have to initialize the new database with some metadata. We need a script called init_spatialite-2.3.sql (get it from http://www.gaia-gis.it/spatialite-2.3.1/resources.html). It will create the tables “geometry_columns” and “spatial_ref_sys”.
spatialite> .read '~/init_spatialite-2.3.sql' ASCII
For testing purposes, we’ll now load a shapefile into our new database. I used a Teleatlas street graph (attribute encoding iso-8859-15) and created a “streets” table:
spatialite> .loadshp ~/maps/streetgraph streets iso-8859-15
Finally, we register the geometry columns … pretty similar to PostGIS:
spatialite> UPDATE streets SET Geometry = SetSrid(Geometry,4326);
spatialite> SELECT RecoverGeometryColumn('streets','Geometry',4326,'LINESTRING',2);
Done! That’s it. Now we can view our test data in QGIS. For a longer Tutorial check http://www.gaia-gis.it/spatialite/spatialite-tutorial-2.3.1.html