Python script preCutting
See also
python.packages.preCutting

Aim of module

Cuts an ODM/Raster file using one or more polygons of a shape file.

General description

See also
Python script preCutting

Parameter description

Polygon Shape file Options
Settings concerning the polygons to cut out.
-shapeFile Shape file containing the polygons used as cutting limits.
Type : PathArgument
Remark : mandatory
Description:
-attribute Name of the Shape file attribute that will be part of the export filename. (default: id)
Type : String
Remark : optional, default: 'id'
Description:
-pick Choice of the target polygon(s) if not all polygon(s) shall be cut.
Type : String
Remark : optional
Description:
-buffer Buffering distance around the polygon in meters. (default: 0)
Type : Floating-point number
Remark : optional, default: 0
Description:
Input data Options
Settings concerning type an location of the input data.
-vector Path(s) to the vector file(s)
Type : PathArgument
Remark : optional
Description: Path where the vector files to cut are located [mandatory if no rasterpath is specified]. At the moment only ODM files are supported. For example -vector U:\Tiles\*.tif -vector U:\OtherTiles\ -vector U:\Folder\poly*.tif
-raster Path(s) to the raster file(s)
Type : PathArgument
Remark : optional
Description: Path where the raster files to cut are located [mandatory if no vectorpath is specified]. For example -raster U:\Tiles\*.tif -raster U:\OtherTiles\ -raster U:\Folder\poly*.tif
Raster cutting Options
Settings concerning the processing of raster data.
-truePolygons Use true polygon or rectangular bounding box (default: Boolean(False))
Type : Boolean
Remark : optional, default: Boolean(False)
Description: By default, only the polygon bounding box of rasters is cut out. With this option, it is possible to cut out the true polygon shape. Since the process is more time consuming, it should only be chosen for non-rectangular polygons.
Possible values:
11
00
truetrue
falsefalse
yesyes
nono
Boolean(True)Boolean(True)
Boolean(False)Boolean(False)
TrueTrue
FalseFalse
-formula Formula for the combination of overlapping raster files in opalsAlgebra. (default: mean(r))
Type : String
Remark : optional, default: 'mean(r)'
Description:
-resamplingMethod OpalsGrid resampling method [bilinear | bicubic | nearestNeighbour] (default: bilinear)
Type : String
Remark : optional, default: 'bilinear'
Description:
-roundingMethod Method to round the results to exakt pixel positions [corner | center] (default: corner)
Type : String
Remark : optional, default: 'corner'
Description:
Exporting Options
Settings concerning type and location of the resulting files.
-export [path]\[prefix of filename].[extension]
Type : String
Remark : optional
Description: Define the [path]\[prefix of filename].[extension] - any of the three may be left out. For example: -export U:\results\polygons\cut\myPrefix.jpg
-oformat GDAL driver for raster, file format or XML file for Vector.
Type : String
Remark : optional
Description:
-skipIfExists Skip processing if result already exists. (default: Boolean(True))
Type : Boolean
Remark : optional, default: Boolean(True)
Description:
Possible values:
11
00
truetrue
falsefalse
yesyes
nono
Boolean(True)Boolean(True)
Boolean(False)Boolean(False)
TrueTrue
FalseFalse
-writeEmptyTiles if True also empty tile files are created (default: Boolean(False))
Type : Boolean
Remark : optional, default: Boolean(False)
Description:
Possible values:
11
00
truetrue
falsefalse
yesyes
nono
Boolean(True)Boolean(True)
Boolean(False)Boolean(False)
TrueTrue
FalseFalse
-odmTileSize Optional odm tiles size when exporting odm files. If not set, the automatic odm tile size estimation is used
Type : Floating-point number
Remark : optional
Description:
-singleFilePerTile One input file per output tile (default: Boolean(False))
Type : Boolean
Remark : optional, default: Boolean(False)
Description: If set to True only one input file is used for creating the output tile (based on the shortest distance between center points of the input files)
Possible values:
11
00
truetrue
falsefalse
yesyes
nono
Boolean(True)Boolean(True)
Boolean(False)Boolean(False)
TrueTrue
FalseFalse
-nbThreads set the number of processes for parallel processing (default: 1)
Type : Integer
Remark : optional, default: 1
Description: Sets the number of processes that work parallel to cut the tiles.The maximum number of processes that can work parallel is limited by the CPUSetting this Value to 0 will use the maximum.
-generateOverviews if True, overview matrices for a stricter overlap test are generated. (default: Boolean(True))
Type : Boolean
Remark : optional, default: Boolean(True)
Description: Controls, whether or not opalsInfo creates the overview matrices for inputshape Files. If they are already created by the user beforehand, the script will still check for strict overlaps.
Possible values:
11
00
truetrue
falsefalse
yesyes
nono
Boolean(True)Boolean(True)
Boolean(False)Boolean(False)
TrueTrue
FalseFalse
Logging Options
Settings concerning the verbosity level of logging.
-screenLogLevel verbosity level of screen output (default: info)
Type : fromStr
Remark : optional, default: info
Description: The minimum level of log message importance to print on the screen
-fileLogLevel verbosity level of log file output (default: info)
Type : fromStr
Remark : optional, default: info
Description: The minimum level of log message importance to export to the xml-log

Examples

As a prerequisite for the subsequent examples, please import the data using the following commands:

opalsImport -inf G111.las
opalsImport -inf G112.las
opalsImport -inf G113.las

Example 1

This example uses preTiling to create a shapefile with tiles and then cuts the odm according to the tiles.

preTiling -vector G111.odm -tilesize 300 -skip False
preCutting -vector G111.odm -shapefile Tiles.shp -export G111_tile -skip False

Example 2

This example loads the three input files using a wildcard and then again first creates a tiling and cuts according to it.

preTiling -vector G11*.odm -tilesize 300 -skip False
preCutting -vector G11*.odm -shapefile Tiles.shp -export tile -skip False

Example 3

preCutting also supports las-files as input.

preTiling -vector G111.las -tilesize 300 -skip False
preCutting -vector G111.las -shapefile Tiles.shp -export G111_tile -skip False -buffer 10

Example 4

preCutting also supports a mix of odm and las-files as input.

preTiling -vector G111.las G112.odm -tilesize 300 -skip False
preCutting -vector G111.las G112.odm -shapefile Tiles.shp -export tile -skip False -buffer 10
@ tile
flat tiling structure
opalsImport is the executable file of Module Import
Definition: ModuleExecutables.hpp:113
@ vector
General vector data file (las, shp, ..)