Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Remo Grillo authored and Remo Grillo committed Sep 17, 2020
2 parents 07421c5 + bb19d73 commit ba63a16
Show file tree
Hide file tree
Showing 129 changed files with 6,237 additions and 1,636 deletions.
121 changes: 121 additions & 0 deletions pre-processing/builtwork/SS_BLDGS.tsv

Large diffs are not rendered by default.

121 changes: 121 additions & 0 deletions pre-processing/builtwork/SS_BLDGS_ordered.tsv

Large diffs are not rendered by default.

101 changes: 0 additions & 101 deletions pre-processing/builtwork/buildings_ordered.csv

This file was deleted.

10 changes: 6 additions & 4 deletions pre-processing/builtwork/pre_process_builtwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
import re
import json

buildings = 'buildings_ordered.csv'
buildings = 'SS_BLDGS_ordered'
buildings_ext = '.tsv'

# TODO pass the file as arg
dir_path = os.path.dirname(os.path.realpath(__file__))
filename = os.path.join(dir_path, buildings)
filename = os.path.join(dir_path, buildings+buildings_ext)

bw_typologies_filename = os.path.join(dir_path, 'dict', 'bw_typologies.tsv')
bw_uses_filename = os.path.join(dir_path, 'dict', 'bw_uses.tsv')
Expand All @@ -26,10 +27,11 @@
bw_materials = pd.read_csv(bw_materials_filename, sep='\t').reset_index().to_json(orient='records')
bw_islands = pd.read_csv(bw_islands_filename, sep='\t').reset_index().to_json(orient='records')

def order_df():

def order_df(df):
df = df.set_index(key_bw_id)
df = df.sort_index()
df.to_csv(os.path.join(dir_path, buildings), sep='\t')
df.to_csv(os.path.join(dir_path, f'{buildings}_ordered{buildings_ext}'), sep='\t')

def write_file(name, text, ext='xml'):

