Page 2 of 72 (1438 posts)

  • talks about »

Tags

Last update:
Thu Feb 26 23:55:07 2015

A Django site.

QGIS Planet

QGIS – live layer effects Kickstarter update

Here’s another quick video demonstration of the latest developments in layer effects – effects on polygon and polyline layers, and outer glow effects:

Time is running out to fund this campaign and make this work happen… Please donate via Kickstarter!

I’ve also been asked what will happen if funding exceeds the Kickstarter goal? Well, if this happens, the extra funds will be used to add additional layer effects to QGIS. Next up will be inner glow, inner shadow and color modification effects.

Use of the Flemish geographical data portal “Geopunt” in QGIS

Geopunt website Geopunt is the central portal for geographical data of the Flemish government. Beside an online viewer, a catalogue is available from where data can be downloaded. A lot of these data are free to download (e.g. orthophotos), other data is available depending on your user profile (e.g. soil map) Download through the Geopunt4Qgis […]

Happy new year to the power of two!

For the first time we at OPENGIS.ch can celebrate with 2 people, Marco Bernasocchi and Matthias Kuhn both experienced QGIS developers and holders of a Master degree in GIScience. After having worked individually in the last years, we have realized that there is a huge potential for us to join our knowledge - because the whole is greater than the sum of its parts. This is why starting from January 1st, 2015 we are working together as OPENGIS.ch LLC.

How to: watercolor pastel style in QGIS

Today’s post is a follow-up to a recent map experiment which I published in the QGIS Flickr group. It’s basically an inverted Stamen Toner style with an image in the map composition background instead of a solid color (similar to the approach described for vintage maps):

That’s nice but with this approach we only get to enjoy the complete design in the print composer but not in the main window. So what other options do we have? – SVG fills to the rescue!

But first we need a suitable SVG with this nice pastel style. I used Gimp to create a seamless version of the pastel image and then embedded the image in an SVG using Inkscape:

LT_RemixedChalkPastel_snakk_seamless

In QGIS, this SVG can now be used in any SVG fill. It’s important to set the Texture width setting to a quite high value when working with SVGs containing big textures, otherwise the images will be rendered very small and the repeating patterns will be very obvious.

Screenshot 2015-01-04 17.49.11

Once the background is in place, we can add the line work and labels. The roads are white with black outlines for bridges which – together with the Lighten blending mode – produce the desired effect:

Screenshot 2015-01-04 17.37.33


Happy new year!

Thank you for a great 2014! It’s been a pleasure to see the open source GIS community grow and experience what we can create together. It’s great to see the interest for open source GIS all over the world:

In total, this blog has been visitied from 216 countries. Most visitors came from The United States. Germany & France were not far behind.

In total, this blog has been visitied from 216 countries. Most visitors came from The United States. Germany & France were not far behind.

Since my first post in 2010, the development of this blog has exceeded all expectations I might have had by far. For 2014, the WordPress blog view counter shows a staggering 330,000 views or over 900 views per day.

In case you were wondering, the most popular posts of 2014 were:

  1. 3D Viz with QGIS & three.js
  2. A guide to GoogleMaps-like maps with OSM in QGIS
  3. A QGIS 2.2 preview
  4. Getting started writing QGIS 2.x plugins
  5. and Toner-lite styles for QGIS

Thank you, your feedback has been a continuous source of motivation. All the best for 2015!


Top10 QGIS Planet posts 2014

It’s the end of December and time to recap 2014. Therefore, I decided to have a look at what this year has brought us. There were plenty of great posts for both casual and power users as well as developers. Here is my pick of the top 10 posts from the QGIS Planet blog aggregator.

  1. Tons of colour improvements! (Nyall Dawson)
  2. The QGIS Field calculator is dead. Long live the Field calculator bar (Nathan Woodrow)
  3. Why QGIS Class Names Start with Qgs (Gary Sherman)
  4. Atlas Previews (Nyall Dawson)
  5. QGIS atlas on non geometry tables (Nathan Woodrow)
  6. Gradient Fills (Nyall Dawson)
  7. What are all these QGIS file types? Why do I need them (Nathan Woodrow)
  8. Getting Started Writing QGIS Python Plugins (Peter Wells)
  9. QGIS Layer Tree API (Martin Dobias)
  10. Shapeburst fill styles (Nyall Dawson)

More great features and posts are sure to come next year. For example, Nyall is currently running a campaign on Kickstarter to add Live Layer Effects such as drop shadow effects to QGIS. Please support it if you can.


