【发布时间】:2013-01-01 02:28:23
【问题描述】:
SQL SERVER 2012
在使用STIntersect 将线与多边形几何相交后,我需要找到线的几何长度。
例如,我有一条 7731 米长的线,但我 STIntersect 将它与一组多边形相对,我需要找出每个多边形中线的长度。
输出表看起来像
ReferenceID PolygonID LineID Length
12324 3234 24661 1635
12325 3233 24652 663
12326 3236 24653 256
12327 3365 24634 165
目前使用这个但不能返回几何和长度
insert [VMS_OBS_LINES_INTERSECT] (CA_Reference_Key, STAT_AREA,WATERS,GNMFSAREA, Grid_ID, Length)select l.CA_Reference_Key,g.stat_area,g.waters, g.GNMFSAREA , g.Grid_ID, g.shape.STIntersection(l.shape).STLength()
FROM GRID_AREA_SQL g, VMS_OBS_COMBINE_LINES_AI l
WHERE g.shape.STIntersects(l.shape) = 1;
【问题讨论】:
-
这能回答你的问题吗? stackoverflow.com/questions/13259215/…>
标签: sql-server geometry spatial intersect