kopia lustrzana https://github.com/OpenDroneMap/ODM
rodzic
6bba0223b6
commit
ed9d703e3f
|
@ -23,7 +23,7 @@ i.cutlinesmod.py --overwrite input=ortho output=cutline number_lines=${number_li
|
|||
v.select ainput=cutline binput=crop_area output=result operator=within
|
||||
|
||||
# Export
|
||||
v.out.ogr input=result output="result.gpkg" format=GPKG
|
||||
v.out.ogr input=result output="result.gpkg" format=GPKG --overwrite
|
||||
|
||||
# Merge all geometries, select only the largest one (remove islands)
|
||||
ogr2ogr -f GPKG -overwrite -explodecollections -dialect SQLite -sql "SELECT ST_Union(geom) FROM result ORDER BY ST_AREA(geom) DESC LIMIT 1" cutline.gpkg result.gpkg
|
||||
|
|
|
@ -6,6 +6,7 @@ import sys
|
|||
import time
|
||||
from opendm import log
|
||||
from opendm import system
|
||||
import locale
|
||||
|
||||
from string import Template
|
||||
|
||||
|
@ -94,7 +95,8 @@ class GrassContext:
|
|||
log.ODM_INFO("Executing grass script from {}: {} --tmp-location {} --exec bash script.sh".format(self.get_cwd(), self.grass_binary, self.location))
|
||||
env = os.environ.copy()
|
||||
env["GRASS_ADDON_PATH"] = env.get("GRASS_ADDON_PATH", "") + os.path.abspath(os.path.join("opendm/grass/addons"))
|
||||
|
||||
env["LC_ALL"] = locale.getdefaultlocale()[1] or "C.UTF-8"
|
||||
|
||||
filename = os.path.join(self.get_cwd(), 'output.log')
|
||||
with open(filename, 'wb') as writer, open(filename, 'rb', 1) as reader:
|
||||
p = subprocess.Popen([self.grass_binary, '--tmp-location', self.location, '--exec', 'bash', 'script.sh'],
|
||||
|
|
Ładowanie…
Reference in New Issue