Polygons passed to poly_overlap have 0 pts when column is indexed using rtree

Started by Kenneth Chanover 23 years ago3 messages
#1Kenneth Chan
kkchan@technologist.com

This �feature� does not affect the original version of poly_overlap as only a bounding box test is preformed. I modified poly_overlap in an attempt to improve the preciseness of poly_overlap. The function works when the column is not indexed or when the column is indexed using rtree_gist from the contrib section, but fails when the column is indexed using rtree. Turned out that npts of the polygon retrieved from the table is 0 (the other polygon is a constant and its attributes are correct). I suspect the �feature� might affect other functions that uses polygons->npts like poly_contain. Would anyone happens to know the identity of the �offending� function might be?

TIA

Kenneth Chan
--
_______________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kenneth Chan (#1)
Re: Polygons passed to poly_overlap have 0 pts when column is indexed using rtree

"Kenneth Chan" <kkchan@technologist.com> writes:

... Turned out that npts of the
polygon retrieved from the table is 0 (the other polygon is a constant
and its attributes are correct). I suspect the �feature� might
affect other functions that uses polygons->npts like poly_contain.
Would anyone happens to know the identity of the �offending�
function might be? TIA

No, but if you can post an example demonstrating the problem, I'm sure
we can find it...

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: Polygons passed to poly_overlap have 0 pts when column is indexed using rtree

... Turned out that npts of the
polygon retrieved from the table is 0 (the other polygon is a constant
and its attributes are correct). I suspect the �feature� might
affect other functions that uses polygons->npts like poly_contain.
Would anyone happens to know the identity of the �offending�
function might be? TIA

It appears that the issue is not rtree itself, but the rt_poly_union
and rt_poly_inter functions, which produce "polygons" that have only
bounding boxes. Not sure whether that should be considered erroneous
or not. The dummy polygons are evidently used as internal node keys
in the rtree.

regards, tom lane