Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sql-server/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sql server SQL Server 2012,缺少Z和M_Sql Server_Sqlgeometry - Fatal编程技术网

Sql server SQL Server 2012,缺少Z和M

Sql server SQL Server 2012,缺少Z和M,sql-server,sqlgeometry,Sql Server,Sqlgeometry,在具有M和Z的多个有序线几何体上使用union聚合,但最终结果缺少这些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)), (geo

在具有M和Z的多个有序线几何体上使用union聚合,但最终结果缺少这些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)

UnionAgregate将生成一个新的地理值,并在此过程中从源形状中删除所有Z和M(高程和测量)数据

需要注意的是,UnionAgreegate将两个具有相同X和Y坐标但不同Z和M的点合并为一个具有X和Y坐标的点,因此以下脚本将返回2个点:

create table #test
(shape geometry)

insert into #test(shape)
values (geometry::STGeomFromText('POINT (-10 10 1 1)', 0)),
(geometry::STGeomFromText('POINT (-10 10 4 4)', 0)),
(geometry::STGeomFromText('POINT (-11 10 4 4)', 0));

select shape.AsTextZM() from #test

select geometry::UnionAggregate(shape).AsTextZM() FROM #test 

drop table #test

你需要提供更多的信息,否则人们会否决你的问题。尝试添加相关代码并描述数据格式。甚至可能还有数据示例。谢谢。这是我的第一篇文章,我真的不知道要包括什么。据我所知,UnionAgreegate将生成一个新的地理值,并在过程中删除源形状中的所有Z和M(高程和测量)数据。您知道任何与/a工作原理相同但保留Z和M的方法吗?CollectionAggregate保留了它们,但它给了我一个无序的几何体集合,这不是我想要的。