From 62b65f44f9407712d31f526d956efd1ec64314f8 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Wed, 30 May 2018 20:18:37 +0100 Subject: [PATCH] Extract OS MasterMap shell --- etl/extract_mastermap.py | 7 ------- etl/extract_mastermap.sh | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 7 deletions(-) delete mode 100644 etl/extract_mastermap.py create mode 100644 etl/extract_mastermap.sh diff --git a/etl/extract_mastermap.py b/etl/extract_mastermap.py deleted file mode 100644 index c9ac70de..00000000 --- a/etl/extract_mastermap.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Extract buildings from *.gml.gz - -Features where:: - descriptiveGroup = '(1:Building)' - -Use `fid` as source ID, aka TOID. -""" diff --git a/etl/extract_mastermap.sh b/etl/extract_mastermap.sh new file mode 100644 index 00000000..f6c06238 --- /dev/null +++ b/etl/extract_mastermap.sh @@ -0,0 +1,20 @@ +# Extract buildings from *.gml.gz +# +# Features where:: +# descriptiveGroup = '(1:Building)' +# +# Use `fid` as source ID, aka TOID. + +: ${1?"Usage: $0 ./path/to/input/dir ./path/to/ouput/dir"} + +: ${2?"Usage: $0 ./path/to/input/dir ./path/to/ouput/dir"} + +find $1 -type f -name '*.gz' -printf "%f\n" | \ +parallel \ +ogr2ogr \ + -select fid \ + -where "\"descriptiveGroup='(1:Building)'\"" \ + -t_srs "EPSG:3857" \ + -f "GeoJSON" $2/{}.geojson \ + $1/{} \ + TopographicArea