The Raster Calculator in QGIS allows you to run any expression on a raster or collection of rasters. While it is definitely useful, exactly how to phrase your expression in order to reclassify a raster is not always clear. Let’s say you have a raster with values between 0 and 255, and you want everything… Read more »
Posts By: Rudi Thiede
OpenLayers: failure of map redraw on panning
Just a quick heads up for those of you using OpenLayers. There seem to have been a lot of problems lately with OpenLayers refusing to redraw its layers when panning, where everything was working before. One possible solution turned up in this thread on OpenLayers Users. The credit for solving the problem is therefore not… Read more »
Quick Git tip: blast from the past
This has been happening to me often lately: “Rats, this function is broken when I try to do XYZ. But why? I know it worked last week before I started messing around with it. I wasn’t testing the currently broken aspect of it in the interim, though, and I can’t remember what it looked like… Read more »
Upgrading a database to PostGIS 2
Recently I needed the function ST_Split for various and sundry reasons, only to discover that I couldn’t use it in my database. The reason was that ST_Split is a new function introduced in Postgis 2.0, and the database was still in 1.5.3. Obviously, time for an upgrade. I began following the upgrade process, which I’ll… Read more »
Centering table cell contents with xhtml2pdf
If you’ve tried centering table cell contents in xhtml2pdf, you’ve probably noticed that it doesn’t work. The typical symptoms seem to be that cell contents are right against (or even over) the upper border of the cell. For reasons unknown, xhtml2pdf ignores “vertical-align” instructions, so you can’t use that. To solve the problem, I did… Read more »
XKCD on Map Projections
Recently, XKCD strayed into our territory with this page about map projections: To be honest, I’ve always like Gall-Peters myself, if only as a way to illustrate how map projections distort the appearance of continents. It’s quite effective at conveying this concept, because it distorts things in the opposite direction of the universally familiar Mercator…. Read more »
jQuery: selecting a child element
The jQuery JavaScript library allows you to select any element on a webpage and modify it. I will assume you already know how it works, or at least what it’s for. Now, say you have a table containing the following: <tr id=”123″ class=”employee”> <td class=”name”>John Smit</td> <td><img src=”…” class=”image” /></td> </tr> <tr id=”983″ class=”employee”> <td… Read more »
Booleans between Python and JavaScript
Just a quick note on something I noticed earlier this week. Since we’ve been using a combination of Django and JavaScript for our websites, we’re passing a lot of values around between the two, including booleans. Unexpectedly, something stopped working as soon as I started sending Python booleans to a Django template. The template was… Read more »
Making Openlayers play nice with other elements
I was using Openlayers to chuck a map up onto a page – but I couldn’t get it to allow other elements to render above it. Since I wanted a full-screen map, you could basically see only the map and nothing else. What happens here is that Openlayers uses the z-index CSS property for its… Read more »
Django: serving an image from a remote server
For a current project (using django), I wanted to get a dynamically generated image from a remote map server and return the image to the django view as an object (as opposed to returning a URL as a string). Here’s how it’s done (logic derived from this code snippet): import urllib import urllib2 import mimetypes… Read more »