Archive for the ‘ Arch Linux ’ Category

Installing PGRouting on Arch Linux

PGrouting adds routing functionality to a PostGIS database.  For Arch users you can install it from AUR.  If you want PGRouting’s Travelling Sales Person (TSP) functionality installed you’ll need to install Gaul (available from AUR from gaul-devel) and if you want Driving Distance (from AUR as cgal).  After you install PGRouting run

sudo ldconfig

so you’re system knows where to find the new PGRouting libraries.

Next up is to add PGRouting to your PostGIS database.  PGRouting doesn’t have an extension yet so you’ll have to run some sql files.  I like to install PGRouting into its own schema so I start psql and use:

CREATE SCHEMA pgrouting;
SET search_path pgrouting, postgis;
\i /usr/share/postlbs/routing_core.sql
\i /usr/share/postlbs/routing_core_wrappers.sql
\i /usr/share/postlbs/routing_tsp.sql
\i /usr/share/postlbs/routing_tsp_wrappers.sql
\i /usr/share/postlbs/routing_dd.sql
\i /usr/share/postlbs/routing_dd_wrappers.sql

You may get some errors like

ERROR:  language "C" does not exist

If you do, just open the file you tried to run and find the line referenced.  Change the “C” to “c” and then re-run the .sql file.

Now all that is left to do is add the pgrouting schema to your search path.  Personally I use an ALTER DATABASE statement, but other people may prefer to make the change on a per user basis.


Postgis 2.0.2 hits Arch repository

Arch has posted the PostGIS 2.0.2 release that came out December 3rd to the Community repository. After Pacman updates the package Postgres needs to be made aware of the upgrade.  Use:

ALTER EXTENSION postgis_topology TO "2.0.2";

Early impressions of QGIS 1.9

I had a raster and I needed to make the no data value transparent, but QGIS 1.8 has a bug that prevented me from doing so.  Since I’m not working in a production environment I decided to go ahead and pull 1.9 from QGIS’s Git repository and give it a shot.  Someone has set up a PKGBUILD that handles all the hard work of pulling the latest and greatest off of github for you.

Once 1.9 was downloaded and compiled I really liked what I saw.  Not only is the no data transparency bug fixed, but the raster menu is completely overhauled.  I will miss the old single band pseudo-color and freak out settings, I guess I can figure out what their color ramps were and rebuild them by hand.  I’ll take that over the old way rasters were handled which left you staring at a grey box until you set the min/max values and stretched the display to their values.  Now when you load a raster you get a usable display right off the bat.

Also new in 1.9 is the updated label tab and engine.  I haven’t played with it much but there are a million options to play with, once you dig into it labels are going to rival what you get from ArcMap’s Maplex label engine.

I also downloaded a new plugin, Statist.  It is available from the official plugin repository, and it works on QGIS 1.8 or greater.  This plugin is similar to ArcMap’s Statistics menu, as you can see in the screenshot below it gives you a frequency chart and a break down on some basic statistical data from fields in your vector layers.  Simple, easy to use, and gives you valuable information, it’s a great plugin.  Before you can use it you’ll need to install a python 2 library, python2-matplotlib.  For Arch users this library is available from the community repository.

statist plugin screenshot

Proof that I don’t pedal fast enough



R Graphics Device is blank, won’t show plots or charts

Arch‘s latest version of R (2.15.2-1) has a bug, nothing is drawn when you send a plot or chart to the default graphics device.  It’s an easy fix, before you plot anything issue the following command:


After that you’re good until you close that Graphic Device.  If you close it you’ll have to re-issue the command.  There’s an entry for this issue in the bug tracker, hopefully this issue will be resolved soon.

Migrated to systemd

I migrated my existing Arch installation to a standalone systemd by following the steps laid out in this wiki post.  It was a quick and easy process, hopefully it will be easy to administer down the line.

Arch updates Postgresql & PostGIS

Postgresql 9.2.1 and PostGIS 2.0.1 just hit Arch’s repositories.  Going from Postgres 9.1 to 9.2 is a major upgrade and will require your 9.1 databases to be migrated.  For steps on how to upgrade your data see this post in the Arch Wiki.  If you want to postpone updating your databases add postgresql and postgresql-libs to your IgnorePkg line in your /etc/pacman.conf file.

GeoDjango on Arch

I just burned through the tutorial for GeoDjango.  It’s pretty easy to follow, but if you’re on Arch remember when it references python substitute python2 since Django doesn’t work with Python3 yet.  Also, if you follow the tutorial it will have you download a shapefile with the borders for the countries.  You’ll have to either populate the FIPS column of the attribute table for 3 of the records, or remove the ‘NOT NULL’ constraint from the FIPS field in PostGIS.