This repository has been archived by the owner on Sep 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
load_data.bat
75 lines (63 loc) · 4.02 KB
/
load_data.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
@title Load HER Data
@echo off
rem INTERACTIVE VARIABLE SETTING
rem set /p var=hello there!
rem echo %var%
rem GET START TIME
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "start=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
set /p ARCHESDIR="Enter the path to arches: "
set HERPATH=%~dp0
cd %ARCHESDIR%
echo Rebuilding db
python manage.py packages -o setup_db
echo rebuild complete.
echo ~-~-~-~-~-~-~
echo Loading thesauri and collections...
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/arches_liverpool_concepts.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_Additional_Schemes.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_dm_Type.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_HER_Designation_Type.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_HER_Period_Type.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_Monument_Types_v4.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_Recording_Event_Type.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/Lincoln_Source_Type.xml -ow overwrite -st keep
python manage.py packages -o import_reference_data -s %HERPATH%/reference_data/arches_liverpool_collections.xml -ow overwrite -st keep
echo load complete.
echo ~-~-~-~-~-~-~
echo Loading resource models and branches...
python manage.py packages -o import_graphs -s arches/db/graphs/branches
python manage.py packages -o import_graphs -s %HERPATH%/graphs/branches/
python manage.py packages -o import_graphs -s %HERPATH%/graphs/resource_models/
echo load complete.
echo ~-~-~-~-~-~-~
echo Loading map overlays...
python manage.py packages -o add_mapbox_layer -j %HERPATH%/mapbox_styles/Emerald/style.json -n "Emerald" -b
python manage.py packages -o add_mapbox_layer -j %HERPATH%/mapbox_styles/Outdoors/style.json -n "Outdoors" -b
python manage.py packages -o add_mapbox_layer -j %HERPATH%/mapbox_styles/Light/style.json -n "Light Streets" -b
python manage.py packages -o add_mapbox_layer -j %HERPATH%/mapbox_styles/Dark/style.json -n "Dark Streets" -b
python manage.py packages -o add_mapbox_layer -j %HERPATH%/mapbox_styles/Satellite-Streets/style.json -n Satellite_Streets -b
python manage.py packages -o add_tileserver_layer -m %HERPATH%/tilestache/town_plan_3857.xml -n "Lincoln 1886-1998"
python manage.py packages -o add_tileserver_layer -m %ROOTDIR%/arches/tileserver/hillshade.xml -n "Hillshade"
echo load complete.
echo ~-~-~-~-~-~-~
echo Loading business data...
python manage.py packages -o import_business_data -s "%HERPATH%/business_data/HER Activities_master.csv" -c "%HERPATH%/business_data/HER Activities.mapping" -ow overwrite -bulk
python manage.py packages -o import_business_data -s "%HERPATH%/business_data/HER Information Assets.csv" -c "%HERPATH%/business_data/HER Information Assets.mapping" -ow overwrite -bulk
python manage.py packages -o import_business_data -s "%HERPATH%/business_data/HER Monuments Workshop.csv" -c "%HERPATH%/business_data/HER Monuments.mapping" -ow overwrite -bulk
python manage.py packages -o import_business_data -s "%HERPATH%/business_data/HER Actors_master.csv" -c "%HERPATH%/business_data/HER Actors.mapping" -ow overwrite -bulk
echo load complete.
echo ~-~-~-~-~-~-~
rem GET END TIME
for /F "tokens=1-4 delims=:.," %%a in ("%time%") do (
set /A "end=(((%%a*60)+1%%b %% 100)*60+1%%c %% 100)*100+1%%d %% 100"
)
rem GET ELAPSED TIME
set /A elapsed=end-start
rem SHOW ELAPSED TIME
set /A hh=elapsed/(60*60*100), rest=elapsed%%(60*60*100), mm=rest/(60*100), rest%%=60*100, ss=rest/100, cc=rest%%100
if %mm% lss 10 set mm=0%mm%
if %ss% lss 10 set ss=0%ss%
if %cc% lss 10 set cc=0%cc%
echo %hh%:%mm%:%ss%,%cc%