Image Optimisation – Comparison Table

Product File Size  No. Files  Uncompressed  Optimised    Optimised+Overviews  Total Storage
OS VML Col 0.3-10MB  562  184MB      2-30MB  3.12GB
OS VML BW 1-3.5MB  562  184MB 0.3-5MB    0.3-5MB  1.05GB
OS VMD Col 0.2 – 2.2MB 80 67.2MB 0.8 – 2.2MB   1-4.5MB  231MB

There are number of things to look at in terms of optimising images for web mapping:

  1. File size and total storage required
  2. Draw performance
  3. Image quality Continue reading Image Optimisation – Comparison Table

Optimising Raster For Web Mapping (on Linux)

OS raster colourThe previous post showed how to process panchromatic and colour TIFF images on Windows to optimise them for web mapping.  Here I’ll show you how to do the same thing using bash scripts on Linux.  This assumes you have GDAL installed (gdal-bin and python-gdal on Ubuntu/Debian/Mint).  Continue reading Optimising Raster For Web Mapping (on Linux)

Optimising Raster For Web Mapping

OS rasterI have been working through an exercise to find alternatives to storing raster data in an expensive proprietary database format. We have a lot of raster data in various formats (ECW, jpg, LZW and Packbits compressed TIFF, uncompressed TIFF, GeoTiff) and of different types (historic black and white mapping, full colour aerial photography, panchromatic (greyscale) aerial photography, full colour base mapping tiles at different resolutions). Continue reading Optimising Raster For Web Mapping

pgRouting on Windows 7

pgrouting-networkDrive time isochrones with pgRouting and PostGIS on Windows 7 Pro.  I am using Postgresql 9.0, 9.1 and 9.2, PostGIS 2.0.3 and pgRouting 1.0.7-dev.  Anita Graser has some excellent pgRouting resources on her blog  and I used them in conjunction with Jo Cook’s pgRouting with ITN guide to load and build my network dataset.

One of the problems I had while following this post was that I had more than the three airports she used in her example and to manually update the table 116 times for each play park in the county was not an option.

So, how to write a looping function in Postgresql to loop through all the play parks and calculate all the drive times for each facility in one go?

Postgresql docs are a good place to go and this is what worked for me in the end.  Once the table is complete finish up using Anita’s how to.

-- 1. create calculate playpark costs function
CREATE OR REPLACE FUNCTION insertPlayParkCosts() RETURNS INTEGER AS $$
-- NOTE: function returns an integer representing the next play park nearest node id
DECLARE
 nn INTEGER;
BEGIN
-- NOTE: loops through every nearest_node, calculating drive times and inserting records into the table
FOR nn IN SELECT nearest_node FROM osplayparks_pts LOOP
 INSERT INTO catchment_pp (
 SELECT
 id,
 the_geom,
 (SELECT sum(cost) FROM (
 SELECT * FROM shortest_path('
 SELECT objectid AS id,
 source::int4 AS source,
 target::int4 AS target,
 traveltime::float8 AS cost
 FROM angus_routes',
 nn, -- this updates each time with a new value for nearest_node
 id,
 false,
 false)) AS foo ) AS cost
 FROM vertices_tmp);
END LOOP;
END;
$$ LANGUAGE 'plpgsql';

-- 2. run calculate playpark cost function
SELECT * FROM insertPlayParkCosts();