Skip to content
Browse files

output specified

  • Loading branch information...
1 parent 58b1789 commit c8b12fdb7cbd3a861c66b63aea08c225dc94af36 @3nids 3nids committed
Showing with 56 additions and 7 deletions.
  1. +56 −7 sql/export/{export2sqlite.sh → export2cartoriviera.sh}
View
63 sql/export/export2sqlite.sh → sql/export/export2cartoriviera.sh
@@ -6,7 +6,7 @@ export ogr2ogrpath=/usr/local/bin/ogr2ogr
export ogr2ogrpath=ogr2ogr
-rm sige_distribution.sqlite
+rm /home/denis/Documents/cartoriviera/sige_distribution.sqlite
# PIPES
@@ -38,7 +38,7 @@ $ogr2ogrpath -sql "SELECT \
_pressure_zone \
_schema_view \
FROM distribution.pipes_view WHERE id_owner = 1" \
- -overwrite -a_srs EPSG:21781 -f SQLite sige_distribution.sqlite \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
-nln pipes -nlt LINESTRING -progress \
PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
-dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
@@ -71,29 +71,78 @@ $ogr2ogrpath -sql "SELECT \
_status_active, \
_pressure_zone \
FROM distribution.pipes_schema WHERE id_owner = 1" \
- -overwrite -a_srs EPSG:21781 -f SQLite sige_distribution.sqlite \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
-nln pipes_schema -nlt LINESTRING -progress \
PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
-dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
# NODES
$ogr2ogrpath -sql "SELECT * FROM distribution.nodes WHERE _status_active IS TRUE" \
- -overwrite -a_srs EPSG:21781 -f SQLite sige_distribution.sqlite \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
-nln nodes -nlt POINT -progress \
PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
-dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
+ # VALVES
+$ogr2ogrpath -sql "SELECT \
+ id , \
+ sige, \
+ id_pipe, \
+ id_node, \
+ diameter_nominal, \
+ year, \
+ closed, \
+ altitude_dtm, \
+ altitude_real, \
+ remarks, \
+ _is_on_map, \
+ _is_on_district, \
+ geometry::geometry(Point,21781), \
+ _function, \
+ _type, \
+ _label \
+ FROM distribution.valves_view" \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
+ -nln valves -nlt POINT -progress \
+ PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
+ -dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
+
+ # VALVES SCHEMA
+$ogr2ogrpath -sql "SELECT \
+ id , \
+ sige, \
+ id_pipe, \
+ id_node, \
+ diameter_nominal, \
+ year, \
+ closed, \
+ altitude_dtm, \
+ altitude_real, \
+ remarks, \
+ _is_on_map, \
+ _is_on_district, \
+ geometry_alternative::geometry(Point,21781),\
+ _function, \
+ _type, \
+ _label \
+FROM distribution.valves_schema" \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
+ -nln valves_schema -nlt POINT -progress \
+ PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
+ -dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
+
# INSTALLATIONS
$ogr2ogrpath -sql "SELECT * FROM distribution.installations_view" \
- -overwrite -a_srs EPSG:21781 -f SQLite sige_distribution.sqlite \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
-nln installations -nlt POINT -progress \
PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
-dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
-
# PRESSURE ZONES
$ogr2ogrpath -sql "SELECT * FROM distribution.pressure_zones" \
- -overwrite -a_srs EPSG:21781 -f SQLite sige_distribution.sqlite \
+ -overwrite -a_srs EPSG:21781 -f SQLite /home/denis/Documents/cartoriviera/sige_distribution.sqlite \
-nln pressure_zones -nlt POLYGON -progress \
PG:"dbname='sige' host='172.24.171.202' port='5432' user='sige' password='db4wat$'" \
-dsco SPATIALITE=no -lco "SPATIAL_INDEX=no FORMAT=SPATIALITE" -gt 65536
+
+

0 comments on commit c8b12fd

Please sign in to comment.
Something went wrong with that request. Please try again.