[QGIS-Developer] [Processing][Vector Geometry] Check Validity Algorithm

Jorge Gustavo Rocha jgr at di.uminho.pt
Fri Sep 27 08:35:46 PDT 2019


Hi João,

If you can see a good way to make both validation errors strings more
similar (when the GEOS and QGIS error are the same), feel to make a
proposal.

Right now, for the same error, a user will see (for example):

Using GEOS:
Ring self-intersection

Using QGIS:
segments 2 and 126 of line 0 intersect at -2632521.58859, 5137728.25013
segments 3 and 126 of line 0 intersect at -2632521.58859, 5137728.25013

Regards,

Jorge Gustavo

PS For my classes/workshops, I use the alaska shapefile from
https://qgis.org/downloads/data/
It contains errors :-)

Às 16:24 de 27/09/19, Jorge Gustavo Rocha escreveu:
> Hi João,
> 
> That would be great!
> 
> For the GEOS validation, you can get the list of errors from:
> src/core/geometry/qgsgeos.cpp
> 
> QStringLiteral( "topology validation error" ), QObject::tr( "Topology
> validation error", "GEOS Error" )
> QStringLiteral( "repeated point" ), QObject::tr( "Repeated point", "GEOS
> Error" )
> QStringLiteral( "hole lies outside shell" ), QObject::tr( "Hole lies
> outside shell", "GEOS Error" )
> QStringLiteral( "holes are nested" ), QObject::tr( "Holes are nested",
> "GEOS Error" )
> QStringLiteral( "interior is disconnected" ), QObject::tr( "Interior is
> disconnected", "GEOS Error" )
> QStringLiteral( "self-intersection" ), QObject::tr( "Self-intersection",
> "GEOS Error" )
> QStringLiteral( "ring self-intersection" ), QObject::tr( "Ring
> self-intersection", "GEOS Error" )
> QStringLiteral( "nested shells" ), QObject::tr( "Nested shells", "GEOS
> Error" )
> QStringLiteral( "duplicate rings" ), QObject::tr( "Duplicate rings",
> "GEOS Error" )
> QStringLiteral( "too few points in geometry component" ), QObject::tr(
> "Too few points in geometry component", "GEOS Error" )
> QStringLiteral( "invalid coordinate" ), QObject::tr( "Invalid
> coordinate", "GEOS Error" )
> QStringLiteral( "ring is not closed" ), QObject::tr( "Ring is not
> closed", "GEOS Error" )
> 
> For the QGIS validation, you have to look at:
> src/core/qgsgeometryvalidator.cpp
> 
>             QString msg = QObject::tr( "segment %1 of ring %2 of polygon
> %3 intersects segment %4 of ring %5 of polygon %6 at %7" )
>       QString msg = QObject::tr( "ring %1 with less than four points"
> ).arg( i );
>       QString msg = QObject::tr( "ring %1 not closed" ).arg( i );
>     QString msg = QObject::tr( "line %1 with less than two points"
> ).arg( i );
>       QString msg = QObject::tr( "line %1 contains %n duplicate node(s)
> at %2", "number of duplicate nodes", n ).arg( i ).arg( j );
>       QString msg = QObject::tr( "segments %1 and %2 of line %3
> intersect at %4" ).arg( j ).arg( k ).arg( i ).arg( s.toString() );
>       QString msg = QObject::tr( "Ring %1 of polygon %2 not in exterior
> ring" ).arg( i ).arg( idx );
> 
> I hope it helps.
> 
> Best regards,
> 
> Jorge Gustavo
> 
> Às 15:20 de 27/09/19, João Gaspar escreveu:
>> Hi devs,
>> I need some guidance to help me find all possible error messages that
>> are saved in the attribute table when we run the Check Validity
>> Algorithm for both methods.
>> This can be found in the source code?
>>
>> I search here but didn't find:
>> https://github.com/qgis/QGIS/blob/master/python/plugins/processing/algs/qgis/CheckValidity.py
>>
>> I'm asking this because this can be a good addition in the documentation
>> to explain the errors that can occur to help understand what is what and
>> why happens.
>>
>> Please feel free to give any advice.
>>
>> Thank you for your time.
>>
>> Cheers,
>> João
>>
>> _______________________________________________
>> QGIS-Developer mailing list
>> QGIS-Developer at lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>>
> 
> J. Gustavo
> 

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Gabinete 3.29 (Piso 3)
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor


More information about the QGIS-Developer mailing list