[postgis-users] Topological Exceptions
Paul Ramsey
pramsey at cleverelephant.ca
Wed Mar 12 15:51:53 PDT 2008
On 3/12/08, Martin Davis <mbdavis at refractions.net> wrote:
> Orginally the idea was that it was nice to report the actual nature of
> the exception, since it contains an indication of where the error
> occurred. It would be nice to be able to continue to have access to
> this information. One way to do this would be to have a parallel set of
> functions which would abort as they do now. Or is there some other way
> to report this info - to a log somewhere perhaps?
I prefer using something like NULL to trying to create a new geometry
type to encompass the error... particularly if the error conditions
aren't that interesting to people. We can get into the log easily
enough by using a WARNING log level, the only question then is how to
identify which geometries caused the failure. One way might be to
hash the geometries, so that if people want to find their bad
geometries from the log they can just select for the hash value.
This means that the return values of
ST_Contains(geom,geom) => true, false or null
and
ST_Intersection(geom,geom) => geometry or null
I just checked, and null seems to be interpreted as false in a WHERE
clause, so adding this behavior probably wouldn't wreck too many
joins.
Paul
More information about the postgis-users
mailing list