ArcGIS10.2发布Oracle Spatial存储的Feature Service的编辑问题
环境: ArcGIS Desktop10.2 ArcGIS Server 10.2 ArcSDE10.2 Oracle 11.2.0.3 问题描述:根据ArcGIS10.2 的新特性,ArcGIS Server10.2可以发布原生的数据库存储的Feature Service。也就是说,我可以发布在没有任何ArcSDE环境下的使用Oracle Spatial存储的数据
环境:
ArcGIS Desktop10.2
ArcGIS Server 10.2
ArcSDE10.2
Oracle 11.2.0.3
问题描述:根据ArcGIS10.2 的新特性,ArcGIS Server10.2可以发布原生的数据库存储的Feature Service。也就是说,我可以发布在没有任何ArcSDE环境下的使用Oracle Spatial存储的数据的Feature Service,直接编辑Oracle Spatial数据。但是我发布完相关服务,可以进行数据删除,在进行新增数据的时候没有反应。查看浏览器的F12信息,
报:Rowbuffer creation failed.
但是,通过ArcGIS10.2连接非ArcSDE环境的数据库,也可以创建Oracle Spatial存储的数据,这个数据发布Feature Service 编辑数据没有任何问题。
帮助上如下所示:
http://resources.arcgis.com/en/help/main/10.2/index.html#/What_s_new_in_ArcGIS_10_2/016w0000005s000000/
Publishing feature services from databases Prior to 10.2, you could only publish a map service with feature access enabled (a feature service) to ArcGIS Server if the database contained a geodatabase. At 10.2, you can publish editable feature services from supported database management systems. See the ArcGIS database management system requirements for a list of supported databases and spatial data types. Beginning with ArcGIS 10.2, you should use ArcGIS Server feature services to publish data from a database rather than using ArcGIS Spatial Data Server feature services, as these have been deprecated.
延伸阅读:
也就是说,我在不用安装ArcSDE库的情况下,可以使用ArcGIS Server10.2发布Oracle(Oracle Spatial)、SQLServer(Geometry、Geography)、PostgreSQL(PostGIS Geometry)存储的Feature Service。
非常纳闷,这本来是ArcGIS10.2的新特性,怎么就不能编辑呢?
经过N天的沟通和研究,我发现了一个问题。而问题出在我自己的数据上。
我的Oracle有两个实例,一个实例安装了SDE库,另一个实例就是一个非SDE库的环境,我构造的Oracle Spatial数据,是使用ArcGIS Desktop连接SDE库,创建了SDO_Geometry的要素类,然后通过Oracle的EXP/IMP的方法导入到非SDE库,这样也能达到模拟Oracle Spatial数据存储的环境,但是正是这个数据导致了相关问题。
首先我们看一下原生的Oracle Spatial数据的结构:
SQL> desc MDSYS.SDO_GEOMETRY 名称 是否为空? 类型 ----------------------------------------- -------- ---------------------------- SDO_GTYPE NUMBER SDO_SRID NUMBER SDO_POINT MDSYS.SDO_POINT_TYPE SDO_ELEM_INFO MDSYS.SDO_ELEM_INFO_ARRAY SDO_ORDINATES MDSYS.SDO_ORDINATE_ARRAY
--------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
Weibo: http://www.weibo.com/linghe301
--------------------------------------------------------------------------------------------
但是,在SDE环境下,通过桌面创建的Oracle Spatial数据的结构
SQL> desc wgs_p 名称 是否为空? 类型 ----------------------------------------- -------- ---------------------------- OBJECTID NOT NULL NUMBER(38) SHAPE MDSYS.SDO_GEOMETRY SE_ANNO_CAD_DATA BLOB
Tips:如果存储 CAD 和注记属性,则会向业务表中添加一个附加列。
SDO_GEOMETRY 类型无法存储 ArcGIS 存储必定支持的所有类型的几何元素。当需要存储这些元素时(由创建要素类时所指定的几何类型标记决定),ArcGIS 会向业务表中添加名为 SE_ANNO_CAD_DATA 的列。
每当 ArcGIS 检测到数据源中含有 CAD 数据时,ArcGIS 就会将 CAD 数据的简单几何表示写入 SDO_GEOMETRY 值中并将未修改的 CAD 数据写入 SE_ANNO_CAD_DATA 值中。如果数据源中不含 CAD 数据,ArcGIS 会将 SE_ANNO_CAD_DATA 值设置为 NULL。SE_ANNO_CAD_DATA 属性包含来自大量 ArcGIS 组件的数据:
- 来自 ArcSDE CAD 客户端的 AutoCAD 或 MicroStation 数据
- 来自 ArcMap 的三次样条和贝塞尔曲线等参数对象
- 来自 ArcGIS Spatial Analyst 扩展模块的表面片
我尝试是否是这个字段导致的问题,进行相关测试,该字段并不是导致该问题的原因。
而且我还发现,使用桌面在SDE环境下创建的带有Oracle Spatial存储的表的结构是
-- Create table create table SDO ( OBJECTID INTEGER not null, SHAPE MDSYS.SDO_GEOMETRY, SE_ANNO_CAD_DATA BLOB ) tablespace SDE pctfree 0 initrans 4 maxtrans 255; -- Create/Recreate indexes create unique index R95_SDE_ROWID_UK on SDO (OBJECTID) tablespace SDE pctfree 0 initrans 4 maxtrans 255;
-- Create table create table AAB ( OBJECTID INTEGER not null, SHAPE MDSYS.SDO_GEOMETRY ) tablespace ESRI pctfree 10 initrans 1 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited ); -- Add comments to the columns comment on column AAB.OBJECTID is 'ESRI auto-incrementing'; -- Create/Recreate primary, unique and foreign key constraints alter table AAB add primary key (OBJECTID) using index tablespace ESRI pctfree 10 initrans 2 maxtrans 255 storage ( initial 64K next 1M minextents 1 maxextents unlimited );
也就是说,非SDE环境下(ArcGIS Desktop或者SQL语句)创建的OracleSpatial存储的数据可以发布要素服务,而且可以编辑,但是在SDE环境下发布的要素类,将该表迁移到非SDE环境下发布Feature Service服务,编辑就报错。
最后,解决方法:使用该功能,建议在非SDE环境下直接创建,而不能是其他迁移过来的数据。
--------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
Weibo: http://www.weibo.com/linghe301
--------------------------------------------------------------------------------------------
其他扩展:关于Oracle Spatial
将数据以Oracle Spatial进行存储,Oracle也有一个关于投影的系统表,还有一个管理这些空间数据的系统表。
关于空间数据系统表
将 SDO_GEOMETRY 列添加到业务表时,它还会将所需的 Oracle Spatial 元数据记录添加到 USER_SDO_GEOM_METADATA 视图。此元数据包括表名称、SDO_GEOMETRY 列名称、空间参考 ID 和坐标维度信息。
关于投影的系统表,可以查看MDSYS.CS_SRS,相关的SRID信息必须在该表里面,如果没有,你的数据显示就会有相关问题。
关于Oracle Spatial的空间索引:
数据库中有好多的MDRT打头的表,而这些表的字段都是一样的,那这些表是做什么用呢?
MDRT_$: 用来存储与空间索引相关的信息。这些表与常规表不一样,不能做复制,删除,新建等。如果对这些表进行操作后,会导致其对应的空间索引无效,因此必须重新将该索引删除重建。
SQL> ALTER TABLE MDRT_1F89F$ MOVE STORAGE(INITIAL 1M) ;
ALTER TABLE MDRT_1F89F$ MOVE STORAGE(INITIAL 1M)
ORA-30967: 不允许在路径表上直接执行操作
具体如下:
不应当将MDRT表从一个表空间移动到另一个表空间:如果这样做,相应的空间索引将不可用,所有基于表索引的空间操作符都将失效。在这种情况下,恢复的唯一方法就是删除并重建空间索引。为了避免这些问题,应确保数据库管理员知道这个限制并在执行一些优化时不要移动MDRT表。可以在创建空间索引时使用tablespace参数来指定MDRT表需要的表存储空间。
不应该删除/修改MDRT表或MDRS序列:当它们与任何空间索引都不关联时(在正常的情况下,这种情况是不能发生的),可以删除它们。可以通过检查USER_SDO_INDEX_METADATA视图来确定所有的MDRT表与用户的空间索引是否相关联。
SQL> SELECT sdo_index_name, sdo_index_table, sdo_rtree_seq_name FROM USER_SDO_INDEX_METADATA;
不应当显式地导出MDRT表:当导入一个表时,如含有空间索引的customers表,相应的空间索引信息同样被导出。在导入的过程中,空间索引(和相应的MDRT表)将被重建。不需要导入或导出任何MDRT表(或MDRS序列)。
不应当将MDRT表复制到一个复制型数据库中:如果想复制一个用户表,如customers表,所有你要复制的就是那个customers表。你需要显式地在复制实例上创建空间索引。
--------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/linghe301
Weibo: http://www.weibo.com/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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

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



Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

