diff --git a/etl/load_coordinates.sh b/etl/load_coordinates.sh index 54fa09b2..dd4bf0e2 100644 --- a/etl/load_coordinates.sh +++ b/etl/load_coordinates.sh @@ -26,6 +26,7 @@ parallel \ cat {} '|' psql -c "\"COPY open_toid ( toid, version_number, version_date, source_product, easting, northing ) 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));"