Is This Content Helpful?
We're glad to know this article was helpful.
Instructions provided describe how to use a world shapefile, included with ArcView, to load SDE binary data into the center of the ArcSDE integer coordinate space, which has a fixed extent of 2147483647 wide and 2147483647 high.
Code: shp2sde –o create –l world_data,shape –f C:\esri\esridata\world\cntry92.shp –g 38 –x –9646,-9649,111319 –e a+n –a all –c 2000 –v –i esri_sde –s computer1 –u username –p passwordFor SQLServer:
Code: shp2sde –o create –l world_data,shape –f C:\esri\esridata\world\cntry92.shp –g 38 –x –9646,-9649,111319 –e a+n –a all –c 2000 –v -D database –i esri_sde –s computer1 –u username –p passwordModify the above parameters as needed:
–f the pathname for the shapefile -D the name of the database (SQLServer only) -i the name of your ArcSDE service (default name is esri_sde) –s the name of the server -u the RDBMS SDE username -p the RDBMS SDE passwordHow to calculate the -x parameter used in the examples above.
Warning: An XYScale that is too small can greatly generalize the data, whereas too large a scale may not fit in the available ArcSDE coordinate integer space. Both could result in the data not loading, or not allowing for future growth.The following is how the –x values of –9646, -9649, and 111319 were determined:
Note: The following steps are based on the example data with units in decimal degrees. The steps are the same with data in other units, such as meters or feet. Knowing the units of the data is essential to obtaining correct values.A. Run the shpinfo command with the proper path to the shapfile on the system for the -f parameter to view the attributes of the shapefile:
Code: shpinfo –o describe –f C:\esri\esridata\world\cntry92.shpB. Get the minX, minY, maxX, and maxY extents of the shapefile from the output returned by shpinfo. For example: -180, -90, 180, 83.596.
The circumference of the Earth at Equator in meters equals 40075017. The Number of Degrees around the earth is 360 (remember that the data is in decimal degrees). XYScale = 40075017 / 360 = ~111319D. Test if the data fits in the ArcSDE integer coordinate space of 2147483647 by 2147483647.
Width of data = 180 – (-180) = 360 Height of data = 83.596 – (-90) = 173.596 Multiply width and height by XYScale (111319) 360 * 111319 = 40074840 173.596 * 111319 = 19324533.124If both numbers are less than 2147483647, the data fits and the XYScale of 111319 can be used.
2147483647 / 2 = 1073741823.5F. Convert the value to decimal degrees by applying the XYScale.
1073741823.5 / 111319 = 9645.6294G. Calculate the center of the shapefile.
minX + (Width of data / 2) = -180 + 180 = 0 minY + (Height of data / 2) = -90 + 86.798 = -3.202H. Determine X Offset and Y Offset.
X Offset = x center of shpfile - center of ArcSDE integer space Y Offset = y center of shpfile - center of ArcSDE integer space X Offset = 0 – 9645.6294 = ~ -9646 Y Offset = -3.202 – 9645.6294 = ~ -9649Results: XOffset -9646, YOffset -9649, XYScale 111319.
Note: The XYScale or Offsets cannot be altered once the data is loaded.
Note:It is recommended to round off values for the -x parameters.
Note: Point data may be best approached by trial and error, because points do not have any spatial extent (spatial envelope). Start by using a very small grid size (0.1 for decimal degree data, or 1 for projected data), and alter it as needed.The following information describes how the example value of 38 was determined:
Code: ( [Shape].ReturnExtent.GetWidth + [Shape].ReturnExtent.GetHeight ) / 2.
Note: It is recommended to round off values for the -g parameter.Finding a grid size, as illustrated above, may only be a starting point. A grid size of 38 works, but it may be necessary to alter the size (use sdelayer –o alter) to increase performance results.
Code: sdelayer –o si_stats –l world_data,shape –u username –p password –i esri_sde
Note: For details on sdelayer -o si_stats, and the information it returns, refer to the SDEHOME/documentation/config_tuning_guide_<rdbms>.pdf file.Explanation and information about the rest of the shp2sde parameters used in the examples above.
|Point = pn||PointM = pMn||PointZ = p3Mn||polyline = s+n|
|polylineM = s+Mn||PolylineZ = s+3Mn||polygon = a+n||polygonM = a+Mn|
|polygonZ = a+3Mn||Multipoint = p+n||multipointM=p+Mn||multipointZ = p+3Mn|
Note: ArcSDE allows layers to have multiple entity types, similar to coverages (point, line and polygon shapes may all be part of one layer). ArcGIS applications, such as ArcMap and ArcCatalog, do not support multiple entity SDE layers, and they will not be available when connecting to ArcSDE with ArcGIS clients. The feature types above are not multiple feature types. Polygon is shown using an 'a' for area, an 'n' for nil, and a '+' for multipart (a+n). If 'p' for point is included (pa+n), the layer becomes a multiple entity layer that allows points and polygon features to exist in the same layer.
Note: The example above demonstrates one approach to loading a world shapefile into an RDBMS by way of ArcSDE. Because many factors should be considered when loading data into an RDBMS, it is strongly recommended to enroll in ESRI’s Introduction to ArcSDE and ArcSDE Administration courses to handle individual data storage and performance issues.