Doc: Add and update check-geometry examples - #15271
geographika wants to merge 3 commits into
Conversation
| .. figure:: ../../images/programs/gdal_vector_check_geometry.svg | ||
|
|
||
| Error locations reported by :program:`gdal vector check-geometry` for Polygon, MultiPolyon, and LineString inputs. | ||
| Error locations reported by :program:`gdal vector check-geometry` for Polygon, MultiPolygon, and LineString inputs. |
There was a problem hiding this comment.
Odd that this got in, I wonder if the spellcheck misses figure captions.
There was a problem hiding this comment.
Strange indeed, as its not in the word list. Maybe camel casing gets ignored?
| - Polygons and MultiPolygons are checked for validity. A single error point will be reported even if there are multiple causes of invalidity. | ||
| - LineStrings and MultiLineStrings are checked for simplicity. All self-intersection locations will be reported if GDAL is built using version 3.14 or later of the GEOS library. With earlier versions, self-intersection locations are not reported. | ||
| - GeometryCollections are checked that their individual elements are valid / simple. A single error point will be reported even if there are multiple causes of invalidity. | ||
| - Point geometries are always considered valid/simple. |
There was a problem hiding this comment.
Probably out of scope for this PR, but GEOS considers points with NaN coordinates to be invalid. I don't know if that comes from OGR or not. GDAL doesn't bother passing points to GEOS, so in this case GDAL reports valid where GEOS reports invalid.
gdal pipeline read "POINT (3 NaN)" ! check-geometry ! write /vsistdout/ --format CSV
Warning 1: Requested to create spatial CSV layer but GEOMETRY layer creation option not set. No geometry will be output.
Warning 1: Point geometry passed to 'gdal vector check-geometry'. Point geometries are always valid/simple. Further messages of this type will be suppressed.
error
vs
geosop -a "POINT (3 NaN)" isValid
false
There was a problem hiding this comment.
I don't know if that comes from OGR or not.
JTS does not accept "POINT (3 NaN)" either. I cannot imagine what kind of point that would be, but there are other things that I cannot imagine but which are apparently true anyhow.
There was a problem hiding this comment.
This sounds like it could cause some confusion, if check-geometry returns valid for a dataset including NaN, and then extents and other calculations are messed up later? Is it worth opening an issue for this? Or I can add a note to the docs?
gdal vector check-geometryexample to useAS_WKTas usingAS_XYthrows errorsERROR 1: Geometry type Multi Point is not compatible with GEOMETRY=AS_XY.since gdal vector check-geometry: write error geometries as MultiPoint #13854--no-create-empty-layersoption