SQLSever插入空间数据

IF OBJECT_ID ( ‘dbo.SpatialTable‘, ‘U‘ ) IS NOT NULL  
    DROP TABLE dbo.SpatialTable; 
GO

CREATE TABLE SpatialTable  
    ( id int IDENTITY (1,1), 
    GeomCol1 geometry,  
    GeomCol2 AS GeomCol1.STAsText() ); 
GO

INSERT INTO SpatialTable (GeomCol1) 
VALUES (geometry::STGeomFromText(‘LINESTRING (100 100, 20 180, 180 180)‘, 0));

INSERT INTO SpatialTable (GeomCol1) 
VALUES (geometry::STGeomFromText(‘POLYGON ((0 0, 150 0, 150 150, 0 150, 0 0))‘, 0)); 
GO

时间: 2024-07-30 20:31:35

SQLSever插入空间数据的相关文章

SQL Server 2008空间数据应用系列五:数据表中使用空间数据类型

原文:SQL Server 2008空间数据应用系列五:数据表中使用空间数据类型 友情提示,您阅读本篇博文的先决条件如下: 1.本文示例基于Microsoft SQL Server 2008 R2调测. 2.具备 Transact-SQL 编程经验和使用 SQL Server Management Studio 的经验. 3.熟悉或了解Microsoft SQL Server 2008中的空间数据类型. 4.具备相应(比如OGC)的GIS专业理论知识. 5.其他相关知识. 通过前面几篇文章介绍了

EF框架操作postgresql,实现WKT类型坐标的插入,查询,以及判断是否相交

1.组件配置 首先,要下载.NET for Postgresql的驱动,npgsql,EF6,以及EntityFramework6.Npgsql,版本号 3.1.1.0. 由于是mvc项目,所以,把相应的配置文件写在web.config里面,如下: 1 <configSections> 2 <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?L

SqlSever基础 convert 将类型为字符的一列转成Int类型后进行排序

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 base code 1 use master 2 drop database helloworld 3 4 --创建一个数据库 5 create database helloworld 6 7 --用helloworld1这个数据库 8 use helloworld 9 10 --创建一个表格

SqlSever基础 union 将得到的横表变为纵表

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 base code 1 use master 2 drop database helloworld 3 4 --创建一个数据库 5 create database helloworld 6 7 --用helloworld1这个数据库 8 use helloworld 9 10 --创建一个表格

Mysql空间数据,空间索引,Spatial Data,Spatial Index

前文: 这两天因为项目原因看了一下MySQL的空间索引,发现网上的资料不多,查了一下官方文档,为了强化记忆做了一个简单的翻译.基本上理解了mysql空间索引的要点.谨以此纪. Extensions for Spatial Data Open Geospatial Consortium (OGC) 是一个由超过两百五十个公司,机构,大学组成的致力于发展管理空间数据的解决方案的组织. OGC 发布了OpenGIS® Implementation Standard for Geographic inf

SqlSever基础 left join 左联 实例

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 code 1 --创建一个数据库 2 create database helloworld1 3 4 use master 5 drop database helloworld1 6 7 --用helloworld1这个数据库 8 use helloworld1 9 10 --创建一个表格te

SqlSever基础 where between and

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 code 1 --创建一个数据库 2 create database helloworld1 3 4 --用helloworld1这个数据库 5 use helloworld1 6 7 --创建一个表格teacher 8 create table Teacher 9 ( 10 Id int p

SqlSever基础 where [] 一个字符的限制条件出现逻辑或的效果

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 code 1 --创建一个数据库 2 create database helloworld1 3 4 --用helloworld1这个数据库 5 use helloworld1 6 7 --创建一个表格teacher 8 create table Teacher 9 ( 10 Id int p

SqlSever基础 where &gt;= 查看一列中大于指定内容的所有行的全部内容

镇场诗:---大梦谁觉,水月中建博客.百千磨难,才知世事无常.---今持佛语,技术无量愿学.愿尽所学,铸一良心博客.------------------------------------------ 1 code 1 --创建一个数据库 2 create database helloworld1 3 4 --用helloworld1这个数据库 5 use helloworld1 6 7 --创建一个表格teacher 8 create table Teacher 9 ( 10 Id int p