Kickstarter Alert – Live Layer Effects for QGIS

QGIS is well regarded for its fantastic cartographic abilities – it’s got a huge range of symbology styles and options which can be used to style your maps. But there’s more we can do to push this even further.

One long requested cartographic feature has been for live drop shadows on layers. Why stop there? Why not inner and outer glow effects and live blur effects? Just imagine the cartographic possibilities if this functionality was available from within a GIS, and didn’t require exporting maps to external editors…

I’ve launched a Kickstarter project to fund implementing live layer effects like this within QGIS. Please consider donating or spreading the word if you’d find this feature useful!

Setting up a Fedora 21 QGIS Workstation

I have been a long time Ubuntu user (I have actually been using it since Ubuntu 4.10 ‘Warty Warthog’) – the first official release. The advent of Ubuntu saw an end to my distro hopping whilst looking for the ‘perfect linux distro’.

Recently though, Ubuntu has been losing momentum in my opinion – especially in terms of supporting the latest Gnome desktop editions and catering for those of us who like to use a leading edge platform for our developer workstations. I was particularly curious to see if QGIS runs nicely under Wayland, the next-generation graphics environment for Linux.

I have been using docker heavily for the last year and have come to the point where I feel that the underlying Linux flavour is less important since I can fairly arbitrarily deploy applications in docker containers using whichever flavour of Linux inside the container is most convenient.

Thus I decided to try and see how easy it would be to get Fedora 21 installed on my MacBook 13″ Laptop which was running Ubuntu quite nicely until now. In the Gist below, I detail the various installation steps I took to get my standard suite of applications installed. These include:

  • docker
  • QGIS compilation build chain
  • PyCharm 4
  • Shutter
  • Skype
  • QtCreator / QtDesigner etc.
  • btsync
  • Google Chrome
  • vlc and assorted video codecs
  • keepassx
  • Elegance gnome theme (must-have if you use Gnome!)

 

Workspace 1_130

I will keep the above Gist updated as I tweak my configuration, but by and large the migration to Fedora has been fairly painless and I am enjoying working on the latest Gnome desktop. I was able to replicate pretty much all of the application stack I ran on Ubuntu, though in some cases the setup & installation of applications was a little more complex than on Ubuntu, and in one case (btsync-gtk-gui) I have not yet found a binary installation package.

Exploring open government population data collected by ODVIS-AT

At FOSS4G2013, I had the pleasure to attend a presentation about the ODVIS.AT project by Marius Schebella from the FH Salzburg. The goal of the project – which ended in Summer 2014 – was “to display open data (demographic, open government data) in a quick and easy way to end users” by combining it with OpenStreetMap. Even though their visualization does not work for me (“unable to get datasets” error), not all is lost because they provide an SQL dump of their PostGIS database.

Checking the data, it quickly becomes apparent that each data publisher decided to publish a slightly different dataset: some published their population counts as timelines over multiple years, others classified population by migration background, age, or gender. Also, according to the metadata table, no data from Salzburg and Burgenland were included. Most datasets’ reference date is between 2011 and 2013 but the data of the westernmost state Vorarlberg seems to be from 2001.

Based on this database, I created a dataset combining the municipalities with the Viennese districts and joined the population data from the individual state tables. The following map shows the population density based on this dataset: it is easy to recognize the densely populated regions around Vienna, Linz, Graz, and in the big Alpine valleys.

odvis_popdens

Overall, it is incredibly time-consuming to create this seemingly simple dataset. It would be very helpful if the publishers would agree on a common scheme for releasing at least the most basic information.

Considering that OpenStreetMap already contains population data, it barely seems worth all the trouble to merge these OGD datasets. Granted, the time lines of population development would be interesting but they are not available for each state.

P.S. If anyone is interested in the edited database, I would be happy to share the SQL dump.


Shortcuts to hide/show panels in QGIS

Just a quick one to show how to assign shortcuts to hide and show for panels in QGIS. Add this to your .qgis2\python\startup.py

from functools import partial
from qgis.utils import iface

from PyQt4.QtCore import *
from PyQt4.QtGui import *

mappings = {"Layers": Qt.ALT + Qt.Key_1,
            "Browser": Qt.ALT + Qt.Key_2,
            "PythonConsole": Qt.ALT + Qt.Key_3}
shortcuts = []

def activated(dock):
    dock = iface.mainWindow().findChild(QDockWidget, dock)
    visible = dock.isVisible()
    dock.setVisible(not visible)

