We are converting a geometry table to another one and we would like to convert every invalid geometry to a single one easily identifiable by users in WKB or WKT form and not breaking the processing or display.

What could it be?

We do not want to use 'POLYGON EMPTY' because it could be something that exists in the original table. It could also be the result of some geoprocessing done on the converted table and then these ones would not be distinguiable from the original invalid ones...

Any better idea?

  • POLYGON ((0 0, 0 1, 1 1, 0 0)) – csk Aug 13 at 19:08
  • Null might be a better choice, or an infinite box. Depends on the end use of the table – Ian Turton Aug 13 at 19:12
  • There are an infinite number of invalid geometries. Changing them to a single form would prevent repair. – Vince Aug 13 at 19:44
  • @Vince That's for the ones that ST_MakeValid() is unable to repair... – Pierre Racine Aug 13 at 20:57
  • 1
    I recommend to use a separate table denoting the validity (and meta info about the cause or preferred action etc ) or even the invalid rows themselves, or use NULL if absolutely necessary (they are filtered out extremely performant with NULLS FIRST/LAST index declaration). You are going to produce data inconsistencies your way, why not repair? – ThingumaBob Aug 13 at 21:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.