From 709be9ef7023802bdebc533e196826a3f2ade12b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 4 Apr 2022 11:11:31 +0100 Subject: [PATCH] separate python step since memory failiure is possible --- etl/README.md | 6 ++++++ etl/load_coordinates.sh | 9 --------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/etl/README.md b/etl/README.md index 88ec1ca1..81acc905 100644 --- a/etl/README.md +++ b/etl/README.md @@ -169,6 +169,12 @@ Install the required python packages. pip install -r requirements.txt ``` +Converting the OS Open TOID data OSGB36 Eastings and Northings to WGS84 longitude and latitude coordinates. + +```bash +python convert_opentoid_bng_latlon.py /path/to/opentoids_dir +``` + Assign latitude and longitude to buildings with the downloaded OS Open TOID data. ```bash diff --git a/etl/load_coordinates.sh b/etl/load_coordinates.sh index b00a8746..d0b6756b 100644 --- a/etl/load_coordinates.sh +++ b/etl/load_coordinates.sh @@ -7,9 +7,6 @@ opentoid_dir=$1 -echo "Converting OSGB36 Eastings and Northings to WGS84 longitude and latitude coordinates..." -python convert_opentoid_bng_latlon.py $opentoid_dir - echo "Creating a temporary table for coordinates..." psql -c "CREATE TABLE open_toid ( toid varchar, @@ -28,14 +25,8 @@ find $opentoid_dir -type f -name '*.csv' \ parallel \ cat {} '|' psql -c "\"COPY open_toid ( toid, version_number, version_date, source_product, easting, northing, longitude, latitute ) FROM stdin WITH CSV HEADER;\"" -# Convert the northing/easting coordinates to latitude/longitute with PostGIS -# psql -c "select AddGeometryColumn( 'public', 'open_toid', 'the_geom', 27700, 'POINT', 2);" -# psql -c "update open_toid set the_geom=GeomFromText('POINT('||easting||' '||northing||')',27700);" -# psql -c "update open_toid set longitude=st_x(st_transform(the_geom,4326)), latitude=st_y(st_transform(the_geom,4326));" - # Update the buildings table with coordinates # psql -c "" - # Delete the temporary table # psql -c "DROP TABLE open_toid;" \ No newline at end of file