Table of Contents
- See Also
- opals::IContouring
Aim of module
Derives the contour of foreground objects of a raster model and exports the results as a polygon shape file.
General description
The input raster grid cell values are rounded to integer values. After rounding, zero values are regarded as background, non-zero pixels are regarded as foreground regions. This also implies, that nodata value is not considered, so if areas with no data should not be contoured, then its pixel value should be set to zero. Contiguous foreground pixels are contoured as one polygon. The result of the contouring is the outline of foreground pixels. This outline consists of pixel edge segments instead of segments connecting pixel centers. The holes (background pixels in the foreground object) are handled as inner rings (see OGR definition). Single pixels are not outlined (neither foreground pixels as objects, neither background pixels as holes). Polygons with area less than minArea are not written in the SHAPE file.
Parameter description
Remarks: mandatory
The specified input file (in GDAL supported format) is analyzed, all foreground pixels (pixel value != 0) are contoured and the contours are labelled.
Remarks: estimable
Path to output file containing contour polygons. The polygons are exported in ESRI Shape format.
Estimation rule: The current directory and the name (body) of the input file are used as file name basis. Additionally, the postfix '_contour' and the extension corresponding to the output format are appended.
Remarks: default=
The resulting polygons of a contouring calculation are provided as a vector of Well-Known-Text (WKT) strings. Specify -outParamFile to store the WKT strings to a parameter XML file.
Remarks: default=0
If specified, only polygons with an area greater than minArea are exported. If omitted, no minimum area is considered
Remarks: default=1
In series of collinear vertices, export only the start and end points, thereby resulting in a reduction of the amount of exported vertices, while not losing any information.
Examples
The data used in the following example can be found in the $OPALS_ROOT/demo/ directory. For strip 21 (contained in the demo directory) the following commands are required to obtain DSM model:
As a result, a grid file strip21_z.tif in GeoTiff format is created. To obtain a binary grid of potential building areas we apply a simple thresholding to get cont_building.tif serving as input for the subsequent example.
To elimanate single erroneous pixels (salt/pepper noise) we apply morphological operations on the cont_building.tif grid:
Example 1: Building contours
In this example the contouring operation is applied on cont_building_close_open_square_1.tif dataset. This dataset is a GeoTiff grid:
minArea 100 parameter is applied.
cont_building_cos1.shp ) contains only polygons with greater than 100 unit^2 area.Restrictions
The following restrictions apply:
- The whole input raster must fit into the memory (RAM).
- Only ESRI Shape is supported as output format.
References
Hollaus, M., W. Wagner, G. Molnar, G. Mandlburger, C. Nothegger, J. Otepka (2010) Deliniation of vegetation and building polygons from full-waveform airborne lidar data using OPALS software, Geospatial Data and Geovisualization: Environment, Security, and Society, Special Joint Symposium of ISPRS Technical Commission IV and AutoCarto 2010 in conjunction with ASPRS/GaGIS Speciality Conference, 15999 November 2010, Orlando, Florida, USA, CDROM, 7 p.
