Functions | |
bool | Shapefile.HasInvalidShapes () |
Checks whether there are invalid shapes within shapefile. More... | |
Properties | |
ShapeValidationInfo | Shapefile.LastInputValidation [get] |
Gets results of input data validation for geoprocessing methods. More... | |
ShapeValidationInfo | Shapefile.LastOutputValidation [get] |
Gets results of output data validation for geoprocessing methods. More... | |
Here is a list of properties and methods for shapefile validation. This module is a part of the documentation of Shapefile class.
Graph description
Shapefile validation
Starting from version 4.9.1 built-in validation for input and output shapefiles passed to geoprocessing methods is used. During validation each shape within a shapefile is checked for validity with Shape.IsValid property and optionally an attempt is made to fix invalid shapes with Shape.FixUp. If the fixing wasn't successful, various actions may be taken:
Validation behaviors are specified in GlobalSettings.ShapeInputValidationMode and GlobalSettings.ShapeOutputValidationMode. See tkShapeValidationMode enumeration for possible behaviours. By default no validation is performed (tkShapeValidationMode.NoValidation), to preserve compatibility with previous versions of library.
The results of validation can be viewed via Shapefile.LastInputValidation and Shapefile.LastOutputValidation properties. Both return instance of ShapeValidationInfo class (see description for list of properties).
There is slight difference between input and output validation:
In this example a shapefile with invalid shape is created and then validated as input to Shapefile.AggregateShapes methods and as output in Shapefile.Save method.
Output of the sample:
Here is list of methods with built-in shapefile validation: Shapefile.Clip, Shapefile.GetIntersection, Shapefile.Difference, Shapefile.SymmDifference, Shapefile.Union, Shapefile.ExplodeShapes, Shapefile.AggregateShapes, Shapefile.ExportSelection, Shapefile.Sort, Shapefile.Dissolve, Shapefile.BufferByDistance, Shapefile.Merge, Shapefile.Segmentize, Shapefile.SimplifyLines, Shapefile.Reproject, Shapefile.ReprojectInPlace (input validation only), Shapefile.Save (output validation), Shapefile.SaveAs (output validation), Shapefile.Dump (output validation), Utils.ReprojectShapefile, Utils.GridToShapefile, Utils.TinToShapefile, Utils.OgrLayerToShapefile, Utils.RemoveColinearPoints, Utils.ShapefileToGrid.
bool Shapefile.HasInvalidShapes | ( | ) |
Checks whether there are invalid shapes within shapefile.
|
get |
Gets results of input data validation for geoprocessing methods.
Use GlobalSettings.ShapeInputValidationMode to change the settings.
|
get |
Gets results of output data validation for geoprocessing methods.
Use GlobalSettings.ShapeOutputValidationMode to change the settings.