geometry默认是16进制存储的
use database;
https://blog.csdn.net/mao834099514/article/details/79094405
如果是在postgresql里是使用st_astext()函数
开源架构Webgis解决方案
select * from SpatialTable a,SpatialTable b where a.geom.STContains(b.geom)=1
https://blog.csdn.net/mao834099514/article/details/79094405
如何在SQL Server里新建Envelope?
SQL Server空间数据类型:https://docs.microsoft.com/zh-cn/sql/relational-databases/spatial/spatial-data-sql-server?view=sql-server-ver15
DECLARE @g1 geometry --SET @g1 = geometry::Parse('POLYGON((153.13308571 -481.00897143,153.13308571 -479.00897143,155.13308571 -479.00897143,155.13308571 -481.00897143, 153.13308571 -481.00897143))'); --SELECT @g1.STIsValid() SET @g1 = geometry::STGeomFromText('POLYGON((0 0, 2 0, 2 2, 0 2, 0 0))', 0); --SET @g1 = @g1.MakeValid(); select * from da.dbo.CONTROLPOINT a where @g1.STContains(a.Shape)=1
DECLARE @g1 geometry SET @g1 = geometry::STGeomFromText('POLYGON((153 -481,153 -479,155 -479,155 -481, 153 -481))', 0); select * from da.dbo.CONTROLPOINT a where @g1.STContains(a.Shape)=1
>>
DECLARE @g1 geometry
SET @g1 = geometry::STGeomFromText('POLYGON((xmin ymin,xmin ymax,xmax ymax,xmax ymin, xmin ymin))', 0);
select * from da.dbo.CONTROLPOINT a where @g1.STContains(a.Shape)=1