shp导oracle spatial方案
Oracle Spatial和MapViewer使用案例说明书
Oracle Spatial and MapViewer Use Cases Dr. Kerem ParCTOOracle OpenWorld 2014September 30, 20141993Management Team s tarted working o n L BS in 1993Restructured i n 2007a=er a cquisi?on1996First V ehicle Tracking Projects w ith Demirbank2000Company established in y ear 20002004ORACLE M obile Developer o f t he year A ward w ith Turkcell E kipMobil2007Oracle Innova?on Award f or Infomobil2013Oracle Excellence Award f or Loca?onbox İn 20142014• SoSware V endor• Map D ata P roducer• Service P rovider• Strategic P artnerships• Oracle: s pecialized p artner i n s paDal t echnologies i n E MEA r egion• M2M / V ehicle T racking a nd F leet M anagement • InteracDve W eb M apping A pplicaDons• LocaDon B ased S ervices• GIS S oluDons• Data P roducDon• Research P rojects f ocusing I ntelligent V ehiclesInfomobil• Cloud b ased M2M / V ehicle T racking a nd F leet Management P la^orm• 50.000+ M obiles• 800+ C ompanies• 10.000+ U sers• Services• Tracking• Telemetry• Repor?ng• Alarms & N o?fica?ons• Web, M obile, S MS, S ocial M edia i nterfaces • Different T racking H W O p?ons• Turkcell B est M2M SoluDon A wardApplication DataVector and Raster Map Data Network Data Model, POI Data Metadata (Maps, Themes, Styles)Oracle Database Server 11g R2 Enterprise Edition + Spatial and Graph + PartitioningOracle WebLogic Server Enterprise Edition + MapViewerADF W eb ApplicaDon SMS G ateway MMS G ateway Email G atewayMessage ProcessorsMobile W eb ServicesIntegraDonWebServicesRouDng ServerTCPIP G ateway Oracle Network Data ModelVehicle HardwareMessaging and Navigation AppMobile Interfaces iOS, AndroidWeb Interfaces3rd party ApplicationsOracle Java ProcessesSOAP Web ServicesOracle ADF ApplicationsReverse Geocoding Map M atchingx, y , zPOI Regions Points Route v iola?onsAddress: C ountry, P rovince, D istrict, Neigboorhood, … Road s egmentSpeed l imit v iola?ons Nearest P OIDistance, h eadingRegion, t erritory, s ervice a rea, …. Distance t raveled i n t he r egionNearest c ompany l oca?onDistance, c heckins, c heckouts, a pproaching Routes10+ b illion r ows / y ear 30+ m illion m essages / d ay ~2000 T psLocationBox• LocaDon B ased A pplicaDon D evelopment P la^orm• Infotech’s C ontent + L BS F unc?onality• 50+ p artners• Cloud b ased / o n p remise• Services• Mapping• Geocoding / R everse G eocoding• Rou?ng• Traffic• POI S earch / D isplay• Address S ervices• Campaigns, S ocial E vents• Map b ased r epor?ng / H eat M aps / S pa?al A nalysis • User D ata (Point, L ine, P olygon)• User D efined P OI A iributes• …Vector and Raster Map Data POI, Traffic, Risk, Demographic Data User Data (Point, Line, Polygon) Metadata (Maps, Themes, Styles)Oracle Database Server 11g R2 Enterprise Edition+ Spatial and GraphOracle WebLogic ServerEnterprise Edition+ MapViewer + Routing ServerJavaScript A PI Web S ervices A PI Mobile S DK (iOS, A ndroid) RouDng Server BI I ntegra?on Mobile Applica?ons Loca?on B ased Services Spa?al A naly?cs Applica?ons Enterprise Applica?on Integra?on Web M apping Applica?ons• Turkish C redit R egistry Office• 145 m embers• Geocoding• 800+ m illion n a?onwide c redittransac?ons• 40 m illion t ransac?ons / d ay • Map b ased r eporDng• Standard R eports• Trend R eports• Benchmark R eports• BI I ntegraDon• LocaDonBox o n E xadata• GSM O perator• 14.5 m illion s ubscribers • Consolidated A pplicaDons • Coverage A nalysis• Asset T racking• CRM I ntegra?on• Nearest P harmacy• BI I ntegra?on• LocaDonBox o n E xadata• LocaDon b ased r isk m anagement • Policy l ocaDons• EdiDng h igh r isk z ones• Earthquake, F ire, F lood, S torm,Terrorism• Decision s upport s ystem• Risk s coring• ReporDng b y s paDal a nalysis• PML R eports• LocaDonBox o n E xadata• Parcel D elivery• 900 B ranches• 12 m illion d eliveries / d ay • OperaDonal• Edi?ng s ervice a reas• Geocoding a ddresses• Loca?on b ased d eliverydes?na?on• Analysis• Map b ased r epor?ng• Polygon a nalysis• BI I ntegra?on• Branch/ATM L ocaDons• CompeDDon A nalysis• Service A reas• ReporDng• Branch / A TM S coring• Market S hares• Repor?ng b y s pa?al a nalysis • Branch, A TM l ocator o n p ublicweb s ite• Site S elecDon• CompeDDon A nalysis• Region b ased• Route b ased • Sales P lanning• Performance S coring • Market S hares• Map b ased r eporDng• Restaurant C hain• Branch, D elivery L ocaDons • Service A reas• ViolaDons• CompeDDon A nalysis • Site S elecDon• PotenDal A nalysis• Polygon A nalysis• Private S chools• 90 C ampuses• 55.000 S tudents• Site S elecDon• Campus, S tudent L ocaDons • Service A reas• Distance Z ones• PotenDal A nalysis• ReporDng b y S paDal A nalysisGIS• Consolidated G IS P la^orm• 2.000.000 p opula?on, 6th i n T urkey• 39.000 k m2, l argest c ity i n a rea, 31 d istricts• 1000+ G IS u sers (%90 r ead o nly, %10 e di?ng)• Diverse D ata T ypes• Vector, R aster, O blique I magery, 3D B uildingModels• ApplicaDons• 2D C ity G uide A pplica?on (web)• 3D C ity G uide A pplica?on (web, m obile)• GIS a pplica?ons (read o nly + m ap e di?ng)• BI I ntegra?on• Replacement o f M apInfo M apXtreme, G eoServer, OpenLayersGIS A rchitectureGIS Application Data Vector and Raster Map Data, Oblique Imagery Network Data Model, 3D Building Models Metadata (Basemaps, Themes, Styles)Oracle Database Server 11g R2Enterprise Edition+ Spatial and GraphOracle WebLogic ServerEnterprise Edition+ MapViewer+ Business IntelligenceGIS A pplicaDons City G uide 3D C ity G uideBI Dashboards 3rd Party ApplicationsWFS RouDng Server SpaDal W eb Services WMS, WMTSLocation Based Services• Ekipmobil -‐ T racking a ndWorkforce M anagement• 70.000+ M obiles• 8.000 C ompanies• 10.000+ U sers• GSM P osi?oning• 10 m illion t ransac?ons / d ay• Nearest P OI• Traffic• Weather• AgricultureInfrastructureInfotech I nfrastructureOracle E XADATA Database M achineOracleWebLogicClusterMapLink• Design P hilosophy• NaDvely s tore s paDal d ata i n d atabase• Analyze a nd v isualize b y u sing S QL• Standard C omponents• Oracle D atabase S erver & O racle W ebLogic S erver• Performance• Fast, R obust• High N umber o f T ransacDons• FuncDonal R equirements• Capable, C omplete• SpaDal D ata T ypes, F uncDons & O perators, D ata S ize, …• Non F uncDonal R equirements• AdministraDon, B ackup, R estore, D isaster R ecovery, S calability, S ecurity, P erformance T uning, … • BI I ntegraDon• Database C onsolidaDon• Single P la^orm f or M ixed W orkloads• OLTP• ReporDng• Performance• 5.2x f aster t ransacDon p rocessing• 100x f aster r eports• Storage• 5x c ompression• Easy S calability• Easy M anageability• Fast S paDal O peraDons。
基于Oracle Spatial技术的地理信息管理与优化
关键 词 : 甲骨文 空 间数 据 管理 ;MaX组件 ; 一体化 存储 ; 邻近 分析 ;数据 转换 p
中 图法分 类号 : P 9 T 327 T 3; P0.
( ol e f o ue c ne ii va o iesyo hn ,Taj 0 3 0 hn ) C l g mp tr i c,Cvl i in e oC Se t Unvri f ia i i 3 0 0 ,C i A t C nn a
Ab t a t W h n g o r p i f r t ni n g db a X o o e t s a i l aaa da t b t a r e a ae dt ee c e c sr c : e e g a h ci o ma i ma a e yM p c mp n n , p t t t i u ed t a es p r td a f i n y n o s ad n r a n h i o a aq e y i n t ih Ba e n t et c n l g f a l p t l t eit g ai n so a ea dm a a e n ei lme t d At h fd t u r s o g . h s do e h o o y o ce s ai , h e to r g n g me t h Or a n r t n r a mp e n e . e t s met a me b s f p c p r t r ep o i t n l ss t ee c e c f p t l a a u r r v d a da fe tv l t n i , y u eo s a eo e a o s ot r x mi a ay i, h f i n y o s a i t e i i t h y i a d q y s mp o e , n n e ci es u i o o
oraclespatial常见使用错误解决办法
ORACLE SPA TIAL常见错误解决办法1、ORA-13226:没有空间索引接口将不被支持当使用一个空间操作符时,如果没有使用空间索引导致该操作符不能被完成将会返回该错误。
这可能会发生在当你使用的列上没有空间索引、或者优化器没有选择以所用为基础进行计算时。
解决办法:如果在空间操作符的列上没有索引,就创建一个索引。
如果优化器没有选择空间索引,那么久显式地指定index或ordered以确保空间索引被使用。
例如:select b.gwm_fid, b.gwm_fno, b.gwm_vno, a.gwm_tileid, b.districtidfrom gs_tile_p2 a, VP_street_area bwhere b.gwm_vno = 13001and b.deletetag = 0and b.gwm_status = 0and sdo_relate(a.gwm_geometry, b.gwm_geometry, '' MASK = ANYINTERACT '') = '' TRUE '';查询提示该错误,原因gs_tile_p2该表没有创建控件索引。
2、ORA-13203:读取USER_SDO_GEOM_METADA TA视图失败如果在USER_SDO_GEOM_METADA TA视图中对没有任何元数据的表进行索引,就会返回该错误。
解决办法:在该视图中插入一条与空间层相关的记录。
比如:CREA TE INDEX INDEX_GS_TILE_P2 ON GS_TILE_P2(GWM_GEOMETRY)INDEXTYPE IS MDSYS.SPA TIAL_INDEX;提示ORA-13203错误,经查询发现没有在元数据中插入记录。
INSERT INTO USER_SDO_GEOM_METADA TA(TABLE_NAME, COLUMN_NAME, DIMINFO, SRID)V ALUES ('GS_TILE_P2', 'GWM_GEOMETRY',MDSYS.SDO_DIM_ARRAY(MDSYS.SDO_DIM_ELEMENT('X', -5000000, -5000000, 0.000000050),MDSYS.SDO_DIM_ELEMENT('Y', -5000000, -5000000, 0.000000050),MDSYS.SDO_DIM_ELEMENT('Z', 0,0, 0.000000050)),NULL);3、ORA-13365:层的SRID与几何体的SRID 不符该错误暗示着在一个表的几何体中的SRID与USER_SDO_GEOM_METADA TA视图中相应的SRID值不符。
Oracle数据库10g GIS应用开发:使用Oracle Spatial网络数据模型说明书
Oracle Database 10g: Building GIS Applications Using the Oracle Spatial Network Data ModelAn Oracle Technical White PaperMay 2005Table of Contents Abstract (3)Introduction (3)Oracle Spatial Network Data Model (5)Network Data Model Schema (5)Network Metadata (6)Network Tables (6)Oracle Spatial Network Data Model APIs (6)Network Data Model Analysis Capabilities (7)Modeling Network Applications (8)Network Constraints (8)Java Representations of Network Elements (8)Software Requirements (9)Using the Network Data Model (9)1. Create a Network (9)2. Visualize or Edit the Network (9)3. Analyze the Network (9)Network Data Model Editor (9)GIS Applications using the Network Data Model (10)Network Tracing Applications (10)Network Routing Applications (10)Network Allocation Applications (11)Using Network Constraints in Analysis (11)New Features in the Oracle Spatial 10g Network Data Model (13)Network Modeling: Link Direction (13)Network Analysis: Maximum Flow Analysis (14)PL/SQL Wrapper Package (14)Conclusion (14)References (14)ABSTRACTNetwork modeling, management, and analysis are common tasks for Geographic Information Systems (GIS). Network analysis includes routing (path computation) in transportation networks, tracing (accessibility) in utility networks, and resource allocation in decision-making and customer relationship management (CRM) applications. In this paper we present the Oracle Spatial network data model, an Oracle Database release 10g feature that lets users model and analyze networks. This feature simplifies network modeling, analysis, and management so that users can focus on application logic. The network data model provides an open, generic data model with many common GIS analysis capabilities. In addition, it fully supports Oracle Spatial objects of type SDO_GEOMETRY. GIS applications based on the Oracle Spatial network data model are discussed in this paper. INTRODUCTIONThere are two common types of GIS applications: applications that deal with spatial proximity, and applications that deal with both spatial proximity and connectivity. For many applications queries on spatial proximity, which mainly consider metrics like Euclidean or geodetic distances, are sufficient. However, there are instances when connectivity needs to be taken into account, such as in finding the shortest distance between two locations in a road network. Many GIS applications are networks that require modeling and analysis on object relationships (connectivity). Figure 1 shows a road network of New York City.Figure 1. New York City Road Network (60384 nodes, 151962 links. Source: NavStreets from NavTech)Oracle Spatial has supported spatial objects since release 8.1.5. A complete set of indexes, operators, and functions is available for managing information based on spatial proximity. The network data model extends Oracle Spatial to deal with connectivity. Currently there are many GIS vendors offering network solutions; however, their solutions may have the following issues:• Their data model is stored in proprietary file formats, and cannot be integrated with their database.• The data model and analysis capabilities cannot be extended.• Application information cannot be separated from connectivity information.• Spatial information management and hierarchical relationships are not directly supported.To address these issues, Oracle Spatial network data model does the following: • Provides an open and persistent network data model.The network data model is stored as relational tables in the database and ismanaged through SQL.• Simplifies network data management and analysisPL/SQL and Java APIs are provided for network data management andanalysis.• Separates connectivity and application information in the data model Connectivity information can be separated from application information.Both application information and connectivity information are managed inthe database. However, only connectivity information is required fornetwork analysis.• Allows the extension of data model and analysis capabilitiesThe Java API provides representations of network elements as JavaInterfaces. Users can define their own network elements by extendingthese interfaces. As a result, users can implement their own user-definedrepresentations and analysis functions.• Integrates with Oracle Spatial technology for spatial information managementThe network data model supports all Oracle Spatial data types.This paper is organized as follows: it presents the network data model database schema, APIs and architecture; shows how to use the data model; presents several GIS network applications built on top of the data model; discusses how to use network constraints to enhance analysis capabilities; and discusses the network data model editor that is used to edit and visualize networks.ORACLE SPATIAL NETWORK DATA MODELThe network data model consists of two parts: a network schema and network APIs. The network schema is the persistent data storage used to store network information. The network APIs contain a PL/SQL package for data management in the database and a Java API for data management and analysis on the client-side (via Java JDBC drivers).Network Data Model SchemaA network contains network metadata, a node table, and a link table. In addition, path information (path table and path-link table) can be stored with the network if desired. Figure 2 shows a schematic view of a network in the database. Note that only connectivity information is stored. Additional application information can be stored in the network tables, or in other tables and referenced by foreign keys.Figure 2. Oracle Network Data Model (Schematic View)Network MetadataNetwork metadata provides general information about networks. It includes the following network details:• Directed or undirected• Logical or spatial• Hierarchical or flat• Information about nodes, links, and paths• Geometry information -- for spatial networksNetwork TablesAn Oracle network contains two tables: a node table and a link table. A path table can be added if needed. Figure 2 shows the schema for the network data model, which includes these tables. The schema represents the information necessary for network management and analysis. Application attributes can be added to these tables or referenced from other application tables (through foreign keys). Note that the network data model is also capable of handling geometry information. That is, the network data model can represent both logical and spatial network applications. Adding geometric data to a logical network will allow the logical network to be displayed.Oracle Spatial Network Data Model APIsThe network data model provides a PL/SQL API and a Java API for network management on the database and client sides. The Java API can also be used for network analysis. The three-tiered network data model application architecture is shown in Figure 3.Figure 3. Network Data Model ArchitectureNetwork Data Model Analysis CapabilitiesThe following analyses are supported in the network data model:• Shortest Path: The shortest path from node A to node B• Accessibility Analysis: Is node A accessible from node B?• Minimum-Cost Spanning Tree: What is the minimum-cost tree that connects all nodes?• Within Cost Analysis: What nodes are within a given cost from (to) a given node?• Nearest Neighbors: What are the N nearest neighbors of a given node?• K Shortest Paths: What are the K shortest paths from node A to node B?• Connected Components Analysis: Label connected components with IDs.• Graph Operations: Graph union, intersection, and difference.• Traveling Salesman Problem: What is the minimum-cost tour that visits a set of cities?• Single Source, Single Sink Maximum Flow Analysis: What is the maximum allowable flow that can flow from the source node to the sink node?(Oracle Spatial 10g Release 2)Modeling Network ApplicationsThe network data model takes a generic approach to solving network problems, by separating connectivity information from application-specific information. Figure 4 shows how a typical network application can be modeled and analyzed. First the network connectivity information (node connections and link cost) is extracted and separated from the application-specific information. Application-specific attributes are stored, if needed, with the connectivity information or separately. Once the connectivity information is extracted, network analysis is conducted on the generic model. Additional network constraints can also be considered. The final result is then mapped to application-related attributes, and displayed. This approach avoids customized network solutions and simplifies the data management of connectivity and application-specific information.Figure 4. Network Modeling and Analysis Using the Network Data ModelNetwork ConstraintsThe network data model introduces the concept of network constraints, which provides a mechanism to guide network analysis. For example, you may want to compute the shortest path that passes through network links of a specific type. With network constraints, applications can easily incorporate application-specific logic into the network data model analysis engine without knowing how the engine works. Other constraints, such as path depth, or cost, can also be included in analysis. The network constraint is a Java interface and must be implemented by the application.Java Representations of Network ElementsThe Java network representations (network, nodes, links, and paths) are defined as Java interfaces and can therefore be extended. These interfaces specify the necessary behaviors for the network and its elements. In addition to these interfaces, user-defined analysis functions can be used by applications, allowing the modeling and analysis capabilities of the network data model to be extended.Software RequirementsThe Spatial network data model is shipped with Oracle Database release 10g. The PL/SQL package is pre-loaded in the database and required Java .jar files are provided; the Java API supports JDK (or JRE) version 1.3 or later. The network editor is also included as a utility tool for the network data model. For more information, see the Oracle Spatial Topology and Network Data Models manual. USING THE NETWORK DATA MODELThis section explains the usage of the network data model. There are three major steps.1. Create a Network1. Create and populate network tables and add metadata to the database.2. Create a Java network object using the Java API and save it to thedatabase.2. Visualize or Edit the Network1. Load a network from the database or an XML representation.2. Visualize or edit the Java network object using the network data modeleditor. Store the network in the database, if needed.3. Analyze the Network1. Load a network into a Java network object.2. Conduct network analysis. Save the path results, if needed.NETWORK DATA MODEL EDITORThe network data model editor is a standalone Java application that helps create, edit, and visualize networks. The editor supports viewing operations such as pan, zoom, and auto-fit. It also provides functions to navigate between network elements. All analysis functions are supported in the editor. With the editor, users can create a network from scratch in the client-side and save it to the database. The editor is configurable on element styles, colors, and sizes. Figure 5 shows the network data model editor.Figure 5. Network Data Model EditorGIS APPLICATIONS USING THE NETWORK DATA MODELGIS network analysis may include network tracing, network routing, and network allocation.Network Tracing ApplicationsTracing applications deal with queries like Is node A reachable from node B? or What are the nodes that are reachable or can be reached from a given node? Such queries are common in water or utility networks. Another type of tracing analysis is to find out how many connected components are in a network. Figure 6 shows some such queries.Figure 6. Reachable and Reaching AnalysisNetwork Routing ApplicationsRouting analysis or path computation, probably the most studied topic in network applications, is divided into the following categories:• Shortest Path or Fastest Path (transitive closure problem) (see Figure 7).• K Shortest Paths: Find k shortest paths from a start node to a destination node.• Traveling Salesman Problem (see Figure 7): Find a minimum-cost tour that passes a set of locations.Figure 7. Shortest Path and Traveling Salesman ProblemNetwork Allocation ApplicationsAllocation analysis deals with designating destination points within a network. It provides information on a service area or coverage for points of interest. The network data model supports the following allocation analyses (see Figure 8):• Within Cost: Find all points of interest within a certain distance from a designated location.• Nearest Neighbors: Find the N nearest restaurants to a designated location.• Minimum-Cost Spanning Tree: Find the cheapest way to connect all nodes.Figure 8. Nearest Neighbors, Within Cost, and Minimum Cost Spanning Tree AnalysisUsing Network Constraints in AnalysisConstraints are conditions to be satisfied during analysis. The network data model supports network constraints so that applications can impose application-specific conditions on the network during analysis. The Java interface NetworkConstraint canbe implemented by the user, and passed into any network data model analysis function. Figure 9 shows analysis information that is available for users to implement their network constraintsFigure 9. Analysis Information for Network ConstraintsThe following are some examples of network constraints:• Depth (number of links), cost, and MBR constraintsNetwork analysis can be limited based on the depth of the search path, thecost limit, or the area (minimum bounding rectangle) where the analysisoccurs. These constraints can be used to specify a preferred subset ofpossible solutions. The network data model provides a SystemConstraintclass (which implements the NetworkConstraint class) for these commonnetwork constraints. Users can create an instance of SystemConstraint anduse it in analysis.• Temporarily inactivated nodes or linksSometimes nodes or links must be temporarily turned off before analysisbegins, for example, road segments (links) under construction in a roadnetwork, or water valves (nodes) shut down for repair in a water network.You can make a node or link inactive by setting its state to false. Networkelements that are inactive will not be considered during analysis. Note thatchanging the state of nodes and links does not affect the persistent datamodel.• Routing with specific types of links and nodesSometimes network analysis must only be conducted through nodes andlinks of specific types or with specific requirements.• Turn restrictionsTurn restrictions are constraints involving two links. They are common inrouting for transportation networks. In the following example, aprohibited turn is represented by a start link and an end link (see Figure10). For intersections with turn restrictions, such as no “U” turn or no leftturn, if the search encounters the start link of a prohibited turn, the searchdoes not continue through the end link of that prohibited turn. This typeof restriction can be easily modeled using NetworkConstraint, sinceinformation on the current link and next link is made available to users.Figure 10. Turn Modeling for Road NetworksNEW FEATURES IN THE ORACLE SPATIAL 10G NETWORK DATA MODELWith Oracle Spatial 10g Release 2, the network data model provides the following features:Network Modeling: Link DirectionThe directionality of a link can be further specified at the link level. Unlike the network directionality that determines the directions of all links, a directed network can have links that are directed or bi-directed. A BIDIRECTED column can be added to the link table and used to indicate if a directed link is bi-directed. This modeling enhancement will reduce the storage requirement for directed networks with non-homogeneous link directions (unidirectional and bidirectional).Network Analysis: Maximum Flow AnalysisThe maximum flow analysis function is provided for a single source and single sink flow network. Each link in a flow network has a flow capacity associated with it. The goal of this function is to find the maximum allowable flow that can flow from the source node to the sink node. This type of analysis is commonly seen in communication or logistics network planning.PL/SQL Wrapper PackagePrior to Oracle Spatial 10g Release 2, only the network data model Java API could be used for network editing and analysis. Now, a PL/SQL wrapper package is also provided that helps users edit and analyze networks in PL/SQL. This wrapper package provides nearly equivalent functionality as the Java API. It is done through database Java stored procedures and Java virtual machine in Oracle. CONCLUSIONThe Oracle Spatial network data model, available with Oracle Spatial 10g, is a generic network (graph) modeling and analysis environment for network applications. GIS applications for routing, tracing, and allocation have been discussed. The network data model provides an open, easy-to-use, scalable, efficient, and manageable approach to developing GIS network applications. We are currently working with our customers and partners to extend the modeling and analysis capabilities of the network data model.REFERENCESOracle Spatial Topology and Network Data Models, Oracle Corporation.Oracle Spatial User’s Guide and Reference, Oracle Corporation.Oracle Linear Referencing System: A Technical White Paper, Oracle Corporation. Oracle Spatial Network Data Model: A Technical White Paper, Oracle Corporation.Building GIS Applications Using the Oracle Spatial Network Data Model: An Oracle Technical White Paper May 2005Author: Jack Chenghua WangContributors: Vishal Rao, Nicole AlexanderOracle CorporationWorld Headquarters500 Oracle ParkwayRedwood Shores, CA 94065U.S.A.Worldwide Inquiries:Phone: +1.650.506.7000Fax: +1.650.506.7200Copyright © 2005, Oracle. All rights reserved.This document is provided for information purposes only and thecontents hereof are subject to change without notice.This document is not warranted to be error-free, nor subject to anyother warranties or conditions, whether expressed orally or impliedin law, including implied warranties and conditions of merchantabilityor fitness for a particular purpose. We specifically disclaim anyliability with respect to this document and no contractual obligationsare formed either directly or indirectly by this document. This documentmay not be reproduced or transmitted in any form or by any means,electronic or mechanical, for any purpose, without our prior written permission.Oracle, JD Edwards, and PeopleSoft are registered trademarks ofOracle Corporation and/or its affiliates. Other names may be trademarksof their respective owners.。
第11讲 oracle Spatial
Geometry
SDO_GEOMETRY Column
Point Line Polygon
Element
SDO_POINT Or SDO_ORDINATES Member
Coordinate system & Tolerance
坐标系统(Coordinate System) 给位置分配坐标并建立坐标间相互关系的方式方法,分类: • 笛卡尔坐标系(Cartesian); • 大地坐标系(Geodetic coordinate system) 容忍量(Tolerance) 描述空间数据的精度(起取值一般为坐标最低有效位的一半),用法: • 在图层的元数据定义中使用(视图 xxx_SDO_GEOM_METADATA.DIMINFO.SDO_TOLERANCE); • 作为空间分析函数(如SDO_GEOM.SDO_DISTANCE)的输入参数(当不 给出此参数或值为null时,取元数据中定义的容忍量)。
Geometry Type:
几何体是有序的顶点序列,这些顶点通过直线段和圆弧连接起来,Oracle Spatial支持如下基本类型几何体: • 点和点集(Points and point clusters):由两个(二维)或三个 (三维)坐标分量标识位置 • 线串(Line strings):由多个坐标对定义的直线段 • N边形(n-point polygons):由多个连接的直线段构成的封闭环,通 常指环内部 • 弧线串(Arc line strings)
•主过滤是基于空间索引的,利用几何体的近似逼近得到满足条件的候选集 •某些应用只需要进行主过滤操作
Indexing Spatial data
空间数据索引方法(Indexing of spatial data) • 索引:缩短搜索路径的方法。 • 空间索引:索引数据是基于几何体的空间数据生成的,是一种逻辑性索 引。空间索引用于: 窗口查询:在一索引过的数据空间中,找到与给定点或区域相互作 用的对象; 空间连结:在两索引过的数据空间中,找到空间相互作用的对象对 。 • 两种空间索引方式:R-TREE索引和QUADTREE索引,对空间数据可选择 使用一种或同时使用两种索引方式
Oracle spatial的五大优点
Oracle spatial在数据库服务端集成了空间数据仓库高性能管理技术,使得地理信息可以其它业务结合起来,并可以分布式地布署在INTERNET上,所有的这些优势正在导致新型空间数据仓库应用程序的出现:1) 低拥有成本在企业级别上部署应用程序,集中存储空间数据,从而降低了拥有成本。
互联网/内联网体系结构不需要在台式机上安装和维护客户端软件,也不需要在企业数据库之外单独存储和管理数据。
在客户机上只需要一个标准互联网浏览器。
2) 低风险空间信息直接集成到Oracle spatial 中。
这就促成了可伸缩的、安全的和高性能的应用程序。
开发人员可以选择部署在任何服务器平台上,包括 Solaris、Unix、Linux、Windows NT 和 Windows 2000,并使用现有的 IT 资源来管理这些应用程序。
3) 高价值利用互联网,更多用户可以在机会不增加机构成本的情况下访问应用程序。
这意味着用户可以全天候地访问任务的关键信息。
ARCSDE与Oracle Spatial同样都是用于存储空间数据的,但两者有本质的区别:a) 管理的对象不同。
Oracle Spatial只能管理简单的“点、线、面”空间要素的存储和检索,而ArcSDE还能管理注记、拓扑关系、栅格数据、CAD数据,并具有版本控制和长事务处理机制;b) 数据的互操作性不同。
ArcSDE支持的格式与OGC颁布的规范一致,而Oracle Spatial支持的格式与OGC规范不全相容,这自然会影响基于该平台的GIS系统的数据的共享和互操作性;c效率不同。
ArcSDE对空间数据的访问与管理效率要比Oracle Spatial高,而效率始终是GIS系统重点考虑的问题。
因此,对于那些不仅仅满足将空间数据找个地方存起来的应用,考虑ArcSDE是更合理的选择。
优点:a) 利用ArcSDE数据库存取、管理空间数据,真正实现数据的唯一性,保证数据的安全性。
b) Arc/Info强大的数据分析、数据处理、数据共享功能,满足用户的广泛的需求。
使用工具上传空间数据到Oracle Spatial
使用工具上传空间数据到Oracle Spatial MapInfo的easyLoaderOracle自带的工具shp2sdo配合使用SQL*Loader与Shp2SDO就可以把ESRI的Shape文件上载到Oracle Spatial中。
下载:/technetwork/database/options/spatial/downloads/shp2sdo-158114.zip Oracle Spatial并没有像ArcGIS那样有一套从桌面到数据库到服务器到开发包的全方位GIS产品体系,因此向Oracle中加载数据相比用ArcGIS要麻烦得多,同时也没有那么多的数据源格式的支持。
Oracle本身则提供了一个工具shp2sdo,可以帮劣你导入Shapefile到Oracle Spatial中,返个工具的使用分三个步骤:第一步,使用shp2sde工具生成脚本和数据:利用ArcSDE或者MapGIS提供的工具SDO_Geometry是Oracle Spatial的图形存储方式,ArcSDE也支持这种类型,不过ArcSDE缺省的方式ST_Geometry。
如果要修改缺省的数据类型,请打开ArcSDE\ora11gexe\etc\dbtune.sde, 修改GEOMETRY_STORAGE "ST_GEOMETRY" 为GEOMETRY_STORAGE " SDO_GEOMETRY"也可以使用ArcCatalog-〉NewFeatureClass,在Configration Keyword选项出现时,选择use configuration key word->SDO_Geometry如果使用的MapGIS是6.5或者其更高版本的话,就可以使用MapGIS的属性库管理子系统、编辑子系统所提供的工具来上载MapGIS空间数据。
shp转spatial数据
1.下载shp2sdo.exe,将其拷贝到oracle安装目录的bin文件夹里面。
路径参照:F:\app\Administrator\product\11.2.0\dbhome_1\BIN2.验证是否可以成功运行,打开cmd窗口,输入shp2sdo,出现如下界面,则可成功运行。
3.新建txt文件,输入以下内容,在保存完毕后将后缀改成batshp2sdo building building -i gid -s 4326 -g geom -dsqlplus gismm/gismm@GIS_200 @building.sqlsqlldr gismm/gismm@GIS_200 building其中前一个building是要导入的shp文件的名称,后一个building是自己转换成数据库表自己给的命名,我这里保持了两者相同,可以自行进行修改。
gismm/gismm是自己要导入数据的用户其用户名和密码,@后面为网络服务名,如果是本机的可以不加。
后面的两个building均为数据库中的表名,如果在导入的时候进行了修改,在这里要注意。
4.将自己修改的bat文件和shp源文件放在同一个文件夹,运行bat文件,运行完毕之后出现如下界面:5.此时bat文件并没有运行完,只是创建了表。
请不要点击右上角的X关闭命令行。
继续输入exit,接着运行。
命令行将会继续运行导入数据,导入完成后自动关闭命令行。
6.打开将数据导入的目标数据库,输入相应的账户名和密码登录。
新建查询语句查询刚刚导入的表。
表示已经导入成功。
注:有时会出现本机可以正常导入,但是连接服务器的数据库导入失败的情况。
遇到这种情况可以直接远程服务器在服务器上进行以上操作。
7.接下来我们需要删除原来数据库里面的mappoi表和mappnt表里面的内容,将新导入的数据替换上去。
select * from mappoi;select * from mappnt;--修改空间类型update region a set a.geom.SDO_GTYPE=2001;(红色部分为插入的表名)commit;--插入图形表insert into mappnt(minor,layer,map,ang,gl,geom,note,lockid,locktime,reg,prj,w,h, z,st)select 0,0,0,0,0,a.geom,,0,sysdate,0,0,0,0,0,0 from region a;--插入属性表insert into mappoi(id,bm,mc)select id,csound(note),note from mappnt;注:这个地方要注意表里面的列名变化,有变化的要进行相应的修改。
Oracle Spatial 空间数据库教程
m_session.Open(); // 打开一个会话 m_database.Open(m_session, dbaseName, userName, password) ; // 建立数据库连接, dbaseName是数据库名称
(4)SDO_ELEM_INFO
SDO_ELEM_INFO是一个可变长度的数组,每3个数作为一 个元素单位,用于解释坐标是如何存储在SDO_ORDINATES 数组中的。本文把组成一个元素的3个数称为3元组。一个3 元组包含以下3部分的内容: l SDO_STARTING_OFFSET
SDO_STARTING_OFFATES数组中的存储位置。它的值从1开始, 逐渐增加。
元数据表说明
Oracle Spatial的元数据表存储了有空间数据的数据表名称、 空间字段名称、空间数据的坐标范围、坐标参考信息以及坐 标维数说明等信息。用户必须通过元数据表才能知道 ORACLE数据库中是否有Oracle Spatial的空间数据信息。一般 可以通过元数据视图(USER_SDO_GEOM_METADATA)访 问元数据表。元数据视图的基本定义为:
(2)SDO_SRID SDO_SRID也是一个NUMBER型的数值,它用于标识与几 何对象相关的空间坐标参考系。如果SDO_SRID为空 (null),则表示没有坐标系与该几何对象相关;如果该 值不为空,则该值必须为MDSYS.CS_SRS表中SRID字段 的一个值,在创建含有几何对象的表时,这个值必须加入 到描述空间数据表元数据的 USER_SDO_GEOM_METADATA视图的SRID字段中。 Oracle Spatial规定,一个几何字段中的所有几何对象都必 须为相同的SDO_SRID值。
VALUES ('GEOD_CITIES', 'LOCATION',
shape导入oracle
首先介绍一下shapefile:Shapefile文件是美国环境系统研究所(ESRI)所研制的GIS文件系统格式文件,是工业标准的矢量数据文件。
Shapefile将空间特征表中的非拓扑几何对象和属性信息存储在数据集中,特征表中的几何对象存为以坐标点集表示的图形文件—SHP文件,Shapefile文件并不含拓扑(Topological)数据结构。
一个Shape文件包括三个文件:一个主文件(*.shp),一个索引文件(*.shx),和一个dBASE(*.dbf)表。
主文件是一个直接存取,变长度记录的文件,其中每个记录描述构成一个地理特征(Feature)的所有vertices坐标值。
在索引文件中,每条记录包含对应主文件记录距离主文件头开始的偏移量,dBASE表包含SHP文件中每一个Feature的特征属性,表中几何记录和属性数据之间的一一对应关系是基于记录数目的ID。
在dBASE文件中的属性记录必须和主文件中的记录顺序是相同的。
图形数据和属性数据通过索引号建立一一对应的关系。
导入shapefile文件是通过ORACLE提供的一个工具shp2sdo.exe,网上导出可以找到。
具体操作步骤如下:1 下载shp2sdo.exe,把此文件复制到PATH变量包含的目录下,如我的oracle客户端安装后自动注册的环境变量是path :D:/oracle/product/10.2.0/client_1/BIN;2 在dos(WINDOWS运行CMD)下定位到shp文件的目录,使用命令:cd /d 文件目录进入需要操作的文件目录。
(注意:文件目录不能含有汉字);3 在文件目录下操作。
输入命令为:shp2sdo.exe BOUNT_polyt_areainfo -g geom -d -x (-180,180) -y (-90,90)-s 8307 -t 0.5 -v。
命令结束后会在当前目录生成t_areainfo.ctl 和t_areainfo.sql两个文件4 连接数据库C:/Documents and Settings/Administrator>sqlplus user/password@orcl,登陆ORACLE成功后,执行脚本SQL>@t_areainfo.sql; 然后退出SQL> exit;5 导入控制文件t_areainfo.ctl : C:/Documents andSettings/Administrator>sqlldr user/password@orcl回车,然根据提示control = 输入t_areainfo.ctl 回车,导入结束。
OracleSpatial空间数据库的设计及应用
OracleSpatial空间数据库的设计及应用【摘要】本论文首先对OracleSpatial简介进行了说明,然后通过OracleSpatial 空间数据进行了分析。
对于应用程序的开发,论文详细阐述了每个环节出现的一些问题以及针对这些问题,制定有效的推进方法。
【关键词】空间数据库,设计,应用一、前言当OracleSpatial空间数据库的设计还有很大的发展空间,因此对OracleSpatial空间数据库的设计及应用就显得尤其重要,投空间数据库的设计,直接关系到应用的顺利进行。
二、OracleSpatial简介OracleSpatial支持3种基本集合类型,以及由这些类型组成的几何体。
3种基本类型是:点,线串和N点多边形,它们都是二维的。
二维点是两个坐标X和Y组成的元素。
线串由两个或更多的点按一定的顺序排列构成,这些点定义了线段。
线串可以由直线段,弧线段或二者混合构成。
多边形由连接的线串构成,这些线串形成封闭环形,多边形的内部也就因而确定了。
因为多边形由线串构成,这就意味着一个多边形可以包含一些直线边和一些圆弧边。
空间数据模型是一个由元素\几何体和层组成的层次结构。
空间层由几何体构成,几何体又是由元素构成。
元素是几何体的基本组成部分。
例如,元素可以作为公用事业供应点(点),道路(线串)或者国界(多边形)的模型。
在有洞的多边形中(例如湖中的小岛),多边形的外环与内环被视为两个不同的元素,它们共同构成一个复杂的多边形。
一个几何体就是一个用户空间特征的表示,以基本元素的有序集合为模型而构成。
三、OracleSpatial空间数据1、地理元数据管理模式OracleSpatial采取元数据表和空间数据表共同管理地理空间数据[1]。
MDSYS是OracleSpatial的管理用户,MDSYS方案中,表SDOGEOMMETADA TA TABLE存储所有上载到Oracle中的MapInfo地图信息,每条记录描述了一个空间数据表的图形列名、图形的坐标维名称,以及各维坐标的上界、下界和精度等:表SDOINDEXMETADA TA TABLE存储与索引相关的信息,如:被索引的列名,索引的方式,索引的级别,索引的所有者等。
oracle_spatial最佳实践书
Oracle Spatial 最佳实践Oracle 技术白皮书 2003 年 12 月目录1 概述 (1)2 数据建模 (2)3 元数据、容限和坐标系统 (2)4 数据加载 (4)5 数据验证 (4)6 为空间数据创建索引 (5)7 分区的空间索引 (6)8 空间查询 (6)9 应用程序考虑事项 (8)Oracle Spatial 和 Oracle Locator 是 Oracle 数据库强大的核心特性。
本技术文档介绍了一些最佳实践、提示和一般信息,它们能够帮助您利用 Oracle Spatial 和 Oracle Locator 在您日常的业务实践中提高生产效率、改进决策支持和促进成本节省。
Oracle 数据库 10g 中的 Oracle Spatial 包含了用于存储矢量数据类型、栅格数据类型和持续拓扑数据的原生数据类型。
本文档概述了在 Oracle 数据库 9i 和 10g 的 Oracle Spatial 中使用 Oracle 的原生矢量数据类型 SDO_GEOMETRY 的一些最佳实践。
1 概述Oracle Locator 与 Oracle 的标准版和企业版捆绑在一起。
Locator 是 Spatial 的一个子集。
获得 Oracle 标准版或企业版的许可将使您无需另外付费即可完全享用Oracle Locator 中提供的宝贵特性集。
SDO_GEOMETRY 是在 Oracle 中提供的唯一矢量数据类型,它自始就集成到了所有主要 GIS 供应商的产品套件中。
一些主要的 GIS 供应商可以使用旧的专用数据类型在 Oracle 中存储矢量数据,例如,使用 Oracle 的 LONG RAW 数据类型。
这些旧数据类型的引入要早于SDO_GEOMETRY 数据类型。
在市场中,有时存在这样的误解,认为使用SDO_GEOMETRY 作为基本矢量数据存储类型可能会危及主要 GIS 供应商所提供产品中的特性或性能。
Oracle Spatial 初学笔记
Oracle Spatial 初学笔记1)创建数据表create table geod_cities(location mdsys.sdo_geometry,cityvarchar2(42),state_abrv varchar2(2),pop90 number,rank90 number)2)向系统空间配置表user_sdo_geom_metadata中新增geod_cities的location字段空间描述信息(如空间范围和坐标系)insert into user_sdo_geom_metadata(TABLE_NAME,COLUMN_NAME,DIMINFO,SRID) values ('GEOD_CITIES','LOCATION',mdsys.sdo_dim_array(mdsys.sdo_dim_element('LONG',-180.0,180.0,0.0000005),mdsys.sdo_dim_el ement('LAT',-90.0,90.0,0.0000005)),8307)注意这里的8307是指WGS84坐标系,这个坐标系要和插入的数据一致。
否则数据无法插入。
3)Create index data_SX on geod_cities(location)indextype isMDSYS.SPATIAL_INDEX注意创建索引之前千万不可以插入数据,否则索引无法建立,如果没有索引的情况之下,使用空间计算的函数会失败提示没有索引,这两条我和李强卡了半天+一宿才找到规律,切记。
4)向geod_cities空间数据表中新增空间数据insert into geod_cities values(MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(121, 31,0),NULL,NULL),'上海','01',21232,926);insert into geod_cities values(MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(121, 31,0),NULL,NULL),'上海','01',21232,927)insert into geod_cities values(MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(121, 31,0),NULL,NULL),'上海','01',21232,928)5)查询空间数据字段select MDSYS.Sdo_Util.to_wktgeometry_varchar(location) fromgeod_cities6)查询121, 31附近50米内的点如下select * from GEOD_CITIES where MDSYS.SDO_WITHIN_DISTANCE (LOCATION,MDSYS.SDO_GEOMETRY(2001,8307,MDSYS.SDO_POINT_TYPE(121, 31, 0),NULL,NULL),'DISTANCE=50 UNIT=METER') = 'TRUE'7)查询121,21 121,22线段附近50米内的点如下select * from GEOD_CITIESwhere MDSYS.SDO_WITHIN_DISTANCE(LOCATION,MDSYS.SDO_GEOMETRY(2002,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY (1,2,1),MDSYS.SDO_ORDINATE_ARRAY(121,21,121,22)),'DISTANCE=50UNIT=METER') = 'TRUE'8)点线面分别如下点 MDSYS.SDO_POINT_TYPE(121, 31, 0),NULL,NULL)线MDSYS.SDO_GEOMETRY(2002,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1),MD SYS.SDO_ORDINATE_ARRAY(121,21,121,31))面MDSYS.SDO_GEOMETRY(2002,8307,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,1) ,MDSYS.SDO_ORDINATE_ARRAY(121,21,0,121,31,0))具体意义详见SDO_GEOMETRY说明。
基于Oracle Spatial电子海图数据库的构建及实现
基于Oracle Spatial电子海图数据库的构建及实现
张彪;徐铁;施朝健
【期刊名称】《上海海事大学学报》
【年(卷),期】2004(025)003
【摘要】根据Oracle Spatial对空间数据库的支持功能,阐明了用Oracle Spatial 设计符合IHO S-57标准的电子海图空间数据库的方法和过程,并给出了部分实现代码.实现了用Oracle Spatial对电子海图空间数据的存储和管理,为电子海图数据的存储和管理开辟了新的途径.
【总页数】5页(P16-20)
【作者】张彪;徐铁;施朝健
【作者单位】上海海事大学,商船学院,上海,200135;上海海事大学,商船学院,上海,200135;上海海事大学,商船学院,上海,200135
【正文语种】中文
【中图分类】U675.82;TP311.132.1
【相关文献】
1.基于Oracle Spatial的城市规划用地数据库的设计与实现 [J], 高红心
2.基于Oracle Spatial的税收征管空间数据库的设计与实现 [J], 黄风华
3.基于Oracle Spatial的ITS空间数据库的实现及访问 [J], 刘云生;李秋珍
4.基于Oracle9i Spatial空间数据库的设计与实现 [J], 万彪
5.基于Oracle Spatial的北京城市空间要素数据库实现 [J], 朱海勇
因版权原因,仅展示原文概要,查看原文内容请购买。
python如何把数据从MSSQL迁移到 ORACLE
python快速把数据从MSSQL迁移到ORACLE公司近期因业务发展收购了一家公司,在IT系统整合的过程中遇到一个要把子公司MSSQL数据库迁移到ORACLE的需求。
原MSSQL数据库不大,200GB左右,涉及到有数据的数据表400个左右,数据类型有Int,varchar,nvarchar,char,text,image,datetime(有精确到秒和到毫秒两种)。
正式迁移过程的时间要求较高,只有8小时,之前需要几轮的模拟测试。
对应在Oracle数据库中的objects提前创建好,不在本文描述范围,本文仅对数据迁移的方法进行描述。
之前考虑过使用微软数据转换工具(SQL Server Data Tool for Visual Studio 2012),但是测试下来性能太差,一个8GB(6百万记录数)左右的表从MSSQL转换迁移到Oracle对应的表用时超过2小时,平均每秒不到1000条记录,考虑过并行,但是画400个相似的数据流图实在太LOW,不是本人的风格。
在网上查找了相关的文章和oracle/microsoft提供的工具以及第三方工具,结果都不理想。
无奈只能自己做工具完成。
鉴于sql*loader 是Oracle批量数据装载最高效的工具,考虑使用sqlloader进行数据装载。
sql*loader要求从具有一定格式的flat数据文件中读取,那就需要从MSSQL导出到文本文件,而通常数据导出到文本文件都相当快速。
经测试通过bcp工具导出那个8GB的表需要5分钟,而sqlloader装载也仅需要9分钟左右,包括大量索引同时维护好。
因此该方案使用文本文件桥接一下两个数据库自身的工具,效果相当不错。
技术方案出炉之后,剩下的就仅仅是要把该方案工具化。
以下给出python脚本,可以方便快速的把给定的若干表数据从MSSQL转换迁移到Oracle数据库,使用的是python 2.7.6。
我只会python写脚本,读者可以参考并自行使用其他语言改写。
ORACLE SPATIAL 简介
ORACLE SPATIAL 简介博客分类:ORACLE—空间数据ORACLESPATIAL简介gis一、 ORACLE SPATIAL 简介ORACLE SPATIAL 是Oracle 的支持GIS数据存储的空间数据处理系统,是 Oracle 数据库强大的核心特性,包含了用于存储矢量数据类型、栅格数据类型和持续拓扑数据的原生数据类型。
ORACLE SPATIAL使得我们能够在一个多用户环境中部署地理信息系统(GIS),并且与其它企业数据有机结合起来,统一部署电子商务、政务。
有了 ORACLE SPATIAL 之后,即可用标准的 SQL 查询管理我们的空间数据。
二、 ORACLE SPATIAL 表结构简介Oracle 支持自定义的数据类型,你可以用数组,结构体或者带有构造函数,功能函数的类来定义自己的对象类型。
这样的对象类型可以用于属性列的数据类型,也可以用来创建对象表。
而Oracle Spatial也正是基于此种特性所开发的一套空间数据处理系统。
Spatial 的自定义数据类型有很多,都在MDSYS方案下,经常使用的是SDO_GEOMETRY 类型。
SDO_GEOMETRY表示一个几何对象,可以是点、线、面、多点、多线、多面或混合对象。
Spatial 在此数据类型的基础上,实现了R树空间索引和四*树空间索引,还以sql函数的形式实现了多种空间分析功能。
Oracle Spatial 使用:1、将SDO_GEOMETRY数据类型作为数据表的一个列。
CREATE TABLE cola_markets (mkt_id NUMBER PRIMARY KEY,name VARCHAR2(32),shape MDSYS.SDO_GEOMETRY);2、填写空间元数据。
INSERT INTO USER_SDO_GEOM_METADATAVALUES ('cola_markets','shape',MDSYS.SDO_DIM_ARRAY( -- 20X20 gridMDSYS.SDO_DIM_ELEMENT('X', 0, 20, 0.005),MDSYS.SDO_DIM_ELEMENT('Y', 0, 20, 0.005)),NULL -- SRID);3、创建空间索引。
oracle_spatial
▪ Set the update columns in the feature type properties
ORACLE SPATIAL–5
Oracle Spatial
▪ Must specify the DATASET (service name), USERID, and PASSWORD in the mapping file.
import
ORACLE SPATIAL–4
Oracle Spatial & Workbench
▪ When setting up imports, use IMPORT FEATURE TYPE DEFINITIONS to harvest schema for existing tables
▪ Have to remove database owner in FeatureType Properties – bug in FME 2004
Overview
▪ Oracle Spatial extends Oracle database for geometric indexing
▪ Provides an object model for storing geometry
▪ Features are grouped into layers ▪ Features consist of geometry + attribution ▪ Quadtree or R-Tree spatial index ▪ Object model stores geometry as a
ORACLE SPATIAL–9
column using the SDO_GEOMETRY object
基于Oracle Spatial的GIS空间数据处理及应用系统开发
基于Oracle Spatial的GIS空间数据处理及应用系统开发潘农菲
【期刊名称】《计算机工程》
【年(卷),期】2002(028)002
【摘要】从介绍地理信息系统(GIS)中属性数据和空间数据的传统的存储方式,以及这种存储方式给分布式应用系统开发带来的诸多问题开始,对Oracle Spatial技术进行了分析,详细阐述了这种先进的解决方案和如何实现属性数据和空间数据一体化存储的理论细节.进而提出了基于该项技术的应用系统的开发方法.
【总页数】3页(P278-280)
【作者】潘农菲
【作者单位】西南交通大学通讯与工程学院,成都,610031
【正文语种】中文
【中图分类】TP311.13
【相关文献】
1.GIS中基于Oracle Spatial存储空间数据的研究 [J], 雍壮志;洪应宋;刘连旺
2.Linux环境下基于Oracle Spatial的分布式海量空间数据处理平台的设计与实现[J], 冯杭建;刘南;刘仁义
3.基于ArcGIS和Oracle Spatial的城市空间基础数据库系统 [J], 向红梅
4.基于Oracle Spatial空间数据库的GIS数据管理 [J], 姚力波;王仁礼
5.基于VC++,MapInfo和Oracle Spatial的GIS应用系统开发 [J], 魏金占;周晓光;周家香;刘军生
因版权原因,仅展示原文概要,查看原文内容请购买。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
一、使用shp2sdo软件
(1)加载shp,去掉扩展名
(2)输出的表名默认
(3)数据模型默认
(4)地理信息列默认
(5)Id列视shp数据而定,一般取FID字段
(6)投影信息y 输入坐标信息
(7)容差默认
(8)控制文件生成默认
(9)数据库版本视情况定
(10)精度默认
(11)Override 默认
总共生成三个文件.ctl .sql .dat文件,与数据同一目录下。
二、使用oracle
使用editor,打开刚才生成的sql文件,去掉第一行drop表,然后从create table一直到最后,复制到toad editor里,执行execute as script生成表
三、使用cmd
(1)打开ctl文件,把.ctl文件前面的路径去掉
比如:INFILE D:\Platform_Data\fs\theme\gggl_qh.dat
改成:INFILE gggl_qh.dat
(2)开始—>运行—>cmd—>进入ctl文件所在文件夹—>输入sqlldr用户名,回车—>输入.ctl文件全名,回车输入口令即可导入
Sqlldr username/password@IP/orcl CONTROL=D:\JC\KYQ.CTL
注意事项:
1.建空间索引
2.字段必须为英文或者拼音缩写,最好避免特殊字符。