Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#4681 closed enhancement (fixed)

Have ST_GetFaceGeometry print a WARNING if face edges are found but no polygon can be built

Reported by: strk Owned by: strk
Priority: medium Milestone:
Component: topology Version: master
Keywords: Cc:

Description

When topology invalidities (like ring edge referencing wrong face) prevent ST_GetFaceGeometry from building a polygon of an existing face, NULL is returned. It would be useful for the user if the function printed a WARNING (or maybe threw an ERROR?) when a clear topology invalidity is found.

Change History (6)

comment:1 by strk, 4 years ago

Being ST_GetFaceGeometry now implemented in liblwgeom, we don't have the infrastructire required to raise a WARNING. Instead we can only print a NOTICE or raise an EXCEPTION.

According to #3221 we had in the past avoided EXCEPTION so not to prevent ValidateTopology to continue inspecting the topology. It's debatable whether it should be ValidateTopology catching exceptions (probably saner)

comment:2 by Sandro Santilli <strk@…>, 4 years ago

Resolution: fixed
Status: newclosed

In 943cda0/git:

ST_GetFaceGeometry: always print corruption information

Use NOTICE when an exception will prevent ValidateTopology
from completing (see #3221).

Also return EMPTY instead of NULL on corruption due to
partial boundaries (consistently with face without
boundaries reported in #3221)

Includes testcase and NEWS item.
Closes #4681

comment:3 by Lars Aksel Opsahl, 4 years ago

In this print out here

NOTICE: Corrupted topology: face 7996498 has no associated edges.

Maybe also can add the topology name ?

comment:4 by strk, 4 years ago

Is this really needed ? Because topology name would be the first argument to the function…

If we add topology name in the error we probably need to do it consistently for all errors

comment:5 by Lars Aksel Opsahl, 4 years ago

Ok I see, but with the Topology layer name it would be easier debug when working eith many different topology layers on the same database.

[root@vroom4 ~]# grep Corrupted /var/log/postgres/*|sort -u
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7995848 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7995885 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7995937 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7995994 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996024 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996137 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996138 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996141 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996244 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996458 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996465 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996477 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996478 has no associated edges.
/var/log/postgres/postgresql-Sun.log:NOTICE:  Corrupted topology: face 7996498 has no associated edges.

comment:6 by Lars Aksel Opsahl, 4 years ago

It's not a big issue for the cases I am testing now, because I am able to sort it out here.

But if somebody adds error checking on postgres logs, it maybe help full with this extra info.

But since this is quite big job it's probably best to let the code be as it is for now and continue to focus on avoiding this errors.

Note: See TracTickets for help on using tickets.