Archive

Author Archives: underdark

Creating high-resolution output with QGIS can be tricky. “Save as image” saves the current map extent and creates a world file, but the output size cannot be specified directly. It simply saves the currently visible map. Most of the time this resolution will not be satisfactory.

Using “Print Composer” enables you to create full-grown maps including legend, scale bar, text annotations, north arrow, attribute table, decorations, etc. You are free to chose any size/resolution for the output image. Unfortunately, this way you will not get a world file.

That’s where the third possibility comes in handy:  Using QGIS from command line to create a snapshot of a map. This way, you can create images of any size and with corresponding world file. The work-flow can be divided into the following steps:

  1. Create and design your project: Add layers and styles.
  2. Zoom to the desired zoom level.
  3. Write down the extent of the map window. Use coordinates in the project’s projection. (You can skip this step and don’t specify –extent option. The project will be restored in it’s original saved state if you do so.)
  4. Close the project
  5. Go to command line and run
C:\...>qgis --project myproject.qgs --snapshot image.png
            --width 1500 --height 1000 --extent xmin,ymin,xmax,ymax

QGIS will start, load the project, create the snapshot, and close again. That’s it!

Things to be aware of: QGIS will start, load the project, set the given extent (if specified), enlarge the map canvas and then take the snapshot. As a consequence, the extent given doesn’t match the extent of the resulting image. The image will have a bigger extent and contain surrounding areas.

Together with the new labeling tools this can be a fast and (semi-)automatic way to create nice looking high-resolution map images and corresponding world files from QGIS projects.

A great enhancement has been added to “Delimited Text” plugin today. It allows the use of a geometry column formatted as well known text (WKT), as an alternative to using x and y columns to define point features.

Requirements

To view a delimited text file as layer, the text file must contain:

  1. A delimited header row of field names. This must be the first line in the text file.
  2. The header row must contain an X and Y field or a Well Known Text (WKT) field. These fields can have any name.
  3. The WKT field must be in standard format.

Example of a valid text file with a WKT field

id|wkt
1|POINT(172.0702250 -43.6031036)
2|POINT(172.0702250 -43.6031036)
3|POINT(172.1543206 -43.5731302)
4|POINT(171.9282585 -43.5493308)
5|POINT(171.8827359 -43.5875983)

Update: Tim has posted a video tutorial: Video tutorial #2: Delimited Text Plugin

QGIS 1.6 is now officially released. Read the announcement on QGIS blog for information on new features or go directly to the download page.

Update: The QGIS manual has also been brought up-to-date.

ERDAS’ ECW licensing does not allow free redistribution. Therefore, QGIS can’t support .ecw out of the box. However, you can download ERDAS’ SDK – which gives access to .ecw rasters – from their website for free.

If you need ECW support in QGIS and are struggling, you might find Micha Silver’s post “QGIS on Windows with ECW” very helpful.

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.

Starting from scratch can be painful. Luckily there’s a tool out there that can help: PyQGIS Plugin Builder. The form will build a minimal plugin for you. You’ll get a ready QGIS 1.0 plugin that implements an empty dialog with Ok and Close buttons. You can find a step-by-step description on how to create and modify this dummy plugin at linfiniti.com – “A simple QGIS python tutorial”.

From there, I suggest moving to the PyQGIS Cookbook – a great resource for everything related to QGIS with Python – especially the part about “Developing Python Plugins”. Tim also created a PDF version of the Cookbook (original post) if you prefer it in hard copy.

Yesterday, I picked up an interesting link on QGIS IRC: mapbox.com – “Create beautiful custom maps using open source tools in the cloud”.

Mapbox tile "Word Dark"

MapBox provides open source tools and services for creating and using custom maps. They also design tilesets and host them for free. Currently, there are tiles featuring world maps, maps of the U.S., Haiti, Iraq, Pakistan and Afghanistan.

You can integrate MapBox’s tiles into websites using Google Maps or OpenLayers. For example, in OpenLayers creating a new layer for their “World Dark” tiles would look like this:

var layer = new OpenLayers.Layer.MapBox(
   "World Dark",
   { 'layername': layername,
      'osm': 0,
      'type': file_extension,
      'serverResolutions': [156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.96980938,2445.98490469,1222.99245234,611.496226172,305.748113086,152.874056543,76.4370282715,38.2185141357,19.1092570679,9.55462853394,4.77731426697,2.38865713348,1.19432856674,0.597164283371],
      'resolutions': [156543.0339,78271.51695,39135.758475,19567.8792375,9783.93961875,4891.96980938,2445.98490469,1222.99245234,611.496226172,305.748113086,152.874056543,76.4370282715]
   }
);

VisualEyes is an online tool developed at the University of Virginia. It allows you to combine images, maps, charts, video and data into interactive dynamic visualizations.

The examples offer multiple map layers, charts and of course a time slider to navigate through time.

VisualEyes example: Jefferson's Travels to England

Check out: www.viseyes.org.

Kudos to radek at gis.stackexchange.com.

The enhancement request Support for “selected features only” in “Select by location” is now implemented.

Thanks Carson!

Three new label editing tools found their way into the QGIS developer version:

  1. move label tool … move text labels to a new position
  2. rotate label tool … allows for interactive rotation of labels
  3. label property tool … opens a dialog where users can manipulate the properties and text of a label

These tools allow you to mix fixed label positions and automatic label positioning inside a project. If the x or y attribute value is NULL, the position will be set automatically. When a label position is changed using “move label tool”, the position is written into the attribute fields and the label position for this feature is fixed.

To use these tools on existing layers, add x, y and rotation attribute fields (type double). By default, all values will be NULL and thus the layer will be labeled automatically. Now you’re ready to move and rotate the labels as you like.

For more information check: www.sourcepole.com