sql server 2008 - For a multiline intersecting several polygons, get the respective lengths -
i have 1 table containing polygons , containing multilines. given multiline, can intersecting polygons, so:
select p.geo, p.id polygons p, lines l p.geo.stintersects(l.geo) = 1 , l.id = @lineid
to line itself, add:
union select l.geo, l.id lines l l.id = @lineid
how, though, respective length of portion of line intersects given polygon, third column?
as simple should be, really.
select p.geo, p.id, p.geo.stintersection(l.geo).stlength() polygons p, lines l p.geo.stintersects(l.geo) = 1 , l.id = @lineid
Comments
Post a Comment