On 9/13/18, Jens Alfke <j...@mooseyard.com> wrote:
> The geopoly docs says that only the geopoly_overlap(P1,P2) and
> geopoly_within(P1,P2) functions are optimized to use the R-tree index when
> used as a WHERE test; so that means the geopoly_contains_point function is
> not.
>
> This implies that, if I want to query for polygons containing a given point,
> I should avoid using the obvious function geopoly_contains_point; instead I
> should outset the point (by some epsilon) into a small rectangle, convert
> that to a polygon, and use one of the two optimized functions. Correct?

Correct.

>
> Which prompts the question of whether I can use epsilon=0; i.e. how do the
> overlap and within functions behave if one polygon is an empty (zero area)
> rectangle? Will they work correctly, or always return false?

I think a zero-area polygon will work.  But, honestly, I don't
remember writing a test case for that.   (Probably, I should go back
and add a few.)  Please try it and see what happens :-)

Do you have specific plans to use geopoly?  Is this new extension
meeting a specific need that you have?  Or are you just curious?

-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to