HowTo:  Insert geometry from XY coordinates using SQL

相关信息
Article ID: 43769
Software:
ArcSDE 10, 10.1, 10.2, 10.2.1, 10.2.2
Platforms: N/A

问题描述
In some cases, there may be a need to insert geometries into a feature class using structured query language (SQL). This can be done using a loop or a database cursor in SQL. Sometimes, due to performance, resources, or workflows, creating data via SQL is preferable to creating the data in ArcMap.




已邀请:

易智瑞技术支持

赞同来自:

解决方案
In the example below, point geometry is inserted into a feature class from an existing database table.
  1. Create an empty point feature class in ArcMap using one of the following spatial types. 
    SQL: Geometry Oracle: ST_Geometry SDO_Geometry 
  2. In a SQL program, create a cursor or loop to iterate through the input database table. Create a geometry for each row. This procedure works best if a unique identifier column exists in the input database table, such as a rownum or OID field in SQL Server. This ensures the WHILE loop does not miss any rows that are not unique. To insert data into a registered feature class, a unique, not-null value must be specified for the ObjectID column. To do this, the Next_RowID procedure must be used.

  • SQL Server Geometry sample: 


  • Oracle SDO Geometry sample:


  • Oracle ST Geometry sample:



其它相关参考
  1. Editing nonversioned geodatabase data in SQL Server using SQL
  2. Editing nonversioned geodatabase data in Oracle using SQL


创建及修改时间
Created: 12/26/2014

Last Modified: 2/23/2015
原文链接
http://support.esri.com/en/kno ... 43769

要回复问题请先登录注册