Cartographic Styling: Anchor Position Variation

When creating a QML for styling Mastermap CartographicText I found an interesting variation on ‘Anchor Position’ definitions between Ordnance Survey and QGIS. The Mastermap dataset contains an attribute for label anchor position, however the way the values are defined is different to QGIS and will affect label positioning. The below attribute mapping should assist label … More Cartographic Styling: Anchor Position Variation

CartoCSS Library

Great CartoCSS documentation shared by nebulon42 on Github Carto documentation The following is a list of properties provided in CartoCSS that you can apply to map elements. All elements image-filters functions agg-stack-blur emboss blur gray sobel edge-detect x-gradient y-gradient invert sharpen color-blind-protanope color-blind-deuteranope color-blind-tritanope colorize-alpha color-to-alpha scale-hsla Default Value: none (no filters.) A list of … More CartoCSS Library

Migrating tables from PostgreSQL to MSSQL Server

OGR2OGR: If your user account has permission you can set the trusted_connection to true and there is no need to add uid and password info. ogr2ogr -f “MSSQLSpatial” “MSSQL:server=servername;database=databasename; “postgresservername user=user dbname=postgresdatabasename password=****” “postgrestablename” If, however, you need to connect using different credentials set the trusted_connection to false and that will force the tool to … More Migrating tables from PostgreSQL to MSSQL Server

How to remove headers when concatenating multiple files

After trying numerous commands and OS for this, I settled upon the most succinct and efficient; The ‘awk’ command (Linux). awk ‘FNR==1 && NR!=1{next;}{print}’ *.csv> ALL.csv FNR is the number of records/lines read of current file NR is the number of records/lines read overall The query therefore, works by saying skip the line if it’s … More How to remove headers when concatenating multiple files

PostgreSQL Session Management

Identifying current connections/queries   SELECT * from pg_stat_activity; To stop a query   SELECT pg_cancel_backend(procpid); To kill the connection   SELECT pg_terminate_backend(procpid);   Tips Run (select * from pg_stat_activity) in pgAdmin to get a clear table structure to identify procpid numbers If the item you have terminated remains in the list  (from select * from … More PostgreSQL Session Management

GDAL/OGR cheat sheet

(A copy of a post by dwtkns on github) The holy grail for GDAL/OGR command-line geodata tools Vector operations Get vector information ogrinfo -so input.shp layer-name Or, for all layers ogrinfo -al -so input.shp Print vector extent ogrinfo input.shp layer-name | grep Extent List vector drivers ogr2ogr –formats Convert between vector formats ogr2ogr -f “GeoJSON” … More GDAL/OGR cheat sheet