Skip to content

Doc: gdal vector check-geometry #13844

@geographika

Description

@geographika

Feature description

I am going to add some examples to the https://gdal.org/en/latest/programs/gdal_vector_check_geometry.html page, and was first testing the tool.
This issue contains some initial thoughts and suggestions on possible improvements - no bugs were found, and it is a very useful tool.

cc @dbaston

  1. I initially wanted to see if there were any geometry errors in a layer in an ESRI FileGeoDatabase:
gdal vector check-geometry C:\Data\test.gdb.zip --input-layer "TestLayer" --output-format CSV /vsistdout/
error

At first, I thought this was a nondescript error message, until running further tests below when I realised it was the field name of the output and there were no errors in the dataset. Maybe the field could be renamed errorDesc or similar? I will add a note on the default output fields to the docs page.

  1. Testing on multiple layers in a dataset:
gdal vector check-geometry C:\Data\test.gdb.zip C:\Data\errors.gpkg

In my test dataset there were 40 layers. The geopackage is created with 40 output layers, however the majority of these were empty. It takes a few minutes to manually find which layers have errors in an application such as QGIS.
An --ignore-valid flag would be very useful to avoid empty output. Alternatively I can add a pipeline example that filters these out.

Being able to filter output would also be useful on the command-line, to avoid noise:

gdal vector check-geometry C:\Data\test.gdb.zip --quiet -f CSV --lco GEOMETRY=AS_XY --lco SEPARATOR=TAB /vsistdout/
X       Y       error
                self-intersection
X       Y       error
X       Y       error
X       Y       error
X       Y       error				
X       Y       error
                self-intersection
X       Y       error
                self-intersection
X       Y       error
                self-intersection
X       Y       error
X       Y       error
...
  1. Allowing all fields to be easily added to the output would be very handy, using the same keywords as https://gdal.org/en/latest/programs/gdal_raster_pixel_info.html - ALL and NONE (I'm not sure what happens here if you have a field named ALL in the dataset).
--include-field <INCLUDE-FIELD> Fields from coordinate dataset to include in output (special values: ALL and NONE) (default: ALL) [may be repeated]
  1. This may be related to my test data, but there is a MULTIPOINT warning in the tool output:
gdal vector check-geometry C:\Data\test.gdb.zip C:\Data\errors.gpkg
Warning 1: Point geometry passed to 'gdal vector check-geometry'. Point geometries are always valid/simple. Further messages of this type will be suppressed.
Warning 1: A geometry of type MULTIPOINT is inserted into layer error_location_TestLayer of geometry type POINT, which is not normally allowed by the GeoPackage specification, 
but the driver will however do it. To create a conformant GeoPackage, if using ogr2ogr, the -nlt option can be used to override the layer geometry type. This warning will no longer be emitted for this combination of layer and feature geometry type.
  1. The current docs state Validity/simplicity checking is performed by the GEOS library - is there a list of possible errors to add to the docs page, or to link to? I found a few of the errors I encountered in this enum, but I presume there is a list / details somewhere we can link to.

Additional context

No response

Metadata

Metadata

Assignees

Labels

documentationIssues and contributions to the documentation contentenhancement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions