diff --git a/doc/images/profile.png b/doc/images/profile.png new file mode 100644 index 00000000..78c9d0d8 Binary files /dev/null and b/doc/images/profile.png differ diff --git a/doc/reference_guide.rst b/doc/reference_guide.rst index 2a7cc7dc..bfc0ab0d 100644 --- a/doc/reference_guide.rst +++ b/doc/reference_guide.rst @@ -1176,10 +1176,44 @@ Volume ...... Calculate volume above a reference plain. +The user have to enter the height of the reference plain. The volume is +calculated in the prisms above the reference plain. The result is written into +the *Calculation results* window. + +.. code:: + + 2020.11.02 19:52 - Volume ... - test + Base height Volume Above Below Area Surface area + 100.000 1267409.3 1267409.3 0.0 178543.3 179311.4 + +The *Volume* = *Above* - *Below*. Volume difference ................. +Calculate volume difference between the loaded and another TIN. GRIDs are +generated from both TINs using the same GRID steps. Only the common area of the +two generated GRIDs are considered. + +.. figure:: rg_images/ascii_grid.png + +First the user have to give the grid step (step for north and east axis). +Next in the file selection dialogue a previously saved DTM can be selected. + +.. code:: + + 2020.11.02 19:40 - Volume difference ... testa - testb + Grid step: 50.00 + Lower left corner: 655886.80 222996.11 + Upper right corner: 656417.18 223621.18 + Cut Volume: 32125.1 m3 Area: 125000.0 m2 + Fill Volume: 10376.4 m3 Area: 45000.0 m2 + Same: 10000.0 m2 + +Beside the results in the *Calculation results* window a new difference grid is +generated in the folder of the loaded TIN. This file is an ESRI ASCII GRID +which can be loaded into several sortware among others into QGIS. + VRML/X3D export ............... diff --git a/doc/rg_images/ascii_grid.png b/doc/rg_images/ascii_grid.png new file mode 100644 index 00000000..d95425ef Binary files /dev/null and b/doc/rg_images/ascii_grid.png differ diff --git a/src/sqlgeo.tcl b/src/sqlgeo.tcl new file mode 100644 index 00000000..e7b07eb7 --- /dev/null +++ b/src/sqlgeo.tcl @@ -0,0 +1,47 @@ +# +# Save coordinates to postgis SQL +# @param fa name of geo data set +# @param rn name of data file (.csv) +# @return 0 on success +proc SavePSql {fn rn} { + global ${fn}_coo + global geoLoaded + global geoCodes geoEasyMsg + + if {[info exists geoLoaded]} { + set pos [lsearch -exact $geoLoaded $fn] + if {$pos == -1} { + return -8 ;# geo data set not loaded + } + } else { + return 0 + } + set f [open $rn w] + # get epsg code + set epsg [GeoEntry "$geoCodes(140):" $geoCodes(140)] + # create table + puts $f "CREATE TABLE $fn (" + puts $f " geom geometry(Pointz, $epsg)," + puts $f " psz varchar(20) PRIMARY KEY," + puts $f " code varchar(20)" + puts $f ");" + + foreach pn [lsort -dictionary [array names ${fn}_coo]] { + set x [GetVal {38} [set ${fn}_coo($pn)]] + set y [GetVal {37} [set ${fn}_coo($pn)]] + set z [GetVal {39} [set ${fn}_coo($pn)]] + set code [GetVal {4} [set ${fn}_coo($pn)]] + if {[string length $code]} { + set code "'$code'" + } else { + set code "NULL" + } + if {[string length $x] && [string length $y]} { + if {[string length $z] == 0} { set z 0 } + puts $f "INSERT INTO $fn " + puts $f " VALUES (ST_SetSRID(ST_MakePoint($x,$y,$z), $epsg), '$pn', $code);" + } + } + close $f + return 0 +}