动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库学院 > 数据库技巧
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
网络编程:ASP教程,ASP.NET教程,PHP教程,JSP教程,C#教程,数据库,XML教程,Ajax,Java,Perl,Shell,VB教程,Delphi,C/C++教程,软件工程,J2EE/J2ME,移动开发
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Access教程,DB2教程,数据库安全,数据库文摘
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ 数据库技巧 ]的信息



本月文章推荐
.SQL Server中单引号的两种处理技.
.深入讲解"database link"的设置和.
.如何实现将Excel表(含多张数据库.
.sqlserver通过脚本创建定时任务.
.通过数据仓库来实现少花钱多办事.
.sql server里面可能经常会用到的.
.SQL Server连接失败错误故障的分.
.SQL Server 本机 Web 服务的使用.
.使用特殊数据.
.SQL Server 2005数据加密技术的实.
.SQL Server 2005(32 位)系统要.
.一种基于记录集查找特定行的方法.
.品味SQL Server 2005的几个新功能.
.数据仓库实施过程所需要考虑的步.
.Data Studio的Web数据服务创建数.
.分析MS SQL Server里函数的两种用.
.分页存储过程2000.
.利用SQL Server 2005减轻生产服务.
.得出SQL语句的执行时间的方法.
.sql server2000导入mdf文件.

扩展微软 SQL Server 的空间功能

发表日期:2007-2-12 |


Make Microsoft SQL Server geospatial

【原文】:http://www.sharpgis.net/2006/05/14/MakeMicrosoftSQLServerGeospatial.aspx

【翻译】:小粟 日期:2007年2月11日

I’ve always thought that on the spatial support, MSSQL was way behind many of the other database servers, in its lack of supporting storage of geometry. With the new .NET CLR you can actually add your own .NET-based object types and I’ve also tried implementing the Simple Features Specification in SQL Server. There are some limitations that made me give this up though. First of all, a user data type cannot be more than 8000 bytes. That is at most no more than 500 vertices in a geometry object, which is far too little for an accurate coastline for instance. Another problem is that SQL Server doesn’t support inheritance chains, so you can’t make a good object-oriented implementation of your datatype either.

… so yesterday I went for a completely different and much simpler approach. I decided to just store the geometry as Well-Known Binary in an image column. The reason for using an image column is that it can hold up to 2Gb of data, which should be sufficient for most geometry objects . A binary field has the same 8000 byte limitation as UDT so this is no good. In addition to the geometry field, I create four real-type fields, holding the min/max values of the geometry envelope. This makes it efficient to do boundingbox based queries on the data. Any additional fields would be attributes for the geometry object.

I implemented the whole thing using SharpMap. First I created a small upload application that takes a shapefile, creates a table in the database and uploads the geometry and attributes to it. SharpMap has the necessary data readers and WKB formatters for this. The second part was to create a data provider from which SharpMap could draw from. I more or less based this on the PostGreSQL/PostGIS data provider for SharpMap, by changing the boundingbox query to use the four envelope fields. All this was not much more than an hour’s work, so it is very simple to accomplish.

I must say I was very surprised by the performance of the approach. It is just slightly faster than the shapefile data provider, which used to be the fastest data provider for SharpMap. In comparison the PostGreSQL/PostGIS is generally 4-6 times slower.

I have created a small demo web-application you can download from here. It contains two pages: one for uploading to the database, and one for rendering a layer from the database. All you need to do is to add an empty SQL Server 2005 Express database to the \App_Data\ folder and name id "GeoDatabase.mdf".

Download SharpMapSqlServer.zip (181,74 KB) (updated May 20, 2006)

Update: The MsSqlProvider is now also included in v0.9RC1, including a method for uploading from any of the SharpMap datasources to MS SQL.

扩展微软 SQL Server 的空间功能

我经常想,在对空间信息的支持上,由于它缺乏对几何体的存储, MSSQL 总是比别的数据库慢了一拍。在新的 .NET CLR 的支持下,你可以真正地添加你自己的基于 .NET 的对象。尽管我也试了下在 SQL Server 中实现简单几何类型的存储,但有一些限制使我不得不放弃了尝试。首先,用户数据类型不能超过 8000 字节。也就是说,几何体对象不能超过 500 个节点,这对像海岸线这样的对象就显得太少了。另一个问题是 SQL Server 不支持继承,所以你也不能对你的数据类型做比较好的面向对象实现。

… 所以昨天我试着找到了一个完全不同的更简单的实现。我决定以 Well-Known Binary 的形式(译者注: OpenGIS 的说明书中定义了两个表述空间对象的标准方式:一个是 WKT ( the Well-Known Text )形式,另一个是 WKB ( the Well-Known Binary )形式)存储几何体在一个图像列中。使用图像列的目的是它能够保存大到 2G 的数据,这对大多数的几何对象都足够了。而字节列和用户自定义类型一样,也有 8000 个字节的限制,所以也不够好。除了几何列之外,我还创建了四个实数类型的列,用来存储几何外接矩形框的最大最小坐标值。这能提高基于外接矩形框的查询的效率。其它的列用来存储几何体的属性。

我在 SharpMap 中实现了这个方法。首先,我建立了一个小的数据库导入程序用来导入 shapefile 文件。它在数据库中建立一个表,然后把几何体及其对象导入其中。 SharpMap 为其提供了必要的数据读取器和 WKB 格式化程序。第二个部分是建立了一个数据提供接口, SharpMap 能够基于这个接口绘制数据。我做这些时多少参照了 PostGreSQL/PostGIS 的数据提供接口,只是用四个外框坐标列来做外接矩形框查询。所有这些工作所发费的时间不超过一个小时,因此,可以说做起来是比较简单的。

我必须说,对于这种方法的效率我是很惊讶的。它比 shapefile 的数据接口还快一点点,而 shapefile 数据接口曾经是 SharpMap 中最快的数据接口。而 PostGreSQL/PostGIS 相比而言要慢 4 - 6 倍。

我在这里创建了一个可下载的 web 演示程序。它分为两页:一个是导入到数据库,另一个是从数据库读取数据和绘制图层。所有你要做的是在 \App_Data\ 文件夹中增加一个 SQL Server 2005 Express 数据库并把它命名为 "GeoDatabase.mdf" 。

下载 http://www.sharpgis.net/ct.ashx?id=d3710d85-a735-4efc-aad7-f9c8f4844c1e&url=http%3a%2f%2fwww.sharpgis.net%2fcontent%2fbinary%2fSharpMapSqlServer.zip (181,74 KB) (2006 年 5 月 20 日更新 )

更新:现在, MSSQL 数据接口也包含在 0.9RC1 版中,包含一个导入所有 SharpMap 支持的数据格式到 MS SQL 的方法。

译注:这是一篇比较长的文章,花了我大约一个半小时的时间,但是还是翻译得比较粗糙,请大家改进。


上一篇:如何清除SQL日志 人气:7451
下一篇:SQL Server实用经验与技巧大汇集 人气:3969
浏览全部SQL Server的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-5 360安全卫士 V4.2.0.1004
2008-7-5 PHPDug v2.0 多国语言版
2008-7-5 乘风电影程序 v3.69 (SQL)
2008-7-5 乘风电影程序 v3.69
2008-7-5 wfTextImage文字图像组件 v1.5
2008-7-5 ZY music! v1.1.0705
2008-7-5 FavShop网店系统 v1.0
2008-7-4 天空网络电影系统SKYUC v2.5.1 B
2008-7-4 Drupal v7.x-dev Build 080704
2008-7-5 AgileMessenger即时通讯工具 v1.
2008-7-5 GoodCalculator2.0版固件计算器
2008-7-5 RepoName源地址搜索工具 v1.21b
2008-7-5 AgileMessenger即时通讯工具 v1.
2008-7-5 TouchCopy多媒体管理软件 v3.13完
2008-7-5 VideosTone视频铃声 v1.1汉化破解
2008-7-5 TouchPad触摸板 v4.44破解版
2008-7-5 VideosTone破解补丁 v1.0
2008-7-5 Feeds GoogleReader客户端 v0.4.3


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報