FAQ: How to set appropriate -x and -z values when running sdelayer -o register
How to set appropriate -x and -z values when running sdelayer -o register
The sdelayer command creates and administers ArcSDE layers. The register operation allows the creation of a feature class from a DBMS table that contains a spatial column defined as a user-defined data type.
To date, eight different implementations of DBMS spatial data types are supported in ArcSDE geodatabases:
• Oracle Spatial geometry type (SDO_Geometry) • Informix Spatial DataBlade (ST_Geometry) • DB2 Spatial Extender (ST_Geometry) • spatial type for Oracle (ST_Geometry) • spatial type for PostgreSQL (ST_Geometry) • PostGIS for PostgreSQL (Geometry), • Geometry for SQL Server (Geometry) • Geography for SQL Server (Geography)
The -x option has the following parameters:
-x <xoffset,yoffset,xyscale>: FalseX, FalseY, and System units
These three values refer to: X offset, Y offset and scale factor, and are used to shift and scale spatial data's coordinates for geodatabase storage.
Geodatabases store spatial information in integer and the default starting point for (x, y) is (0, 0). X/Y offsets are applied to re-center the geodatabase coordinate domain around the dataset. Since normally user's coordinate values are in decimal and the geodatabase is using integer, the scale is used to preserve the fractional part of a coordinate measurement.
Here is an example of SQL query to get the appropriate values in Oracle Spatial geometry type (SDO_Geometry):
SQL> SDO_AGGR_MBR(GEOMETRY)(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)
This indicates that the existing layer has minx=-13.28006, miny= 48.25, maxx=5.43048227, maxy=57.1125883
Based on the query results, -x can be set to be '-13.5,48,10000000000', where 'x offset'=-13.5 and 'y offset'=48. This shifts the default starting points of geodatabase storage from (0,0) to (-13.5, 48.25). The 'x/y offset' values must be lower than the minx/y, to ensure that all the existing coordinate values are within the range of the geodatabase storage and with a spatial buffer to allow data to expand in the future.
The scale is used to preserve the fractional part of the coordinate values. From the results of the SQL query above, the value '5.43048227' contains more digits after the decimal points. In order to preserve the digits after the decimal points and avoid the values being rounded up and losing the precision, the scale was given as as '10000000000' and the value '5.43048227' is stored as '54304822700' in geodatabase.
For example, if using two points, (0, 5.34567) and (0, 5.34568), with scale=100000, they are stored in geodatabase as '(0, 534567), (0, 534568) and user is able to differentiate them, however if the scale=10000, they are both be stored as (0, 53457), and are considered the same point and thereby lose spatial accuracy.