Skip to content

Commit

Permalink
volume and volume difference added to ref-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
zsiki committed Nov 2, 2020
1 parent bdd2109 commit bdd0d20
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
Binary file added doc/images/profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions doc/reference_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
...............

Expand Down
Binary file added doc/rg_images/ascii_grid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/sqlgeo.tcl
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit bdd0d20

Please sign in to comment.