[postgis-devel] Problems with st_crosses postgis version 1.5

Chris Hodgson chodgson at refractions.net
Tue Oct 19 10:07:37 PDT 2010


David,

I suspect that "crosses" is not the relationship you are looking for. 
Your smaller grid will be wholly contained by the larger one, sharing 
outer edges is not enough for "crosses", they need to actually "cross" - 
reading:

http://postgis.refractions.net/documentation/manual-1.5/ST_Crosses.html

"Additionally, the intersection of the two geometries must not equal 
either of the source geometries."

I think Covers/CoveredBy will give you what you want (your large grid 
covers the quarters in the smaller grid):

http://postgis.refractions.net/documentation/manual-1.5/ST_Covers.html

Cheers,
Chris


David Potts wrote:
> Hi
>
> I seem to have a problem with st_crosses function
>
> I have two square grids, each aligned on top of each other, one grid
> represents the other sub divided in to 4 quaters.  Each quater shares 2
> common edges, the other 2 edges are within the square.
>
> I had assumed that something like
>
> select * from buoy_table b,quater_table q where
> st_crosses(b.outline_geom,q.outline_geom)
>
> would return every square in the quater grid within the buoy qrid, ie 4
> squares from the quater grid to every single square in the buoy qrid
>
> It returns nothing, any suggestions why ?
>
>
> expressions like   st_intersections(st_buffer(q.outline_geom,-1),
> s_buffer(b.outline_geom,-0.1)) will give me what I want, ie the 4 quater
> squares per parent square but its very slow!
>
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Any views expressed in this message are those of the individual sender,
> except where the sender specifically states them to be the views of the
> Pinan Software
>
>
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>   




More information about the postgis-devel mailing list