原文比较多,大家可以去msdn上下载,废话挺多,我就随便说说,因为还没有下载真正应用,可能会有问题。 1、支持两种数据类型,geography和geometry,分别对应经纬度和迪卡尔两种坐标系,前者就是度分秒;后者是x y的,不知道带不带z,可能不带,因为后面的三维空间查询与二维的差别会很大。至于投影,也许不是它的任务了。(有待确认)
2、能够导入导出OGC定义的几种格式wkb,wkt,gml
3、Virtual Earth能够看数据
4、给了几个sql语句例子
CREATE TABLE Districts
( DistrictId int IDENTITY (1,1),
DistrictName nvarchar(20),
DistrictGeo geometry);
GO
CREATE TABLE Streets
( StreetId int IDENTITY (1,1),
StreetName nvarchar(20),
StreetGeo geometry);
GO
上面两个是建表,也许在那种“企业管理器”中可以选择一下字段类型吧
INSERT INTO Districts (DistrictName, DistrictGeo)
VALUES ('Downtown',
geometry::STGeomFromText
('POLYGON ((0 0, 150 0, 150 150, 0 150, 0 0))', 0));
INSERT INTO Districts (DistrictName, DistrictGeo)
VALUES ('Green Park',
geometry::STGeomFromText
('POLYGON ((300 0, 150 0, 150 150, 300 150, 300 0))', 0));
INSERT INTO Districts (DistrictName, DistrictGeo)
VALUES ('Harborside',
geometry::STGeomFromText
('POLYGON ((150 0, 300 0, 300 300, 150 300, 150 0))', 0));
插入多边形,不知道正方形算不算哦,而多边形内部空了的话,坐标序列如何呢?也许和windows编程的序列一样
INSERT INTO Streets (StreetName, StreetGeo)
VALUES ('First Avenue',
geometry::STGeomFromText
('LINESTRING (100 100, 20 180, 180 180)', 0))
GO
INSERT INTO Streets (StreetName, StreetGeo)
VALUES ('Mercator Street',
geometry::STGeomFromText
('LINESTRING (300 300, 300 150, 50 50)', 0))
GO
看来是插入一条多点的线
SELECT StreetName, DistrictName
FROM Districts d, Streets s
WHERE s.StreetGeo.STIntersects(DistrictGeo) = 1
ORDER BY StreetName
查询相交,不知道有几种相交方式了(其实是空间关系的定义了,esri好像是12种),DistrictGeo这个玩意儿怎么定义呢?
小结
我曾说过,SDE就那么回事,空间数据库又能牛到怎么样呢?关键是要将地图展现出来,然后做很多实用的功能,这也是我们程序员挣钱的地方了。