PostGIS ’select’ statement as vector layer in QGIS

Free open-source software (FOSS), Geographic information science/systems (GIS), Helpful tips, How to 1 Comment »

Several colleagues of mine have asked whether it is possible to visualise the results of a SELECT statement on a PostGIS database that returns spatial data in QGIS. In other words, can we map the results of something like SELECT id, st_union(the_geom) FROM spatial_table GROUP BY id;. My usual answer to this in the past has been “not yet…”, but now thanks to Giuseppe Sucameli and Jürgen E. Fischer, the answer is a resounding “yes!”. A recent patch to QGIS trunk now makes custom Postgres queries possible via the postgres data provider.

Read the rest of this entry »

Parallel bootstrapping with R

Free open-source software (FOSS), How to, Networks, Research No Comments »

In a recent post, I mentioned that I was testing the stability of clusters generated from a modified network partitioning algorithm using bootstrap resampling techniques. I also mentioned that I was doing this in R, using the very nice foreach package published by REvolution Computing. To show just how nice this package is, below is a minimal example of bootstrapping a network partitioning algorithm which takes advantage of a multicore processor:

Read the rest of this entry »

Bootstrapping network partitioning methods

How to, Networks, Research No Comments »

My PhD research at the moment focuses on network-based algorithms for delineating functional regions (geographical regions within which a large majority of the local population seeks employment, and the majority of local employers recruit their labour). Currently I’m using a network partitioning algorithm based on modularity maximisation. I have found my results to be quite good so far, but, ‘quite good’ isn’t really a very scientific description of validity, so obviously some others means of validation is required. Enter bootstrap resampling!

Read the rest of this entry »

QGIS developer meeting update

Announcement, Free open-source software (FOSS), Geographic information science/systems (GIS), Helpful tips, How to 6 Comments »

Last week I attended the 2009 QGIS Developers Meeting in Vienna, Austria. We all had a really good time, met many new people, and actually got a lot done in the process. There have been updates about the meeting (hackfest) on the QGIS blog, and Tim Sutton has written a few words about our progress as well. I’m not going to repeat what others have said, but I would like to give a quick update on the work that I was doing at the meeting, and show off the new geoprocessing features now available to all QGIS developers (Python and C++).
Read the rest of this entry »

Voronoi polygons with R

Free open-source software (FOSS), Helpful tips, How to, R spatial 2 Comments »

To create a nice bounded Voronoi polygons tessellation of a point layer in R, we need two libraries: sp and deldir. The following function takes a SpatialPointsDataFrame as input, and returns a SpatialPolygonsDataFrame that represents the Voronoi tessellation of the input point layer.
Read the rest of this entry »

‘Watch’ long running processes

Free open-source software (FOSS), Helpful tips, How to, Linux 1 Comment »

The other day I was loading a shapefile of approximately 11 million records into a PostGIS database (stay tuned for more on that later) and I wanted to know when shp2pgsql was done. Instead of continually checking the console, I decided to ‘watch’ the process using the *nix command watch. I discovered this handy tool a while ago, and have found that for long running processes, I can use watch to notify me when the process has finished, using the following command:

watch -ben 1 "ps u -C shp2pgsql"
Read the rest of this entry »

Syntax highlighting with PyQt

Free open-source software (FOSS), Helpful tips, How to 3 Comments »

A few months ago I decided to add syntax highlighting capabilities to a piece of software that I have been working on. Since it is a PyQt based application, the obvious choice for implementing syntax highlighting was to use Qt’s QSyntaxHighlighter. Unfortunately, there weren’t many examples around that implemented syntax highlighting in Python, so I decided to post my own.
Read the rest of this entry »

Open up your online maps with OpenStreetMap

Free open-source software (FOSS), Geographic information science/systems (GIS), How to No Comments »

OpenStreetMap (OSM) is a project designed to create and provide free spatial data (street maps) to anyone and everyone who wants them. It is based on an open-source philosophy, and combines wiki-like user generated data, with free access, allowing users to create, edit, download, and use OSM data to their hearts content. According to the OSM website, “the project was started because most maps you think of as free actually have legal or technical restrictions on their use, holding back people from using them in creative, productive or unexpected ways.” There are now tones of websites and open-source software projects that incorporate OSM data, and the growing popularity of the site means that the data is only going to get better (more accurate) and bigger (more data).

Read the rest of this entry »

gedit: The ultimate LaTeX editor

Free open-source software (FOSS), Helpful tips, How to, Linux 1 Comment »

Out of the box gedit is a basic text editor, but it comes equipped with about 12 standard plugins, and another 9 readily available. In addition to this, there are a range of ‘third-party’ plugins developed to do various specific tasks, such as assist you in writing and exporting LaTeX documents!
Read the rest of this entry »

Quick guide to setting up a PostGIS database

Free open-source software (FOSS), Geographic information science/systems (GIS), Helpful tips, How to, Linux 1 Comment »

Recently I decided to seriously start using PostGIS to manage my spatial data. As I have several projects on the go, organizing and managing my data effectively has become extremely important, and PostGIS is by far the most convenient way to do this. There is lots of documentation out there that explains in detail how to set up PostGIS, but by far the best reference I’ve found is from Tim Sutton’s blog, mainly because he uses Ubuntu, and sudo-apt gets everything you need to have PostGIS working in minutes.
Read the rest of this entry »

Original design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in