>
> thanks for your feedback. Shouldn't this be reported by ST_IsValid also?
>

Yes, it should.

SELECT
 ST_GeomFromText('POLYGON((7 7, 77 77, 35 35,7 7))') AS bad_poly,
 ST_IsValid(ST_GeomFromText('POLYGON((7 7, 77 77, 35 35,7 7))')) AS
bad_poly_valid,
 ST_IsValidDetail(ST_GeomFromText('POLYGON((7 7, 77 77, 35 35,7 7))')) AS
bad_poly_geom,
 ST_IsValidReason(ST_GeomFromText('POLYGON((7 7, 77 77, 35 35,7 7))')) AS
bad_poly_reason;

will report:
GEOS warning: Self-intersection at or near point 7 7
(as shown when called from spatialite in a terminal)

and as the result of ST_ValidReason: Self-intersection[7 7]

I cannot find a simple sample to reproduce the second error:
- Invalid number of points in LinearRing found 3 - must be 0 or >= 4

A simple sample that produces both errors at the same time
- could possibly show if the second error possibly interferes with the first
-- causing ST_IsValid to return TRUE, which should never happen

If you could supply the offending geometry in a text file (i.e. result of
'ST_AsText(geometry)'), then this could be checked.

Mark
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to