- See also
- python.preCutting
Aim of module
Cuts an ODM/Raster file using one or more polygons of a shape file.
General description
In order to process them correctly, the polygons within the shapefile have to be non self-intersecting and must not have holes.
ATTENTION! In case of RASTER data, please make sure to handle the resampling and the rounding right. In case that the values should stay constant in resampling (e.g. Classification, Integer-values), nearestNeighbour resampling has to be used. For other applications (Height models etc.), bilinear and bicubic resampling modes are more suitable. Some raster properties and the resampling mode can lead to half-pixel offsets in the results! To avoid them, the rounding mode (-c) can be switched between center and corner.
- 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.
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.
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
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:
| 1 | 1 |
| 0 | 0 |
| true | true |
| false | false |
| yes | yes |
| no | no |
| Boolean(True) | Boolean(True) |
| Boolean(False) | Boolean(False) |
| True | True |
| False | False |
Type : String
Remark : Optional, default: 'mean(r)'
Description:
-resamplingMethod OpalsGrid resampling method [bilinear | bicubic | nearestNeighbour]
Type : String
Remark : Optional, default: 'bilinear'
Description:
-roundingMethod Method to round the results to exakt pixel positions [corner | center]
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.
Type : Boolean
Remark : Optional, default: Boolean(True)
Description:
Possible values:
| 1 | 1 |
| 0 | 0 |
| true | true |
| false | false |
| yes | yes |
| no | no |
| Boolean(True) | Boolean(True) |
| Boolean(False) | Boolean(False) |
| True | True |
| False | False |
-writeEmptyTiles if True also empty tile files are created
Type : Boolean
Remark : Optional, default: Boolean(False)
Description:
Possible values:
| 1 | 1 |
| 0 | 0 |
| true | true |
| false | false |
| yes | yes |
| no | no |
| Boolean(True) | Boolean(True) |
| Boolean(False) | Boolean(False) |
| True | True |
| False | False |
-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
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:
| 1 | 1 |
| 0 | 0 |
| true | true |
| false | false |
| yes | yes |
| no | no |
| Boolean(True) | Boolean(True) |
| Boolean(False) | Boolean(False) |
| True | True |
| False | False |
Logging Options
Settings concerning the verbosity level of logging..
-screenLogLevel verbosity level of screen output
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
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:
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