Deleting all data in Oracle requires the following steps: 1. Establish a connection; 2. Disable foreign key constraints; 3. Delete table data; 4. Submit transactions; 5. Enable foreign key constraints (optional). Be sure to back up the database before execution to prevent data loss.

Oracle Invalid numeric errors may be caused by data type mismatch, numeric overflow, data conversion errors, or data corruption. Troubleshooting steps include checking data types, detecting digital overflows, checking data conversions, checking data corruption, and exploring other possible solutions such as configuring the NLS_NUMERIC_CHARACTERS parameter and enabling data verification logging.

Solutions to Oracle cannot be opened include: 1. Start the database service; 2. Start the listener; 3. Check port conflicts; 4. Set environment variables correctly; 5. Make sure the firewall or antivirus software does not block the connection; 6. Check whether the server is closed; 7. Use RMAN to recover corrupt files; 8. Check whether the TNS service name is correct; 9. Check network connection; 10. Reinstall Oracle software.

Oracle database paging uses ROWNUM pseudo-columns or FETCH statements to implement: ROWNUM pseudo-columns are used to filter results by row numbers and are suitable for complex queries. The FETCH statement is used to get the specified number of first rows and is suitable for simple queries.

The method to solve the Oracle cursor closure problem includes: explicitly closing the cursor using the CLOSE statement. Declare the cursor in the FOR UPDATE clause so that it automatically closes after the scope is ended. Declare the cursor in the USING clause so that it automatically closes when the associated PL/SQL variable is closed. Use exception handling to ensure that the cursor is closed in any exception situation. Use the connection pool to automatically close the cursor. Disable automatic submission and delay cursor closing.

In Oracle, the FOR LOOP loop can create cursors dynamically. The steps are: 1. Define the cursor type; 2. Create the loop; 3. Create the cursor dynamically; 4. Execute the cursor; 5. Close the cursor. Example: A cursor can be created cycle-by-circuit to display the names and salaries of the top 10 employees.
