Download OpenStreetMap cycle routes for United Kingdom in Garmin *.img format:
http://www.mapomatic.net/garmin-maps-download/ (the main page)
http://downloads.mapomatic.net/free/UK-Garmin-Cycle.img.zip (gmapsupp.img file)
http://thunderflames.org/garmin/ (specific tiles)
Friday, 3 July 2009
Wednesday, 1 July 2009
How to union tables in PostgreSQL
This query unions two tables which contain the same columns thus works as table aggregate:
This query, however, will union tables where column structure not necessarily match:
More then two tables can be united similarly.
CREATE TABLE total_stats AS
SELECT order_nr
, transaction_date
, price_usd FROM january_stats
UNION
SELECT order_nr
, transaction_date
, price_usd FROM february_stats;This query, however, will union tables where column structure not necessarily match:
CREATE TABLE total_stats AS
SELECT order_nr
, customer_id
, transaction_date
, price_usd FROM january_stats
UNION
SELECT order_nr
, (SELECT 'unknown' AS customer_id)
, transaction_date
, fare_usd AS price_usd FROM february_stats;More then two tables can be united similarly.
Tuesday, 30 June 2009
Convert MULTIPOLYGON to POLYGON in PostGIS
One way how to convert features from MULTIPOLYGON to POLYGON type in PostGIS. This approach can be used when geometries certainly are simple polygons and not multi-polygons.
UPDATE mytable SET the_geom = st_polygonfromtext(st_astext(the_geom)) WHERE st_astext(the_geom) NOT LIKE 'POLYGON%';
Subscribe to:
Posts (Atom)