Quantcast
Channel: George MacKerron: code blog » PostGIS
Browsing all 10 articles
Browse latest View live

Importing the National Statistics Postcode Directory into PostGIS

This isn’t a very difficult task, but creating the table is somewhat laborious, so perhaps you’ll find the following SQL helpful. Step 1 The first step is to create an appropriate table, and pull...

View Article



Using OS Code-Point Polygons in PostGIS

Ordnance Survey’s Code-Point with Polygons “provides a precise geographical location for each postcode unit in Great Britain”. It’s available in various formats, including ESRI .shp files. Many UK...

View Article

as_kmldoc: easily visualise PostGIS queries as KML in Google Earth

PostGIS has an st_askml function. This turns geometries into fragments of KML, and thus takes you most of the way to easy visualisation of spatial queries using Google Earth. But not all the way: these...

View Article

Simple PostGIS nearest neighbour function

Here’s a less generic and slightly different nearest-neighbour function based on Regina’s generic nearest-neighbour function at Boston GIS. It follows the same basic idea of using series of enlarging...

View Article

Approximating kernel-weighted proportions in PostGIS

Imagine you want compare various locations in terms of the availability of a certain type of environment, such as fresh water. You might want to use a measure of the proximity of that environment —...

View Article


Polygons from PostGIS to Processing

There are plenty of ways to get spatial data from a PostGIS database into a Processing sketch. You can export to CSV or SVG and load it from there; you can query the database directly; or, depending on...

View Article

How to compile PostGIS 2.1 on Ubuntu Server 12.04+

PostGIS 2 has some exciting new goodies — including raster support — that I’m keen to use in the analysis of Mappiness data. But the PostGIS package provided by Ubuntu 12.04 is still only at version...

View Article

Using the OSTN02 transformation in PostGIS

When converting coordinates between WGS84 (GPS) and OSGB36 (UK National Grid), using OSTN02 can gain us a few metres in accuracy over the basic parametric transformation provided by PostGIS’s...

View Article


Sunrise and sunset times with PostGIS and PL/R

Since light can affect happiness, two important pieces of environmental data I add to the Mappiness data set during analysis are: (1) whether a response was made in daylight; and (2) day length when...

View Article


Map algebra with callbacks in PostGIS 2.1

I’ve been playing with the much-enhanced raster support in PostGIS 2.1 in the last few days. Amongst other things I’ve been producing maps with ST_MapAlgebra, which has changed a little since 2.0. The...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images