def bind():
    for dock, keys in mappings.iteritems():
        short = QShortcut(QKeySequence(keys), iface.mainWindow())
        short.setContext(Qt.ApplicationShortcut)
        short.activated.connect(partial(activated, dock))
        shortcuts.append(short)

bind()

and now you can hide and show using ALT + number

2nd edition of Learning QGIS

It’s my pleasure to announce that the updated and extended 2nd edition of Learning QGIS is available now.

I also want to take this opportunity to thank everyone who made the 1st edition such a great success!

This second edition has been updated to QGIS 2.6 and it features a completely new 6th chapter on Expanding QGIS with Python. It introduces the QGIS Python Console, shows how to create custom Processing tools, and provides a starting point for developing plugins.

Overall, the book has grown by 40 pages and the price of the print version has dropped by 3€ :-)

Happy QGISing!

2031OSos_mockupcover_normal_0


GRASS GIS 7: Vector data reprojection with automated vertex densification

GRASS GIS 7 just got better: When reprojecting vector data, now automated vertex densification is applied. This reduces the reprojection error for long lines (or polygon boundaries). The needed improvement has been kindly added in v.proj by Markus Metz.

1. Example

As an (extreme?) example, we generate a box in LatLong/WGS84 (EPSG: 4326) which is of 10 degree side length (see below for screenshot and at bottom for SHAPE file download of this “box” map):

[neteler@oboe ~]$ grass70 ~/grassdata/latlong/grass7/
# for the ease of generating the box, set computational region:
g.region n=60 s=40 w=0 e=30 res=10 -p
projection: 3 (Latitude-Longitude)
zone:       0
datum:      wgs84
ellipsoid:  wgs84
north:      60N
south:      40N
west:       0
east:       30E
nsres:      10
ewres:      10
rows:       2
cols:       3
cells:      6
# generate the box according to current computational region:
v.in.region box_latlong_10deg
exit

Next we start GRASS GIS in a metric projection, here the EU LAEA:

# EPSG 3035, metric EU LAEA:
grass70 ~/grassdata/europe_laea/user1/
GRASS 7.0.0svn (europe_laea): >

Now we first reproject the map the “traditional way” (no vertex densification as in most GIS, here enforced by smax=0):

v.proj box_latlong_10deg out=box_latlong_10deg_no_densification
location=latlong mapset=grass7 smax=0

Then we do a second reprojection with new automated vertex densification (here we use the default values for smax which is a 10km vertex distance in the reprojected map by default):

v.proj box_latlong_10deg out=box_latlong_10deg_yes_densification
location=latlong mapset=grass7

Eventually we can compare both reprojected maps:

g.region vect=box_latlong_10deg_no_densification

# compare:
d.mon wx0
d.vect box_latlong_10deg_no_densification color=red
d.vect box_latlong_10deg_yes_densification color=green fill_color=none
Comparison of the reprojection of a 10 degree large LatLong box to the metric EU LAEA (EPSG 3035): before in red and new in green. The grid is based on WGS84 at 5 degree spacing.

Comparison of the reprojection of a 10 degree large LatLong box to the metric EU LAEA (EPSG 3035): before in red and new in green. The grid is based on WGS84 at 5 degree spacing.

The result shows how nicely the projection is now performed in GRASS GIS 7: the red line output is old, the green color line is the new output (its area filling is not shown).

Consider to benchmark this with other GIS… the reprojected map should not become a simple trapezoid.

2. Sample dataset download

Download of box_latlong_10deg.shp for own tests (1kB).

The post GRASS GIS 7: Vector data reprojection with automated vertex densification appeared first on GFOSS Blog | GRASS GIS Courses.

QA for Turn Restrictions in OSM

Correct turn restriction information is essential for the vehicle routing quality of any street network dataset – open or commercial. One of the challenges of this kind of information is that these restrictions are typically not directly visible on each map.

This post is inspired by a share on G+ which resurfaced in my notifications. In a post on the Mapbox blog, John Firebaugh presents the OSM iD editor which should make editing turn restrictions straight-forward: clicking on the source link turns the associated turn information visible. By clicking on the turn arrows, the user can easily toggle between allowed and forbidden.

iD, the web editor for OpenStreetMap, makes it even simpler to add turn restrictions to OpenStreetMap.

editing turn restrictions in iD, the web editor for OpenStreetMap. source: “Simple Editing for Turn Restrictions in OpenStreetMap” by John Firebaugh on June 06 2014

But the issue of identifying wrong turn restrictions remains. One approach to solving this issue is to compare restriction information in OSM with the information in a reference data set.

