Referring to this before I began: Volumetric Measurements · Issue #53 · OpenDroneMap/WebODM (github.com)
I am using the grass volume calculation code from WEBODM to calculate a polygon drawn over the DSM.
I am providing the input to the grass python script, namely area_file, points_file, and DSM.
area_file.geojson (is the area file somehow supposed to contain some height information?)
{"type": "Feature", "properties": {}, "geometry": {"type": "Polygon", "coordinates": [[[73.31359828017844, 26.222181594890415], [73.31345181478787, 26.222065660491182], [73.31356935634167, 26.221948621838607], [73.31371520633195, 26.22205185876942], [73.31359828017844, 26.222181594890415]]]}}
points_file.geojson
{"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31359828017844, 26.222181594890415]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31345181478787, 26.222065660491182]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31356935634167, 26.221948621838607]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31371520633195, 26.22205185876942]}}, {"type": "Feature", "properties": {}, "geometry": {"type": "Point", "coordinates": [73.31359828017844, 26.222181594890415]}}]}
dsm_file : https://drive.google.com/file/d/1t3BqUht08ubrZs6klZJXKi8eNxhRTj24/view?usp=sharing
While running the grass script, until this step, everything runs fine.
Module("r.mask", vector="region")
It goes into an infinite loop during this step, where it keeps reading areas and writing the raster map.
Output is something like below.
Reading areas...
100%
Writing raster map...
100%
Reading areas...
100%
Writing raster map...
100%
Reading areas...
100%
Writing raster map...
It never stops, and I had to hit CTRL+C to stop it.
This next step output is only achieved if I skip the previous step ie. Module(“r.mask”, vector=“region”)
And the main doubt that I have is in the next step.
# Transfer dsm raster data to vector
Module("v.what.rast", map="polygon_points", raster="dsm", column="height")
Where did this column “height” came into picture, since it was not there in the polygon_points map, generated in the second step (Module(“v.import”, input=opts[“points_file”], output=“polygon_points”, overwrite=True))
this gives a warning about column height being missing and then later says,
Column <height> not found in the table <polygon_points>. Creating...
Reading features from vector map...
Update vector attributes...
100%
v.what.rast complete. 5 records updated.
After this step, it gets stuck, and nothing further happens in the script.
So the lines
Module(
"v.surf.rst",
input="polygon_points",
zcolumn="height",
elevation="dsm_below_pile",
overwrite=True,
)
# Compute difference between dsm and new dsm
Module(
"r.mapcalc",
expression="pile_height_above_dsm=dsm-dsm_below_pile",
overwrite=True,
)
# Set region to polygon area to calculate volume
Module("g.region", vector="polygon_area")
# Volume output from difference
Module("r.volume", input="pile_height_above_dsm", f=True)
remain unexecuted.
Please help me out with this and also let me know if you need more information.