Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions task/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM ubuntu:20.04
FROM python:3.9-slim-bookworm

RUN apt-get update \
&& apt-get install -y curl sqlite python3-pip unzip git \
&& apt-get install -y curl sqlite3 unzip git \
&& apt-get clean

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" \
Expand All @@ -12,7 +12,7 @@ ADD . /src
WORKDIR /src

RUN python3 --version
RUN pip install --user -U pip
RUN pip install --user --no-cache-dir -r requirements.txt
RUN pip install --upgrade pip setuptools wheel
RUN pip install --no-cache-dir -r requirements.txt

ENTRYPOINT [ "./load.sh" ]
3 changes: 2 additions & 1 deletion task/sql/export_entity.sql
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ SELECT
nullif(e.typology, "") as typology,
nullif(e.geojson, "") as geojson,
nullif(e.geometry, "") as geometry,
nullif(e.point, "") as point
nullif(e.point, "") as point,
nullif(e.quality, "") as quality
FROM entity e;

.output exported_old_entity.csv
Expand Down
8 changes: 5 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def create_db(postgresql_conn):
typology varchar,
geojson varchar,
geometry geometry null,
point varchar
point varchar,
quality varchar null
)"""
)
cursor.execute(
Expand Down Expand Up @@ -199,8 +200,9 @@ def create_db(postgresql_conn):
typology,
geojson,
geometry,
point
) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
point,
quality
) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)
""",
row,
)
Expand Down
14 changes: 7 additions & 7 deletions tests/test_data/exported_entity.csv
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
entity|name|entry_date|start_date|end_date|dataset|json|organisation_entity|prefix|reference|typology|geojson|geometry|point
6100001|"Sunray Estate"|2022-04-25|1987-05-15||article-4-direction|"{""document-url"": ""https://www.southwark.gov.uk/assets/attach/6469/Sunray-Estate-Article-4-Direction.pdf"", ""documentation-url"": ""https://www.southwark.gov.uk/planning-and-building-control/planning-policy-and-transport-policy/article-4-directions?chapter=2""}"|329|article-4-direction_329|2|legal-instrument||POLYGON ((20 180, 180 180, 180 20, 20 20, 20 180))|
6100002|"Houses in multiple occupation, Henshaw Street, SE17"|2022-04-25|2014-10-17||article-4-direction|"{""document-url"": ""https://www.southwark.gov.uk/assets/attach/5219/1.5.3-Article-4-Direction-Henshaw_Street_Oct_2014.pdf"", ""documentation-url"": ""https://www.southwark.gov.uk/planning-and-building-control/planning-policy-and-transport-policy/article-4-directions?chapter=3""}"|329|article-4-direction_329|3.1|legal-instrument||POLYGON ((20 180, 180 180, 180 20, 20 20, 20 180))|
110000000|"Abbotswood Shaw"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481207|geography||"MULTIPOLYGON (((0.145139 50.986737,0.145088 50.986778,0.145140 50.986847,0.145396 50.986967,0.145637 50.987098,0.146008 50.987359,0.146495 50.987534,0.147003 50.987879,0.146999 50.987890,0.146832 50.987820,0.146750 50.987863,0.146429 50.987730,0.146216 50.987625,0.145928 50.987469,0.145798 50.987427,0.145756 50.987446,0.145731 50.987486,0.145754 50.987549,0.145829 50.987668,0.145894 50.987742,0.145830 50.987779,0.145781 50.987713,0.145405 50.987400,0.145226 50.987192,0.145165 50.987150,0.145051 50.987095,0.144917 50.986997,0.144707 50.986893,0.144581 50.986844,0.143894 50.986670,0.144057 50.986489,0.144149 50.986526,0.144366 50.986527,0.144423 50.986537,0.144470 50.986560,0.144500 50.986596,0.144627 50.986643,0.144730 50.986668,0.145139 50.986737)))"|"POINT(0.145360 50.987142)"
110000001|"Admirals Bridge 1"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481499|geography||"MULTIPOLYGON (((-0.020693 51.091892,-0.021234 51.092181,-0.021317 51.092258,-0.021449 51.092203,-0.021656 51.092097,-0.021584 51.092054,-0.021532 51.092035,-0.021395 51.091992,-0.021287 51.091974,-0.021233 51.091956,-0.021178 51.091923,-0.021112 51.091846,-0.021072 51.091690,-0.021078 51.091621,-0.021067 51.091618,-0.021078 51.091570,-0.021094 51.091564,-0.021118 51.091525,-0.021142 51.091509,-0.021149 51.091512,-0.021197 51.091487,-0.021276 51.091464,-0.021169 51.091369,-0.021033 51.091278,-0.020865 51.091198,-0.020750 51.091157,-0.020527 51.091109,-0.020415 51.091077,-0.020341 51.091104,-0.020373 51.091157,-0.020374 51.091223,-0.020485 51.091368,-0.020482 51.091448,-0.020497 51.091481,-0.020446 51.091510,-0.020140 51.091586,-0.020162 51.091605,-0.020693 51.091892)))"|"POINT(-0.020846 51.091637)"
110000002|"Admirals Bridge 2"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1482431|geography||"MULTIPOLYGON (((-0.018025 51.091864,-0.018170 51.091867,-0.018564 51.091846,-0.018840 51.091843,-0.019012 51.091793,-0.019332 51.091659,-0.019401 51.091645,-0.019498 51.091639,-0.019447 51.091542,-0.019390 51.091475,-0.019266 51.091597,-0.019234 51.091612,-0.018935 51.091615,-0.018523 51.091589,-0.017717 51.091476,-0.016919 51.091389,-0.016822 51.091411,-0.016722 51.091454,-0.016682 51.091481,-0.016579 51.091589,-0.016572 51.091631,-0.016582 51.091682,-0.017018 51.091769,-0.017130 51.091786,-0.018025 51.091864)))"|"POINT(-0.017847 51.091653)"
110000003|"Admirals Bridge 3"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481498|geography||"MULTIPOLYGON (((-0.018343 51.093539,-0.018337 51.093549,-0.018194 51.093608,-0.017935 51.093663,-0.017797 51.093748,-0.017627 51.093798,-0.017818 51.093830,-0.018035 51.093834,-0.018303 51.093769,-0.019004 51.093577,-0.019077 51.093564,-0.019445 51.093524,-0.019938 51.093515,-0.020068 51.093502,-0.020478 51.093442,-0.020921 51.093345,-0.020884 51.093234,-0.020851 51.093238,-0.020827 51.093197,-0.020784 51.093073,-0.020744 51.092996,-0.020630 51.092844,-0.020513 51.092605,-0.020174 51.092693,-0.019971 51.092764,-0.019659 51.092922,-0.019511 51.092978,-0.019120 51.093161,-0.018453 51.093449,-0.018488 51.093489,-0.018343 51.093539)))"|"POINT(-0.019664 51.093252)"
entity|name|entry_date|start_date|end_date|dataset|json|organisation_entity|prefix|reference|typology|geojson|geometry|point|quality
6100001|"Sunray Estate"|2022-04-25|1987-05-15||article-4-direction|"{""document-url"": ""https://www.southwark.gov.uk/assets/attach/6469/Sunray-Estate-Article-4-Direction.pdf"", ""documentation-url"": ""https://www.southwark.gov.uk/planning-and-building-control/planning-policy-and-transport-policy/article-4-directions?chapter=2""}"|329|article-4-direction_329|2|legal-instrument||POLYGON ((20 180, 180 180, 180 20, 20 20, 20 180))||some
6100002|"Houses in multiple occupation, Henshaw Street, SE17"|2022-04-25|2014-10-17||article-4-direction|"{""document-url"": ""https://www.southwark.gov.uk/assets/attach/5219/1.5.3-Article-4-Direction-Henshaw_Street_Oct_2014.pdf"", ""documentation-url"": ""https://www.southwark.gov.uk/planning-and-building-control/planning-policy-and-transport-policy/article-4-directions?chapter=3""}"|329|article-4-direction_329|3.1|legal-instrument||POLYGON ((20 180, 180 180, 180 20, 20 20, 20 180))||some
110000000|"Abbotswood Shaw"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481207|geography||"MULTIPOLYGON (((0.145139 50.986737,0.145088 50.986778,0.145140 50.986847,0.145396 50.986967,0.145637 50.987098,0.146008 50.987359,0.146495 50.987534,0.147003 50.987879,0.146999 50.987890,0.146832 50.987820,0.146750 50.987863,0.146429 50.987730,0.146216 50.987625,0.145928 50.987469,0.145798 50.987427,0.145756 50.987446,0.145731 50.987486,0.145754 50.987549,0.145829 50.987668,0.145894 50.987742,0.145830 50.987779,0.145781 50.987713,0.145405 50.987400,0.145226 50.987192,0.145165 50.987150,0.145051 50.987095,0.144917 50.986997,0.144707 50.986893,0.144581 50.986844,0.143894 50.986670,0.144057 50.986489,0.144149 50.986526,0.144366 50.986527,0.144423 50.986537,0.144470 50.986560,0.144500 50.986596,0.144627 50.986643,0.144730 50.986668,0.145139 50.986737)))"|"POINT(0.145360 50.987142)"|some
110000001|"Admirals Bridge 1"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481499|geography||"MULTIPOLYGON (((-0.020693 51.091892,-0.021234 51.092181,-0.021317 51.092258,-0.021449 51.092203,-0.021656 51.092097,-0.021584 51.092054,-0.021532 51.092035,-0.021395 51.091992,-0.021287 51.091974,-0.021233 51.091956,-0.021178 51.091923,-0.021112 51.091846,-0.021072 51.091690,-0.021078 51.091621,-0.021067 51.091618,-0.021078 51.091570,-0.021094 51.091564,-0.021118 51.091525,-0.021142 51.091509,-0.021149 51.091512,-0.021197 51.091487,-0.021276 51.091464,-0.021169 51.091369,-0.021033 51.091278,-0.020865 51.091198,-0.020750 51.091157,-0.020527 51.091109,-0.020415 51.091077,-0.020341 51.091104,-0.020373 51.091157,-0.020374 51.091223,-0.020485 51.091368,-0.020482 51.091448,-0.020497 51.091481,-0.020446 51.091510,-0.020140 51.091586,-0.020162 51.091605,-0.020693 51.091892)))"|"POINT(-0.020846 51.091637)"|some
110000002|"Admirals Bridge 2"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1482431|geography||"MULTIPOLYGON (((-0.018025 51.091864,-0.018170 51.091867,-0.018564 51.091846,-0.018840 51.091843,-0.019012 51.091793,-0.019332 51.091659,-0.019401 51.091645,-0.019498 51.091639,-0.019447 51.091542,-0.019390 51.091475,-0.019266 51.091597,-0.019234 51.091612,-0.018935 51.091615,-0.018523 51.091589,-0.017717 51.091476,-0.016919 51.091389,-0.016822 51.091411,-0.016722 51.091454,-0.016682 51.091481,-0.016579 51.091589,-0.016572 51.091631,-0.016582 51.091682,-0.017018 51.091769,-0.017130 51.091786,-0.018025 51.091864)))"|"POINT(-0.017847 51.091653)"|some
110000003|"Admirals Bridge 3"|2023-03-26|||ancient-woodland|"{""ancient-woodland-status"": ""ASNW""}"|501910|ancient-woodland|1481498|geography||"MULTIPOLYGON (((-0.018343 51.093539,-0.018337 51.093549,-0.018194 51.093608,-0.017935 51.093663,-0.017797 51.093748,-0.017627 51.093798,-0.017818 51.093830,-0.018035 51.093834,-0.018303 51.093769,-0.019004 51.093577,-0.019077 51.093564,-0.019445 51.093524,-0.019938 51.093515,-0.020068 51.093502,-0.020478 51.093442,-0.020921 51.093345,-0.020884 51.093234,-0.020851 51.093238,-0.020827 51.093197,-0.020784 51.093073,-0.020744 51.092996,-0.020630 51.092844,-0.020513 51.092605,-0.020174 51.092693,-0.019971 51.092764,-0.019659 51.092922,-0.019511 51.092978,-0.019120 51.093161,-0.018453 51.093449,-0.018488 51.093489,-0.018343 51.093539)))"|"POINT(-0.019664 51.093252)"|some
Loading