Skip to content

Instantly share code, notes, and snippets.

@tjmgis
tjmgis / OS VectorMap Local QGIS Text Recipe
Last active December 18, 2015 21:38
OS VectorMap Local QGIS Text Recipe - guide to how to post process OS VectorMap Local so that you can use QGIS data driven styling to create cartographic text styling.
The following is a guide for post processing OS VectorMap Local so that it can be rendered within QGIS.
We need X Y coordinates so we can use the anchor position
ALTER TABLE vml.text ADD COLUMN x_coordinate NUMERIC;
COMMIT;
update vml.text set x_coordinate = ST_X(wkb_geometry);
COMMIT;
ALTER TABLE vml.text ADD COLUMN y_coordinate NUMERIC;
@ncimino
ncimino / zip_content.sh
Created November 19, 2012 18:39
Bash loop through files - show zip contents
rm contents.txt
ls *.zip > filelist
for FILENAME in `cat filelist`
do
unzip -l $FILENAME >> contents.txt
done
rm filelist
@bmcbride
bmcbride / postgis_geojson.php
Created February 26, 2012 05:43
PHP PostGIS to GeoJSON
<?php
/**
* PostGIS to GeoJSON
* Query a PostGIS table or view and return the results in GeoJSON format, suitable for use in OpenLayers, Leaflet, etc.
*
* @param string $geotable The PostGIS layer name *REQUIRED*
* @param string $geomfield The PostGIS geometry field *REQUIRED*
* @param string $srid The SRID of the returned GeoJSON *OPTIONAL (If omitted, EPSG: 4326 will be used)*
* @param string $fields Fields to be returned *OPTIONAL (If omitted, all fields will be returned)* NOTE- Uppercase field names should be wrapped in double quotes
* @param string $parameters SQL WHERE clause parameters *OPTIONAL*