|
@@ -11,14 +11,14 @@ Siin on sinu OSM andmete importimise skript PostGIS andmebaasi **korralikult vor
|
|
|
destination_host='localhost'
|
|
destination_host='localhost'
|
|
|
destination_port='5432'
|
|
destination_port='5432'
|
|
|
destination_user='osm'
|
|
destination_user='osm'
|
|
|
-destination_password='osm'
|
|
|
|
|
|
|
+destination_password=${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}
|
|
|
destination_dbname='data'
|
|
destination_dbname='data'
|
|
|
destination_schema='aaa_osm'
|
|
destination_schema='aaa_osm'
|
|
|
destination_SRS='EPSG:3301'
|
|
destination_SRS='EPSG:3301'
|
|
|
|
|
|
|
|
# PostgreSQL ühenduse string
|
|
# PostgreSQL ühenduse string
|
|
|
-destination="host='${destination_host}' port='${destination_port}' dbname='${destination_dbname}' user='${destination_user}' password='${destination_password}'"
|
|
|
|
|
-export PGPASSWORD=${destination_password}
|
|
|
|
|
|
|
+destination="host='${destination_host}' port='${destination_port}' dbname='${destination_dbname}' user='${destination_user}' password='${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}'"
|
|
|
|
|
+export PGPASSWORD=${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}
|
|
|
CONNECTION_NAME="-h ${destination_host} -p ${destination_port} -d ${destination_dbname} -U ${destination_user}"
|
|
CONNECTION_NAME="-h ${destination_host} -p ${destination_port} -d ${destination_dbname} -U ${destination_user}"
|
|
|
```
|
|
```
|
|
|
|
|
|
|
@@ -158,7 +158,7 @@ psql ${CONNECTION_NAME} -c "DROP TABLE IF EXISTS ${SCHEMA}.${TABLE_NAME};"
|
|
|
# Impordi GPKG PostGIS andmebaasi, teisendades koordinaadid EPSG:3301
|
|
# Impordi GPKG PostGIS andmebaasi, teisendades koordinaadid EPSG:3301
|
|
|
ogr2ogr \
|
|
ogr2ogr \
|
|
|
--config PG_USE_COPY YES \
|
|
--config PG_USE_COPY YES \
|
|
|
- -f PostgreSQL PG:"dbname='${destination_dbname}' host='${destination_host}' port='${destination_port}' user='${destination_user}' password='${destination_password}' sslmode=disable active_schema=${SCHEMA}" \
|
|
|
|
|
|
|
+ -f PostgreSQL PG:"dbname='${destination_dbname}' host='${destination_host}' port='${destination_port}' user='${destination_user}' password='${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}' sslmode=disable active_schema=${SCHEMA}" \
|
|
|
-nln ${TABLE_NAME} \
|
|
-nln ${TABLE_NAME} \
|
|
|
-s_srs EPSG:4326 \
|
|
-s_srs EPSG:4326 \
|
|
|
-t_srs EPSG:3301 \
|
|
-t_srs EPSG:3301 \
|
|
@@ -189,12 +189,12 @@ https://geoportaal.maaamet.ee/wfs/katastriuksused
|
|
|
destination_host='localhost'
|
|
destination_host='localhost'
|
|
|
destination_port='5432'
|
|
destination_port='5432'
|
|
|
destination_user='osm'
|
|
destination_user='osm'
|
|
|
-destination_password='osm'
|
|
|
|
|
|
|
+destination_password=${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}
|
|
|
destination_dbname='data'
|
|
destination_dbname='data'
|
|
|
destination_schema='aaa_osm'
|
|
destination_schema='aaa_osm'
|
|
|
table_name='katastriuksused'
|
|
table_name='katastriuksused'
|
|
|
|
|
|
|
|
-export PGPASSWORD=${destination_password}
|
|
|
|
|
|
|
+export PGPASSWORD=${PGPASSWORD:-<vaata ~/.config/osm/env.sh>}
|
|
|
CONNECTION_NAME="-h ${destination_host} -p ${destination_port} -d ${destination_dbname} -U ${destination_user}"
|
|
CONNECTION_NAME="-h ${destination_host} -p ${destination_port} -d ${destination_dbname} -U ${destination_user}"
|
|
|
|
|
|
|
|
# WFS teenuse URL
|
|
# WFS teenuse URL
|
|
@@ -206,7 +206,7 @@ psql ${CONNECTION_NAME} -c "DROP TABLE IF EXISTS ${destination_schema}.${table_n
|
|
|
# Impordime katastriüksused PostGIS andmebaasi
|
|
# Impordime katastriüksused PostGIS andmebaasi
|
|
|
ogr2ogr \
|
|
ogr2ogr \
|
|
|
--config PG_USE_COPY YES \
|
|
--config PG_USE_COPY YES \
|
|
|
- -f "PostgreSQL" PG:"host=${destination_host} dbname=${destination_dbname} user=${destination_user} password=${destination_password} active_schema=${destination_schema}" \
|
|
|
|
|
|
|
+ -f "PostgreSQL" PG:"host=${destination_host} dbname=${destination_dbname} user=${destination_user} password=${PGPASSWORD:-<vaata ~/.config/osm/env.sh>} active_schema=${destination_schema}" \
|
|
|
"${wfs_url}" \
|
|
"${wfs_url}" \
|
|
|
-nln ${table_name} \
|
|
-nln ${table_name} \
|
|
|
-t_srs EPSG:3301
|
|
-t_srs EPSG:3301
|