在具有 M 和 Z 的多个有序线几何图形上使用联合聚合,但最终结果缺少那些 Z 和 M 值。我也尝试使用地理,但没有运气。
测试查询
create table #test
(shape geometry)
insert into #test(shape)
values (geometry::STGeomFromText('LINESTRING (-89.831404 29.869888 2.5 28.58, -89.835404 29.869892 2.5 30.13)', 4269)), (geometry::STGeomFromText('LINESTRING (-89.835404 29.869892 2.5 30.13, -89.831403 29.869896 2.5 31.45)', 4269))
DECLARE @geom3 geometry = (select geometry::UnionAggregate(shape) FROM #test )
SELECT @geom3.AsTextZM()
drop table #test
这返回
LINESTRING (-89.831403 29.869896, -89.835404 29.869892, -89.831404 29.869888)
我希望得到以下结果:
LINESTRING (-89.831403 29.869896 2.5 28.58, -89.835404 29.869892 2.5 30.13, -89.831404 29.869888 2.5 31.45)