Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
isochrone-vm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Institut für Informatik
dbis
dbis-isochrone
isochrone-vm
Commits
f77124f8
Commit
f77124f8
authored
9 years ago
by
User expired
Browse files
Options
Downloads
Patches
Plain Diff
fixed problems with deleting of tables in between srid change
parent
265356da
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
bootstrap/importData.sh
+11
-9
11 additions, 9 deletions
bootstrap/importData.sh
with
12 additions
and
9 deletions
CHANGELOG.md
+
1
−
0
View file @
f77124f8
Upcoming version:
-----------------
-
fixed problems with deleting of tables in between srid change (Nikolaus Krismer)
-
fixed a problem when generating db dumps for multiple srids (Nikolaus Krismer)
-
allowing multiple target_srids now (Nikolaus Krismer)
-
added information about srid 82344 (Nikolaus Krismer)
...
...
This diff is collapsed.
Click to expand it.
bootstrap/importData.sh
+
11
−
9
View file @
f77124f8
...
...
@@ -105,14 +105,14 @@ function fn_import_dataset_postgis() {
cp
$DOWNLOAD_DIR
/
$SQL_EXPORT_FILE
$DATA_DIR
/
$SQL_EXPORT_FILE
>>
/dev/null 2>&1
echo
" - importing SQL export into PostGIS database"
gunzip
-c
$DATA_DIR
/
$SQL_EXPORT_FILE
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-U
"
$PG_DB_USER
"
-h
localhost
"
$PG_DB_NAME
"
>>
"
$WORKING_DIR
/import_datamodel_
$CITY
.log"
2>&1
gunzip
-c
$DATA_DIR
/
$SQL_EXPORT_FILE
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-U
"
$PG_DB_USER
"
-h
localhost
"
$PG_DB_NAME
"
>>
"
$WORKING_DIR
/import_datamodel_
$CITY
_$SRID
.log"
2>&1
echo
" - getting table permissions"
tables
=
`
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tableowner = 'postgres';"
"
$PG_DB_NAME
"
`
echo
" - fixing table permissions"
for
tbl
in
$tables
;
do
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"ALTER TABLE
$tbl
OWNER TO
$PG_DB_USER
"
"
$PG_DB_NAME
"
;
for
tbl
in
$tables
;
do
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-c
"ALTER TABLE
$tbl
OWNER TO
$PG_DB_USER
"
"
$PG_DB_NAME
"
done
fi
...
...
@@ -124,20 +124,22 @@ function fn_import_dataset_postgis() {
if
$AVAILABLE_ISOCHRONE_DATAMODEL
&&
[
!
-f
"
$DATA_DIR
/
$SQL_EXPORT_FILE
"
]
;
then
echo
" - creating datamodel using isochrone-datamodel"
# Create datamodel using isochrone-datamodel project
DB_USERNAME
=
"
$PG_DB_USER
"
DB_PASSWORD
=
"
$PG_DB_PASSWORD
"
"
$DEPLOY_DIR
/isochrone-datamodel/builder.sh"
-d
-s
-b
-l
-t
${
SRID
}
-c
${
CITY
}
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
.log"
2>&1
DB_USERNAME
=
"
$PG_DB_USER
"
DB_PASSWORD
=
"
$PG_DB_PASSWORD
"
"
$DEPLOY_DIR
/isochrone-datamodel/builder.sh"
-d
-s
-b
-l
-t
${
SRID
}
-c
${
CITY
}
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
_$SRID
.log"
2>&1
echo
" - copying tables to isochrone database"
PGPASSWORD
=
"spatial"
pg_dump
-U
spatial
-h
localhost
-p
5432
-d
spatial
--clean
--if-exists
--no-privileges
--no-owner
-t
"transformed.
${
CITY
}
_*"
|
sed
-e
"s/transformed/public/g"
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-h
localhost
-U
"
$PG_DB_USER
"
-p
5432
-d
isochrone
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
.log"
2>&1
# If working with multiple TARGET_SRIDs we have to delete an eventually existing nodes_density table here, so on import later a DROP TABLE ${CITY}_nodes works wihtout CASCADE (pg_dump does not use CASCADE)
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-qAt
-U
"
$PG_DB_USER
"
-h
localhost
-d
isochrone
-c
"DROP TABLE IF EXISTS
${
CITY
}
_nodes_density"
>>
"
$WORKING_DIR
/create_datamodel_
$CITY_$SRID
.log"
2>&1
PGPASSWORD
=
"spatial"
pg_dump
-U
spatial
-h
localhost
-d
spatial
--clean
--if-exists
--no-privileges
--no-owner
-t
"transformed.
${
CITY
}
_*"
|
sed
-e
"s/transformed/public/g"
|
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
psql
-U
"
$PG_DB_USER
"
-h
localhost
-d
isochrone
>>
"
$WORKING_DIR
/create_datamodel_
$CITY_$SRID
.log"
2>&1
fi
if
$AVAILABLE_POSTGIS
&&
$AVAILABLE_ISOCHRONE_TOOLS
;
then
java
-cp
$DOWNLOAD_DIR
/isochrone-tools.jar at.uibk.dbis.isochrone.generator.density.DensityGenerator
-t
"
$CITY
"
-d
60,120,180,240,300
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
.log"
2>&1
java
-cp
$DOWNLOAD_DIR
/isochrone-tools.jar at.uibk.dbis.isochrone.generator.density.DensityGenerator
-t
"
$CITY
"
-d
60,120,180,240,300
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
_$SRID
.log"
2>&1
fi
if
$AVAILABLE_ISOCHRONE_DATAMODEL
;
then
# Exporting resulting database to $DATA_DIR
echo
" - exporting database dump
for
${
CITY
}
"
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
pg_dump
-U
"
$PG_DB_USER
"
-h
localhost
-p
5432
-d
isochrone
--clean
--compress
=
5
--if-exists
-t
"
${
CITY
}
_*"
--file
=
"
$DATA_DIR
/
$SQL_EXPORT_FILE
"
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
.log"
2>&1
echo
" - exporting database dump"
PGPASSWORD
=
"
$PG_DB_PASSWORD
"
pg_dump
-U
"
$PG_DB_USER
"
-h
localhost
-d
isochrone
--clean
--compress
=
5
--if-exists
-t
"
${
CITY
}
_*"
--file
=
"
$DATA_DIR
/
$SQL_EXPORT_FILE
"
>>
"
$WORKING_DIR
/create_datamodel_
$CITY
_$SRID
.log"
2>&1
fi
}
...
...
@@ -198,7 +200,7 @@ function fn_import_spatialite() {
if
$AVAILABLE_GDAL
&&
[
!
-f
"
$DATA_DIR
/
$SPATIALITE_FILENAME
"
]
;
then
echo
"Exporting PostGIS data into spatialite database"
$DEPLOY_DIR
/gdal/apps/ogr2ogr
--config
PG_LIST_ALL_TABLES YES
--config
PG_SKIP_VIEWS YES
-progress
-f
"SQLite"
"
$DATA_DIR
/
$SPATIALITE_FILENAME
"
PG:
"host=localhost dbname=isochrone user=
$PG_DB_USER
password=
$PG_DB_PASSWORD
"
-lco
LAUNDER
=
yes
-dsco
SPATIALITE
=
yes
-lco
SPATIAL_INDEX
=
yes
-gt
65536
>>
"
$WORKING_DIR
/
setup
_spatialite.log"
2>&1
$DEPLOY_DIR
/gdal/apps/ogr2ogr
--config
PG_LIST_ALL_TABLES YES
--config
PG_SKIP_VIEWS YES
-progress
-f
"SQLite"
"
$DATA_DIR
/
$SPATIALITE_FILENAME
"
PG:
"host=localhost dbname=isochrone user=
$PG_DB_USER
password=
$PG_DB_PASSWORD
"
-lco
LAUNDER
=
yes
-dsco
SPATIALITE
=
yes
-lco
SPATIAL_INDEX
=
yes
-gt
65536
>>
"
$WORKING_DIR
/
import
_spatialite.log"
2>&1
fi
if
[
-f
"
$DATA_DIR
/
$SPATIALITE_FILENAME
"
]
;
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment