Opened 9 years ago

Closed 9 years ago

Last modified 5 years ago

#3221 closed defect (fixed)

ST_GetFaceGeometry returns NULL for faces with no boundaries

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

Description

If you ask for a face having no bounds to ST_GetFaceGeometry, you get a NULL back. I'm not sure this is a sane behaviour.

Strictly speaking, a face with no boundaries would be a topological invalidity, so you should maybe get an exception thrown.

Or, if we want to be "tolerant", we could return a POLYGON EMPTY.

What do you think, Regina ?

Change History (3)

comment:1 by strk, 9 years ago

NOTE: raising an exception would currently break ValidateTopology, as it invokes ST_GetFaceGeometry as part of its operations. I guess an EMPTY return would play nicer with that.

comment:2 by strk, 9 years ago

Resolution: fixed
Status: newclosed
Version: 2.1.xtrunk

Changed to return empty with r13861

comment:3 by Sandro Santilli <strk@…>, 5 years ago

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

Note: See TracTickets for help on using tickets.