资源描述:
《空间数据库课程设计1》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、空间数据库课程设计姓名:李杨学号:20101001955班号:191104日期:2012-06-03专业:计算机学院计算机科学与技术(空间信息与数字技术方向)空间数据的加载、传输、验证1创建sales_regions表1.1创建一个表来表示销售区域:1.2插入一个多边形几何体:INSERTINTOsales_regionsVALUES(10000,--SALES_REGIONSIDSDO_GEOMETRY--usetheSDO_GEOMETRYconstructor(2003,--Atwo-dimensionalP
2、olygon8307,--SRIDisGEODETICNULL,--SDO_POINT_TYPEisnullasitisnotapointSDO_ELEM_INFO_ARRAY(1,1003,1),--ApolygonwithjustoneringSDO_ORDINATE_ARRAY--SDO_ORDINATESfield(-77.04487,38.9043742,--coordinatesoffirstvertex-77.046645,38.9040983,--othervertices-77.04815,38.
3、9033127,-77.049155,38.9021368,-77.049508,38.9007499,-77.049155,38.899363,-77.048149,38.8981873,-77.046645,38.8974017,-77.04487,38.8971258,-77.043095,38.8974017,-77.041591,38.8981873,-77.040585,38.899363,-77.040232,38.9007499,-77.040585,38.9021368,-77.04159,38.
4、9033127,-77.043095,38.9040983,-77.04487,38.9043742--coordinatesoflastvertexsameasfirstvertex)));2加载和转换空间数据2.1用SQL*Loader从文本文件中加载加载点sales_regions数据的控制文件LOADDATAINFILE*INTOTABLEsales_regionsAPPENDFIELDSTERMINATEDBY'
5、'TRAILINGNULLCOLS(idNULLIFID=BLANKS,geomCOLUMN
6、OBJECT(SDO_GTYPEINTEGEREXTERNAL,SDO_POINTCOLUMNOBJECT(XFLOATEXTERNAL,YFLOATEXTERNAL)))BEGINDATA1
7、2001
8、-76.99022
9、38.888654
10、2
11、2001
12、-77.41575
13、38.924753
14、运行结果如下:注意:SQL*Loader不能处理多于64KB的数据记录。2.2在Oracle数据库之间传输空间数据导出表:授权:导入:导入成功:2.3在SDO_GEOMETRY和WKT/WKB之间的转换2.4在GML和SD
15、O_GEOMETRY之间转换数据1把一个三维立方体SDO_GEOMETRY类型转换成GML3验证空间数据3.1在VALIDATE_GEOMETRY_WITH_CONTEXT中使用diminfoSELECTSDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(SDO_GEOMETRY--firstargumenttovalidateisgeometry(2001,--pointtypeNULL,SDO_POINT_TYPE(-80,20,NULL),--pointis<-80,20>andi
16、soutofrange.NULL,NULL),SDO_DIM_ARRAY--secondargumentisdiminfo(oftypeSDO_DIM_ARRAY)(SDO_DIM_ELEMENT('X',0,50,0.5),--lower,upperboundrangeis0to50SDO_DIM_ELEMENT('Y',0,50,0.5)--lower,upperboundrangeis0to50))is_validFROMDUAL;结果:3.2在VALIDATE_GEOMETRY_WITH_CONTEXT中使
17、用toleranceSELECTSDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(SDO_GEOMETRY--firstargumenttovalidateisgeometry(2001,--pointtypeNULL,SDO_POINT_TYPE(-80,20,NULL),--pointnotoutofrangeasnoran