kopia lustrzana https://github.com/OpenDroneMap/ODM
Added --boundary config, boundary module (WIP)
rodzic
4dadb53a49
commit
8791b74b73
|
@ -0,0 +1,22 @@
|
|||
import fiona
|
||||
import os
|
||||
|
||||
def load_boundary(boundary_json, reproject_to_crs=None):
|
||||
if not os.path.isfile(boundary_json):
|
||||
raise IOError("Cannot load boundary file: %s does not exist" % boundary_json)
|
||||
|
||||
with fiona.open(boundary_json, 'r') as src:
|
||||
if len(src) != 1:
|
||||
raise IOError("Boundary file must have a single polygon (found: %s)" % len(src))
|
||||
|
||||
geom = src[0]['geometry']
|
||||
|
||||
if geom['type'] != 'Polygon':
|
||||
raise IOError("Boundary file must have a polygon feature (found: %s)" % geom['type'])
|
||||
|
||||
coords = geom['coordinates']
|
||||
|
||||
if reproject_to_crs is not None:
|
||||
pass
|
||||
|
||||
return coords
|
|
@ -303,6 +303,16 @@ def config(argv=None, parser=None):
|
|||
'Use 0 to disable cropping. '
|
||||
'Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--boundary',
|
||||
default='',
|
||||
metavar='<json>',
|
||||
action=StoreValue,
|
||||
type=path_or_json_string,
|
||||
help='GeoJSON polygon defining the boundary of the reconstruction. '
|
||||
'Can be specified either as path to a GeoJSON file or as a '
|
||||
'JSON string representing the contents of a '
|
||||
'GeoJSON file. Default: %(default)s')
|
||||
|
||||
parser.add_argument('--pc-quality',
|
||||
metavar='<string>',
|
||||
action=StoreValue,
|
||||
|
|
Ładowanie…
Reference in New Issue