惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
云风的 BLOG
云风的 BLOG
小众软件
小众软件
雷峰网
雷峰网
博客园 - 【当耐特】
V
V2EX
WordPress大学
WordPress大学
IT之家
IT之家
Last Week in AI
Last Week in AI
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Apple Machine Learning Research
Apple Machine Learning Research
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
V
Visual Studio Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
有赞技术团队
有赞技术团队
The Cloudflare Blog
Jina AI
Jina AI
博客园 - 司徒正美
阮一峰的网络日志
阮一峰的网络日志
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

博客园 - 漂泊雪狼

关于SeaTunnel 达梦数据迁移无法自动建表的问题 Kettel链接达梦数据 Elastic Job 入门笔记 记一次Spring boot集成mybatis错误修复过程 Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured. Spring Boot 框架下使用MyBatis访问数据库之基于XML配置的方式 CentOS7下载配置PostgreSQL的pgAgent运行代理作业 ElasticSearch 中文分词搜索环境搭建 学习笔记——Ubuntu下使用Docker包部署禅道任务管理系统 windows下的Redis主从集群搭建 asp.net mvc5中使用Swagger 自动生成WebApi文档笔记 Centos 7.5下搭建SVN源代码服务器 使用Fiddler 4 调用WebService 使用pgrouting进行最短路径搜索 Nginx设置防止IP及非配置域名访问 java 调用c# web api 代码 一台机器部署多个tomcat服务 nginx反向代理多个服务 笔记 利用Kettle 从Excel中抽取数据写入SQLite sql server 统计信息 sql server 索引碎片相关问题
获取geometry边界范围的示例代码
漂泊雪狼 · 2018-03-08 · via 博客园 - 漂泊雪狼

根据sqlserver geometry数据定义获取空间类型边界范围

--获取指定街道边界的xy最大最小值
declare @point_cnt int,@i int,@point geometry,@jdcode nvarchar(50)

set @jdcode='440307006'--街道编码

create table #temp_point(id int identity,x float,y float)
select  @point_cnt =geom.STNumPoints()
from [dbo].[jd]
where jdcode=@jdcode

set @i=1
while @i<=@point_cnt
begin
    select @point = geom.STPointN(@i)
    from [dbo].[jd]
    where jdcode=@jdcode

    insert into #temp_point(x,y)
    values(@point.STX,@point.STY)
    set @i = @i+1
end

select min(x) as minx,min(y) as miny,max(x) as maxx,max(y) as maxy
from #temp_point

truncate table #temp_point;
drop table #temp_point