Expand Down
10 changes: 5 additions & 5 deletions transformation/builtwork/data/SS_BLDG_001.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@
</Typologies>
<Owners>
<Owner pos="1">
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>88</ID_PERSON>
<Start_Owner>1570-01-01</Start_Owner>
<End_Owner>1797-05-11</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
</Owner>
<Owner pos="3">
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
Expand Down
36 changes: 21 additions & 15 deletions transformation/builtwork/data/SS_BLDG_002.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@
<geo>3230839</geo>
</IslandName>
<Start>1770-01-01</Start>
<End>1838-12-31</End>
<Name>Muro di cinta</Name>
<SHP_Lenght>391.336963616612</SHP_Lenght>
<SHP_Area>115.800422355427</SHP_Area>
<SHP_Lenght>157.25361874524376</SHP_Lenght>
<SHP_Area>46.82680031641558</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
<Function pos="1">
<Function>Public</Function>
<Start_Function>1770-01-01</Start_Function>
<Start_Function>1777-01-01</Start_Function>
<End_Function>1849-12-31</End_Function>
</Function>
<Function pos="2">
<Function>Public</Function>
<Start_Function>1777-01-01</Start_Function>
<End_Function>1849-12-31</End_Function>
<Start_Function>1770-01-01</Start_Function>
</Function>
</Functions>
<Uses>
Expand All @@ -32,7 +33,7 @@
<ita>Militare</ita>
<aat>300120590</aat>
<Start_Use>1770-01-01</Start_Use>
<End_Use>1960-12-31</End_Use>
<End_Use>1849-12-31</End_Use>
</Use>
<Use pos="2">
<eng>Abandoned</eng>
Expand All @@ -45,7 +46,7 @@
<ita>Militare</ita>
<aat>300120590</aat>
<Start_Use>1770-01-01</Start_Use>
<End_Use>1849-12-31</End_Use>
<End_Use>1960-12-31</End_Use>
</Use>
</Uses>
<Typologies>
Expand All @@ -54,25 +55,30 @@
<ita>Muro di cinta</ita>
<aat>300100558</aat>
<Start_Typology>1770-01-01</Start_Typology>
<End_Typology>1849-12-31</End_Typology>
</Typology>
<Typology pos="2">
<eng>Walls</eng>
<ita>Muro di cinta</ita>
<aat>300100558</aat>
<Start_Typology>1770-01-01</Start_Typology>
<End_Typology>1849-12-31</End_Typology>
</Typology>
</Typologies>
<Owners>
<Owner pos="1">
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>88</ID_PERSON>
<Start_Owner>1770-01-01</Start_Owner>
<End_Owner>1797-05-11</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
</Owner>
<Owner pos="3">
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
</Owners>
<Tenants>
<Tenant pos="1">
Expand All @@ -83,7 +89,7 @@
</Tenants>
<Patrons>
<Patron>
<ID_PERSON>89</ID_PERSON>
<ID_PERSON>42</ID_PERSON>
</Patron>
</Patrons>
</row>
17 changes: 12 additions & 5 deletions transformation/builtwork/data/SS_BLDG_003.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
</IslandName>
<Start>1852-01-01</Start>
<Name>Batteria</Name>
<SHP_Lenght>130.339791238175</SHP_Lenght>
<SHP_Area>724.128496009133</SHP_Area>
<SHP_Lenght>130.33979123817488</SHP_Lenght>
<SHP_Area>724.1284960091327</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Stone</eng>
</Material>
<Material>
<eng>Stone</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
Expand Down Expand Up @@ -54,10 +56,15 @@
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
6 changes: 4 additions & 2 deletions transformation/builtwork/data/SS_BLDG_004.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
<SHP_Area>66.41253136789851</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
Expand Down Expand Up @@ -49,7 +51,7 @@
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
15 changes: 11 additions & 4 deletions transformation/builtwork/data/SS_BLDG_005.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<Start>1852-01-01</Start>
<End>1981-12-31</End>
<Name>Deposito</Name>
<SHP_Lenght>22.5752803200677</SHP_Lenght>
<SHP_Area>27.4489846516082</SHP_Area>
<SHP_Lenght>22.57528032006772</SHP_Lenght>
<SHP_Area>27.44898465160817</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
Expand Down Expand Up @@ -46,10 +48,15 @@
<Start_Owner>1866-10-21</Start_Owner>
<End_Owner>1981-12-31</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
15 changes: 11 additions & 4 deletions transformation/builtwork/data/SS_BLDG_006.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
<Start>1852-01-01</Start>
<End>1981-12-31</End>
<Name>Deposito</Name>
<SHP_Lenght>20.1367022778399</SHP_Lenght>
<SHP_Area>23.250806401543898</SHP_Area>
<SHP_Lenght>20.136702277839905</SHP_Lenght>
<SHP_Area>23.250806401543866</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
Expand Down Expand Up @@ -46,10 +48,15 @@
<Start_Owner>1866-10-21</Start_Owner>
<End_Owner>1981-12-31</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
11 changes: 9 additions & 2 deletions transformation/builtwork/data/SS_BLDG_007.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
<SHP_Area>24.2528865808452</SHP_Area>
<Materials>
<Material>
<eng>Brick</eng>
<eng>Bricks</eng>
<ita>Mattone</ita>
<aat>300010463</aat>
</Material>
</Materials>
<Functions>
Expand Down Expand Up @@ -42,14 +44,19 @@
</Typologies>
<Owners>
<Owner pos="1">
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>86</ID_PERSON>
<Start_Owner>1866-10-21</Start_Owner>
<End_Owner>1981-12-31</End_Owner>
</Owner>
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
20 changes: 10 additions & 10 deletions transformation/builtwork/data/SS_BLDG_008.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<Start>1563-01-01</Start>
<End>1851-12-31</End>
<Name>Vera da pozzo</Name>
<Height>1.0</Height>
<SHP_Lenght>4.28726950969252</SHP_Lenght>
<SHP_Area>1.1442008566746598</SHP_Area>
<Height>1</Height>
<SHP_Lenght>4.287269509692525</SHP_Lenght>
<SHP_Area>1.144200856674664</SHP_Area>
<Materials>
<Material>
<eng>Istrian marble</eng>
Expand All @@ -22,18 +22,18 @@
<Function pos="1">
<Function>Private</Function>
<Start_Function>1563-01-01</Start_Function>
<End_Function>1806-7-27</End_Function>
<End_Function>1806-07-27</End_Function>
</Function>
<Function pos="2">
<Function>Private</Function>
<Start_Function>1563-01-01</Start_Function>
<End_Function>1806-7-27</End_Function>
</Function>
<Function pos="3">
<Function>Public</Function>
<Start_Function>1806-07-28</Start_Function>
<End_Function>1851-12-31</End_Function>
</Function>
<Function pos="3">
<Function>Private</Function>
<Start_Function>1563-01-01</Start_Function>
<End_Function>1806-07-27</End_Function>
</Function>
</Functions>
<Uses>
<Use pos="1">
Expand All @@ -60,7 +60,7 @@
<End_Owner>1806-07-27</End_Owner>
</Owner>
<Owner pos="2">
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
Expand Down
6 changes: 3 additions & 3 deletions transformation/builtwork/data/SS_BLDG_009.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Start>1848-01-01</Start>
<End>1851-12-31</End>
<Name>Vera da pozzo</Name>
<SHP_Lenght>5.07929236783034</SHP_Lenght>
<SHP_Lenght>5.079292367830339</SHP_Lenght>
<SHP_Area>1.6122491910238002</SHP_Area>
<Materials>
<Material>
Expand Down Expand Up @@ -44,14 +44,14 @@
</Typologies>
<Owners>
<Owner pos="1">
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
<Start_Owner>1814-04-20</Start_Owner>
<End_Owner>1866-10-20</End_Owner>
</Owner>
</Owners>
<Patrons>
<Patron>
<ID_PERSON>203</ID_PERSON>
<ID_PERSON>123</ID_PERSON>
</Patron>
</Patrons>
</row>
Loading

0 comments on commit ba63a16

Please sign in to comment.