[postgis-users] BOX2D

Emily Gouge egouge at refractions.net
Fri Nov 17 08:36:33 PST 2006


Try removing the quotes from the BOX2D statement.  The quotes cause it to interprets it as a string 
and thus it is trying to cast the string "BOX2D(h.the_geom2)" to a box2d object which doesn't make a 
lot of sense.

select b.* from hikeroutes h, baseedge b where b.the_geom &&
setSRID(BOX2D(h.the_geom2)::box2d, 21781) and h.id = 148 and
within(b.the_geom, h.the_geom2); -- 21 sec

Emily

Thomas Zuberbuehler wrote:
> Hi
> 
> Has anybody an idea why follow query does not execute?
> 
> select b.* from hikeroutes h, baseedge b where b.the_geom &&
> setSRID('BOX2D(h.the_geom2)'::box2d, 21781) and h.id = 148 and
> within(b.the_geom, h.the_geom2); -- 21 sec
> 
> I get 'ERROR:  BOX2DFLOAT4 parser - doesnt start with BOX('.
> 
> Thank you.
> Regards, Thomas
> 




More information about the postgis-users mailing list