ArcSDE地理数据库跨用户以及跨数据库表关联研究
ArcSDE提供多种方式的关联操作,Join、Relate、ArcSDE视图、QueryLayer、RelationshipClass等,每一种方式都有自己独特的适用范围和方法。 但是一般情况下,我们在介绍这些方法的使用过程中,无疑都是在同一个数据库(SQLServer)和同一个用户下(Oracle)下
ArcSDE提供多种方式的关联操作,Join、Relate、ArcSDE视图、QueryLayer、RelationshipClass等,每一种方式都有自己独特的适用范围和方法。
但是一般情况下,我们在介绍这些方法的使用过程中,无疑都是在同一个数据库(SQLServer)和同一个用户下(Oracle)下的环境中使用,但是很多用户在实际过程中使用了关联,其实都是空间数据和属性数据的关联,这些属性数据往往与空间数据不再一块儿,那么类似这种情况下,ArcSDE是否可以实现呢?
通用的方法就是Join,用户可以将不同存储位置的数据加载到ArcMap中进行Join,然后保存MXD,不管是直接操作该关联对象还是发布ArcGIS Server服务都是可以的,但是这种方式给用户带来的不是性能低下就是在发布服务的时候有明显的问题。
比如,当发布服务时,数据源进行join,在ArcGIS10.1环境下会出现一个问题
1:当ArcGIS10.1 SP1补丁,Join之后的标注看不到,但是不打SP1补丁可以,该问题经过跟美国沟通是一个Bug:
NIM087311 Map labels do not work in a map service if the feature class resides in an
ArcSDE database and is joined to a table.
http://support.esri.com/en/bugs/nimbus/TklNMDg3MzEx该问题已经在ArcGIS 10.1 SP1 for (Desktop, Engine, Server) Quality Improvement Patch和ArcGIS10.2已经解决。
2:使用Join发布服务,在query中可以查到结果,在find中不行。
那么我们只能通过ArcSDE视图或者QueryLayer的方式来解决这个问题。
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------
SQLServer数据库
例如,我的测试数据,空间数据pl和属性数据owner,两者共有的关联字段是pid,那么pl存储在sde101的数据库中(database),owner存储在test数据库中。
注意:因为牵涉到跨库操作,所以,我设置了sde用户默认对sde101数据库有操作权限,我还需要设置sde用户对test数据库有相关权限,如果更加严谨的话,sde用户对test数据库中的owner 表有操作权限。
1:使用ArcSDE命令视图方法
C:\Program Files\ArcGIS\ArcSDE\sqlexe\bin>sdetable -o create_view -T myview123 -t sde101.dbo.place,test.dbo.owner -c sde101.dbo.place.objectid,sde101.dbo.place.shape,sde101.dbo.place.pid,test.dbo.owner.name -a objectid,shape,pid,name -w "sde101.dbo.place.pid=test.dbo.owner.pid" -i sde:sqlserver:lishaohua -s lishaohua -D sde101 -u sde -p Super123 ArcSDE 10.2 Attribute Administration Utility ----------------------------------------------------- Error: Invalid database name (-162). Error: Unable to create view myview123
那么如果我直接将owner拷贝到sde101数据库,也就是同一个数据库下的空间数据与属性数据进行关联,测试创建视图没有问题。
C:\Program Files\ArcGIS\ArcSDE\sqlexe\bin>sdetable -o create_view -T myview -t sde101.dbo.place,sde101.dbo.owner -c sde101.dbo.place.objectid,sde101.dbo.place.shape,sde101.dbo.place.pid,sde101.dbo.owner.name -a objectid,shape,pid,name -w "sde101.dbo.place.pid=sde101.dbo.owner.pid" -i sde:sqlserver:lishaohua -s lishaohua -D sde101 -u sde -p Super123 ArcSDE 10.2 Attribute Administration Utility ----------------------------------------------------- Successfully created view myview.
2:使用QueryLayer关联
总结:用户可以使用QueryLayer实现SQLServer的跨数据库关联,用户使用QueryLayer发布ArcGIS Server服务没有问题。
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------
Oracle数据库
例如测试数据,sde用户下存储空间数据PL,aaa用户下存储属性数据owner,关联字段为pid
1:使用ArcSDE命令创建视图
C:\Users\Administrator>sdetable -o create_view -T myview -t sde.pl,aaa.owner -c sde.pl.objectid,sde.pl.shape,sde.pl.name,aaa.owner.name -a objectid,shape,name1,name2 -w "sde.pl.pid=aaa.owner.pid" -i sde:oracle11g:192.168.220.131/orcl -u sde -p sde ArcSDE 10.2 Attribute Administration Utility ----------------------------------------------------- Error: Underlying DBMS error (-51). Error: Unable to create view myview ORA-01720: 不存在 'AAA.OWNER' 的授权选项
系统提示sde用户并没有对aaa.owner有权限。
C:\Users\Administrator>sqlplus aaa/aaa@orcl_131 SQL*Plus: Release 11.2.0.1.0 Production on 星期四 2月 27 11:51:38 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved. 连接到: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> grant select on owner to sde with grant option; 授权成功。 SQL> exit 从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开 C:\Users\Administrator>sdetable -o create_view -T myview -t sde.pl,aaa.owner -c sde.pl.objectid,sde.pl.shape,sde.pl.name,aaa.owner.name -a objectid,s hape,name1,name2 -w "sde.pl.pid=aaa.owner.pid" -i sde:oracle11g:192.168.220.131/orcl -u sde -p sde ArcSDE 10.2 Attribute Administration Utility ----------------------------------------------------- Successfully created view myview.
使用aaa用户将owner表赋予sde用户,然后创建视图成功。
总结:Oracle数据库支持跨用户创建ArcSDE空间视图
2:使用QueryLayer方式
总结;可以看到,使用QueryLayer也是支持跨用户关联的。
那么在oracle数据库中,如果用户希望跨数据库实例,请参考:
ArcSDE进行跨数据库的关联
http://blog.csdn.net/linghe301/article/details/7237049
但是这种方法有很多问题,不建议用户使用。
更多参考:
ArcGIS表关联方式介绍(二)-ArcSDE视图、QueryLayer、RelationshipClass
http://blog.csdn.net/linghe301/article/details/6649717
ArcGIS表关联方式介绍(一)-Join、Relate
http://blog.csdn.net/linghe301/article/details/6649689
----------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
----------------------------------------------------------------------------------

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.
