[postgis-users] LINESTRING

Sean M. Montague smontague at ATSDenver.com
Fri Mar 11 06:37:45 PST 2005


I'm trying to return all the roads from a layer that intersect a certain
bb, but not getting the results I expect.  I've done it OK with polygon
layers, but have not figured out the LinestringFromText syntax, or if
I'm using the right statement.  With polys, you supply 5 xy coordinates
of a bb, but LinestringFromText only allows 2 xy cords, a line.  Below
is the statement I'm usisng.  How do I select all the LINESTRINGs that
fall within a bb, not along a line?  The coords below the select
statement is an example of the svg that is returned.  This is not
exactly what I expected either.  Is there a way for the svg of a
LINESTRING be returned as a path similar to polygons?  The "cx=" & "cy="
adds significant size to the file of large datasets, and would require a
lot extra processing to remove them.

SELECT AsSVG(intersection(the_geom, LinestringFromText('LINESTRING($XMin
$YMax, $XMax $YMin)',26913)),0,8)
As the_geom
>From features1
WHERE layer='$layer'
AND the_geom && PolygonFromText('POLYGON(($XMin $YMax, $XMax $YMax,
$XMax $YMin, $XMin $YMin, $XMin $YMax))',26913);

cx="563613.74" cy="-4231444.9",cx="565583.46"
cy="-4229880.7",cx="568162.55" cy="-4227832.6"



More information about the postgis-users mailing list