This is possible by comparing routes computed on OSM and the reference data using a method I presented at FOSS4G (video): a turn restriction basically is a forbidden combination of links. If we compute the route from the start link of the forbidden combination to the end link, we can check if the resulting route geometry violates the restriction or uses an appropriate detour:

read more about this method and results:

illustrative slide from my LBS2014 presentation on OSM vehicle routing quality – read more about this method and results for Vienna in our TGIS paper or the open pre-print version

It would be great to have an automated system comparing OSM and open government street network data to detect these differences. The quality of both data sets could benefit enormously by bundling their QA efforts. Unfortunately, the open government street network data sets I’m aware of don’t contain turn information.


Mozilla Stumbler layer: loading TMS and XYZ tilelayers in QGIS

Mozilla Location Service (MLS) layer Personally I’m very interested in the Mozilla Location Service (MLS), I wrote an earlier article about it on my work (Zuidt.nl) blog. Key in this project is that both locations of wifi points and cell towers are crowdsourced and put in a open database, so everybody can use that data […]

Using Hy, a dialect of Lisp for Python, with QGIS

So tonight I rediscovered Hy. I had seen Hy before a while ago but never really sat down and tried it. Tonight just must have been one of those days to try something new.

So Hy is a dialect of Lisp but embedded in Python which means you can use any Python library will using a Lisp dialect. Pretty nifty.

My next thought was, how would this look using the QGIS libraries. So lets give it a try.

First we need to install Hy:

pip install Hy

Now just create a .hy file and add some code

(import qgis)
(import [qgis.core [QgsVectorLayer]])
(import [qgis.core.contextmanagers [qgisapp]])

(setv layers [])

(defn load-layer [file name]
    (setv layer (QgsVectorLayer file name "ogr"))
    (.append layers layer))

(defn print-layer [layer]
    (print "Layer Name:" (.name layer))
    (print "Valid:" (.isValid layer))
    (print "Extents:" (.toString (.extent layer))))

(defn main [app]
    (load-layer r"F:\gis_data\test.shp" "test")
    (for [layer layers] (print-layer layer)))


(with [[app (apply qgisapp [] {"guienabled" False})]]
    (print "Loading QGIS")
    (main app))

run it in our shell and bingo.

F:\dev\hy-qgis>hy qgistest.hy
Loading QGIS
Layer Name: test
Valid: True
Extents: 392515.3457026787800714,6461581.2076761415228248 : 392683.3794420150225051,6461705.1012571481987834

Sweet.

Just for reference the Python version of the above would be:

import qgis
from qgis.core import QgsVectorLayer
from qgis.core.contextmanagers import qgisapp

layers = []

def load_layer(file, name):
    layer = QgsVectorLayer(file, name, "ogr")
    layers.append(layer)

def print_layer(layer):
    print "Layer Name:", layer.name()
    print "Valid:", layer.isValid()
    print "Extents:", layer.extent().toString()

def main(app):
    load_layer(r"F:\gis_data\test.shp", "test")
    for layer in layers:
        print_layer(layer)

with qgisappl(guienabled=False) as app:
    main(app)

More readable? No doubt, that is why I love Python, however the strange thing is the first time I looked at Lisp, including Hy, I thought "whoa all those parentheses back it up!1!" but strangely after using it for a while (read: not even a few hours) they don't seem to be an issue, or not much of one anyway. YMMV.

The cool thing with using Hy is you can still use all the libraries you are used to as the example above shows, PyQt, QGIS, anything.

The other interesting, and pretty funky, thing is that you are able to import .hy files like normal Python files. If you create a file winning.hy you can just import winning into any Python application and it works.

Why bother? Mainly because learning something new is never a bad thing, and you never know what you might pick up.

Check out the Hy for more info on what you can do and how it works

I have also created a hy-qgis GitHub repo for some experiments.

Enjoy!

Using Hy, a dialect of Lisp for Python, with QGIS

So tonight I rediscovered Hy. I had seen Hy before a while ago but never really sat down and tried it. Tonight just have been one of those days to try something new.

So Hy is a dialect of Lisp but embedded in Python which means you can use any Python library will using a Lisp dialect. Pretty nifty.

My next thought was, how would this look using the QGIS libraries. So lets give it a try.

First we need to install Hy:

pip install Hy

Now just create a .hy file and add some code

(import qgis)
(import [qgis.core [QgsVectorLayer]])
(import [qgis.core.contextmanagers [qgisapp]])

(setv layers [])

(defn load-layer [file name]
    (setv layer (QgsVectorLayer file name "ogr"))
    (.append layers layer))

(defn print-layer [layer]
    (print "Layer Name:" (.name layer))
    (print "Valid:" (.isValid layer))
    (print "Extents:" (.toString (.extent layer))))

(defn main [app]
    (load-layer r"F:\gis_data\test.shp" "test")
    (for [layer layers] (print-layer layer)))


(with [[app (apply qgisapp [] {"guienabled" False})]]
    (print "Loading QGIS")
    (main app))

run it in our shell and bingo.

F:\dev\hy-qgis>hy qgistest.hy
Loading QGIS
Layer Name: test
Valid: True
Extents: 392515.3457026787800714,6461581.2076761415228248 : 392683.3794420150225051,6461705.1012571481987834

Sweet.

Just for reference the Python version of the above would be:

import qgis
from qgis.core import QgsVectorLayer
from qgis.core.contextmanagers import qgisapp

layers = []

def load_layer(file, name):
    layer = QgsVectorLayer(file, name, "ogr")
    layers.append(layer)

def print_layer(layer):
    print "Layer Name:", layer.name()
    print "Valid:", layer.isValid()
    print "Extents:", layer.extent().toString()

def main(app):
    load_layer(r"F:\gis_data\test.shp", "test")
    for layer in layers:
        print_layer(layer)

with qgisappl(guienabled=False) as app:
    main(app)

More readable? No doubt, that is why I love Python, however the strange thing is the first time I looked at Lisp, including Hy, I thought "whoa all those parentheses back it up!1!" but strangely after using it for a while (read: not even a few hours) they don't seem to be an issue, or not much of one anyway. YMMV.

The cool thing with using Hy is you can still use all the libraries you are used to as the example above shows, PyQt, QGIS, anything.

The other interesting, and pretty funky, thing is that you are able to import .hy files like normal Python files. If you create a file winning.hy you can just import winning into any Python application and it works.

Why bother? Mainly because learning something new is never a bad thing, and you never know what you might pick up.

Check out the Hy for more info on what you can do and how it works

I have also created a hy-qgis GitHub repo for some experiments.

Enjoy!

QGIS 2.6 user guide released

The QGIS documentations team has released an updated version of the user guide:

qgisdocs26

I’d like to encourage everyone to have a look and explore the content, for example the great tips in the Actions menu section:

action_dialog


QGIS 2.6.1 and QGIS 2.6 Documentation Released

QGIS 2.6.1 Just a short notice that the QGIS project (silently) released QGIS 2.6.1, a bug fix release for the latest stable version of QGIS 2.6 Brighton. Some notable fixes include: - composer stuff which was not working ok - not all attribute columns showing in attribute table - metasearch (CSW plugin) was not working […]

Analyzing regional income differences

On my quest to create test data for spatial statistics, I’ve discovered income data for Austria per municipality on a news paper website:

Screenshot 2014-11-29 23.06.46

For further analysis, I decided to limit the area to Vienna and Lower Austria. Since the income data included GKZ “Gemeindekennzahl” IDs, it was possible to join them to municipalities extracted from OpenStreetMap using QuickOSM for QGIS. GRASS v.clean was used to clean the vector topology to the point where PySAL was able to compute spatial weights.

Using PySAL, I then computed income clusters: blue regions represent low clusters while red regions represent high clusters …

Municipality border data (c) OpenStreetMap and contributors Income data source: Statistik Austria via derStandard

Municipality border data (c) OpenStreetMap and contributors
Income data source: Statistik Austria via derStandard

The results show a statistically significant cluster of low income in the north west, in the area called Waldviertel, as well as a cluster of high income containing many of the municipalities surrounding Vienna, an area often referred to as the “Speckgürtel” (“bacon belt”).


Releasing TimeManager 1.2

Today, I’ve released TimeManager 1.2 which adds support for additional time formats: DD.MM.YYYY, DD/MM/YYYY, and DD-MM-YYYY (thanks to a pull request by vmora) as well as French translation (thanks to bbouteilles).

TimeManager now automatically detects formats such as DD.MM.YYYY

TimeManager now automatically detects formats such as DD.MM.YYYY

But there is more: the QGIS team has released a bugfix version 2.6.1 which you can already find in Ubuntu repos and the OSGeo4W installer. Go get it! And please support the bugfix release effort whenever you can.


  • <<
  • Page 2 of 72 ( 1438 posts )
  • >>

Back to Top

Sponsors