Setting an appropriate geodatabase spatial domain
For spatial data to be appropriately stored and referenced to a location on the earth, it must have a spatial reference. A spatial reference is composed of a coordinate system and precision. The coordinate system (geographic or projected) defines the location of the spatial data on the earth. For example, using the GCS_North_American_1983 geographic coordinate system, ESRI is located at -117.195533 longitude and 34.057058 latitude. Precision defines the level of detail that is maintained when data values are stored in the geographic database. For example, if you store the above coordinates and your precision only maintained two decimal places, the values -117.20, 34.06 (rounded) would be stored in the geographic database. If these coordinates are rounded to two decimal places, the point would represent an ellipse on the earth's surface of 1,109 by 923 meters. Therefore, careful consideration should be given to choosing an appropriate data precision to maintain the precision of your data collection.
Learn more about map projections
The rest of this topic discusses how to set the geodatabase precision aspect of the spatial reference. The first section discusses the fundamentals of geodatabase precision. The second section discusses different approaches for calculating precision appropriate for your data.
About geodatabase precision
The geodatabase stores coordinates as positive 4-byte integers that have a maximum value of 2,147,483,648. This range of integers is called a spatial domain. It may seem that you are limited to storing one foot or one meter precision with an integer, but that is not the case: you decide what your 4-byte integer units represent. If you need to store meter precision, then you have 2.14 billion meters to work with (approximately 53 times the circumference of the earth). Or you could decide to store centimeters, in which case you would have 2.14 billion centimeters to work with (about half the circumference of the earth). The units that the 4-byte integer represents are called storage units. Storage units are the smallest measurable units that can be stored for a dataset. The geodatabase converts between storage units and the units of the coordinate system on the fly, so you only work with decimal numbers even if you are using the lowest level ArcObjects API. The geodatabase uses precision to convert between coordinate system units and storage units using the equation:
Storage Units = Coordinate System Units ÷ Precision
The following table shows examples of equivalent precision, coordinate system units, and storage units.
Storage units | Coordinate system units | Precision |
1 cm | Meters | 100 |
1 mm | Meters | 1000 |
2 cm | Meters | 50 |
1 inch | Feet | 12 |
The geodatabase actually does a little more to convert between storage units and coordinate system units. These coordinates are also shifted during the conversion. You only need to be concerned about this shift if you are manually calculating your spatial domain.
Spatial domain extent
The relationship between the precision and the domain extent (the area you can store) is inversely related. Because you have 2.14 billion integers, there is an outer edge for the spatial domain. As your storage units get smaller (and precision gets larger) the extent of your spatial domain also gets smaller. When you attempt to add features outside the spatial domain, you will get the following error: "The coordinates or measures are out of bounds." It is important that you do not make your storage units so small (and, therefore, your precision so large) that you will not be able to add features for your entire study area. However, with approximately 2.14 billion storage units to work with, in most cases you can avoid this problem by simply setting the precision appropriately. For example, you can store the entire world with 1-meter storage units but only half the world with 1-cm storage units. Using a decimal degree-based geographic coordinate system like NAD 1983, you could use 1.9-cm storage units for the entire world in a single feature class.
Benefits of storing integers
Performance is the reason the geodatabase uses integer storage instead of floating point storage. Internally, integer coordinates allow the geodatabase to perform spatial operations several orders of magnitude faster than operations using decimal coordinates. Also, integers can be compressed to consume less storage resources, which produces better performance. Only enterprise (ArcSDE) geodatabases take advantage of integer compression, so this storage benefit does not apply to personal geodatabases. ArcSDE uses relative offset compression of the integer coordinate values to minimize storage resources. As the precision becomes larger, the relative offsets between coordinates will get larger, thereby increasing the storage requirements.
How to set the spatial domain
Before you create a spatial domain, there are three things to consider.
- Will the precision of the data maintain the precision of your data collection?
- Will the spatial domain cover the entire extent of your study area?
- Is the precision small enough to maximize integer compression (enterprise geodatabases only)?
You don't always need to worry about all these issues. Many times, you can let the default settings generated by the software deal with these issues for you. Below are three different approaches to creating a spatial domain. Choose the one that is most appropriate for your application.
A. Take the defaults when importing data.
B. Define a spatial domain by setting the extent and maximizing the precision.
C. Define the spatial domain by manually calculating your precision and extent.
Approach A: Take the defaults when importing data
This is the easiest of the approaches. You simply take the default spatial domain generated by the software during a data import operation.
Use this approach if you:
- Have at least one vector dataset or a group of tiled datasets that cover the entire extent of your study area
- Want the most precision possible within your study area
If you have a dataset that covers the entire study area, import the dataset first and accept the default values for the spatial domain. The defaults will create a domain that encompasses all the features with a little room to grow. If you have tiled datasets that together cover the entire study area, calculate a spatial domain that encompasses all the datasets using the Create Spatial Reference tool. Then, create an empty feature class with this spatial domain and load the tiled data into it.
Using this method, the precision will be maximized within the default extent. Because the resulting precision could be large, this would not be the best approach if you are trying to get the best performance out of an ArcSDE geodatabase. However, this approach will ensure that all your data will fit inside the spatial domain and that you are using the highest precision possible for your data.
As you create or import subsequent datasets to the geodatabase, use the spatial reference calculated from this original feature class. You can do this by importing the spatial reference from this feature class whenever you create new feature classes or feature datasets. You can also set your geoprocessing settings to use the spatial reference from this feature class.
Setting the geoprocessing environment to use a specific spatial reference
- In ArcCatalog or ArcMap, click the Tools menu and click Options.
- Click the Geoprocessing tab.
- Click the Environments button.
- Expand General Settings.
- For Output Spatial Reference, click As Specified Below.
- Next to the following input box, click the folder icon.
- On the Coordinate System tab, click Import.
- Navigate to and select the first feature class that you imported into the geodatabase.
- Click Add.
- Click OK to all the open dialog boxes.
Now all subsequent geoprocessing operations, including importing new data, performed by the current user on this machine, will use this spatial reference.
Approach B: Define a spatial domain by setting the extent and maximizing the precision
This approach helps you determine an extent for your study area, then maximizes the precision within that study area.
Use this approach if you:
- Do not have a single vector dataset that covers the extent of your study area, but you can define your study area on a map
- Want the most precision possible within your study area
The result of this approach will be exactly the same as Approach A; therefore, this approach has the same strengths and weaknesses. Before you can begin, you must know the coordinate system that you plan to use. For information on choosing a coordinate system see the Map projections topic in the ArcGIS Desktop Help. If you plan to use the State Plane or UTM coordinate systems, you can find data defining the zone locations at <ArcGIS Installation location>\ArcGIS\Reference Systems in the usstpln83 and utm shapefiles.
Determine the extent of your study area
- Start ArcMap and add reference data for the world or your area of interest. Look for reference data in the following locations:
- ESRI Data and Maps CD (included with ArcGIS)
- <ArcGIS Installation location>\ArcGIS\Metadata\Data
- Geography Network
- Set the coordinate system of the data frame to the one that you want to use for the new dataset.
- Open the data frame properties.
- Click the Coordinate System tab.
- Expand Predefined folder and navigate to the coordinate system that you plan to use.
- Click OK.
- Zoom in to the part of the world that you plan to use as a study area.
- Use the New Rectangle tool on the Draw toolbar to draw a rectangle defining your new study area on the map.
- Right-click that new rectangle and click Properties.
- Click the Size and Position tab.
- Under Position for Anchor Point, click the lower left box.
- Copy and paste the coordinates in the X and Y text boxes into a text file. Delete the unit measure at the end of the coordinates. These coordinates are the lower-left corner of your study area.
- Under Position for Anchor Point, click the upper right box.
- Copy and paste the coordinates in the X and Y text boxes into a text file. Be sure to delete the unit measure at the end of the coordinates. These coordinates are the upper-right corner of your study area.
Apply the calculated extent when creating a new feature class
- In ArcCatalog, navigate to your geodatabase, right-click, point to New, and click Feature Class.
- For name, type an appropriate name, such as StudyArea.
- Click Next.
- If necessary, specify a configuration keyword and click Next.
- In the fields list, click the SHAPE field.
- In the Field Properties table, click the Browse button next to the Spatial Reference property.
- On the Coordinate System tab, click Select and select your coordinate system.
- Click the X/Y Domain tab.
- Copy and paste your coordinates out of the text file into the appropriate text boxes on the X/Y Domain tab. Notice that the precision adjusts as you change your extent.
- Click OK to the Spatial Reference Properties dialog box.
- Click Finish on the New Feature Class wizard.
Now you can import the spatial reference from the StudyArea feature class for all other data that you create in that study area. You can also set your geoprocessing environment so all new data created from geoprocessing operations uses this spatial reference. See Approach A for how to set the geoprocessing environment to use a spatial reference from a feature class.
Approach C: Define the spatial domain by manually calculating your precision and extent
For this approach, you calculate the spatial domain parameters manually. Use this approach if you want to optimize performance in an ArcSDE geodatabase.
Calculate precision
First you must calculate an appropriate precision by choosing your storage units and calculating your precision accordingly. Set your storage units to be 10 times smaller than the best precision of your data collection. This will ensure that the precision of your data collection is maintained in the geodatabase regardless of how you manipulate the data with ArcGIS (geoprocessing, topology cluster tolerance, geometry operations, and so on). Consider the following examples:
Data collection method | Coordinate system units | Equipment precision | Recommended storage unit |
Digitize 1:250,000 map | Feet | +/-416 feet | 1 foot |
Professional GPS | Meters | +/-0.5 meter | .05 meter |
Survey with theodolite | Meters | +/- 5 millimeter | .5 millimeter |
Precision is the multiplier that converts coordinate system units into storage units. Mathematically, precision equals one coordinate system unit divided by one storage unit. The following table shows appropriate precision values using the examples above.
Data collection method | Coordinate system units | Recommended storage unit | Precision |
Digitize 1:250,000 map | Feet | 1 foot | 1 |
Professional GPS | Meters | .05 meter | 20 |
Survey with theodolite | Meters | .5 millimeter | 2000 |
Calculating precision with a geographic coordinate system (GCS)
Calculating precision based on data that uses a geographic coordinate system is slightly more difficult because angular units (degrees) are not consistent throughout the data. As the latitude changes, each degree represents a different amount of area on the ground. If you want to use a linear storage unit with data in a GCS, you will have to perform some calculations. If you calculate an appropriate precision when your angular units are at their largest, you will maintain even more precision in areas where angular units are smaller. For example, if you are maintaining 1-m precision where one degree equals one hundred miles on the ground, your geodatabase will maintain 1-cm precision where one degree equals one mile on the ground. In a geographic coordinate system, angular units are largest at the equator. Precision will equal the number of storage units in one degree at the equator. As mentioned above, this precision value should be multiplied by 10 to account for any ArcGIS processing operations. The following equation can be used:
Precision = 10 * GCS Equatorial circumference ÷ 360 ÷ Storage units
For example, GCS_WGS_1984 has a circumference of 40075016.7 meters. With storage units of 1 meter, the equation would look like this:
Precision = 10 * 40075016.7 ÷ 360 ÷ 1 meter = 1113195
Another option is to multiply the semimajor axis of the GCS by the number of radians per angular unit, which is the equivalent of:
Precision = 10 * Semimajor axis * radians per unit ÷ Storage units
You can find this technical information about your GCS by opening its properties in ArcCatalog. If you don't see the Coordinate Systems folder in ArcCatalog, you can make coordinate systems visible from the General tab of the Options dialog box in ArcCatalog.
If you are not working with a global dataset, you could calculate your precision based on your lowest latitude. This would allow you to create smaller precision values. However, if your study area ever expanded to lower latitude values, the coordinates stored in those locations would be less precise.
Check your precision against your study area
To validate that your precision will work given your study area, multiply the greater of the width or height (range) of your study area by the precision. If the result is less than 2,147,483,648, your data can fit inside a spatial domain with your chosen precision.
Even though your data can fit inside a spatial domain, your coordinates may fall outside the coordinate system boundary. Consider the following fictitious dataset with map units of meters.
A range of 800,000 (the width) multiplied by a precision of 1,000 equals 800,000,000, which is less then 2.14 billion; therefore, the data will fit. However, the upper-right corner of the study area will be 1,000,000,000x, 4,060,000,000y in the spatial domain (that is, (1,000,000x) * 1,000 and (4,060,000y) * 1,000). Notice that the y-value is outside the 0 to 2.14 billion coordinate system by about 1.9 billion units. To store these coordinates inside the geodatabase, you must shift the spatial domain to surround the data.
Calculate an appropriate min x,y
Before you can shift the spatial domain to surround your data, you must identify the center of your spatial domain in map units. The goal is to place your data in the center of the spatial domain so your data can expand in all directions if necessary. All the calculations for shifting the coordinate system are in coordinate system units rather than storage units.
First, find the center of the spatial domain in storage units:
2,147,483,648 / 2 = 1,073,741,824
Next, convert the center in storage units to coordinate system units by dividing by the precision. This example uses a precision of 1000.
1,073,741,824 / 1000 = 1,073,741.824
Now that you have found the center of the spatial domain in coordinate system units, you need to calculate a new minimum x and y of your spatial domain. The formula for calculating the minimum X and Y of your spatial domain is:
Min X = ((DataMinX + DataMaxX) / 2)—Domain center in coordinate system units
Min Y = ((DataMinY + DataMaxY) / 2)—Domain center in coordinate system units
This equation finds the minimum coordinates of your spatial domain to locate the center of your data at the center of the domain. Remember, all these calculations are in coordinate system units. Examine this equation for the x dimension given the example data:
First, find the center of your data.
(DataMinX + DataMaxX) ÷ 2
(200,000 + 1,000,000) ÷ 2 = 600,000
Next, find the difference between the center of your data and the center of geodatabase space.
Min X = 600,000 – 1,073,741.824 = –473,741.824
Because this is a negative number, the spatial domain will shift to the left. Remember, the shift is applied to the spatial domain, not the data. The shift is calculated for both dimensions, so you would need to repeat this process for the y coordinates.
Using your calculated spatial domain in ArcCatalog
Once you have calculated an appropriate spatial domain, you are ready to create spatial data in the geodatabase. When creating your first dataset, navigate to the X/Y Domain tab of the spatial reference properties and enter the Min x, Min y, and precision values that you calculated. The maximum x and y values will be calculated automatically. For all subsequent data that you import or create, you can simply import this spatial reference. You can also set your geoprocessing environment so all new data created from geoprocessing operations uses this spatial reference. See Approach A for how to set the geoprocessing environment to use a spatial reference from a feature class.
Defining z and m spatial domains
The z and m domains are easier to calculate than x and y domains. Examine your data and enter the lowest value for the minimum value and the precision to support its accuracy. You can calculate z and m precision the same way you calculated precision for the x,y coordinates. Just like x,y coordinates, you have 2,147,483,648 storage units with which to work. Generally, it is not necessary to center the z and m domains about the data, as you can set an absolute minimum based on your data.
When calculating the minimum for a z domain, you could use the lowest point on the earth (-11033 meters—Mariana trench). Generally, m coordinates are positive numbers, so a minimum value of 0 may be appropriate. You may also set the minimum m to have a slight negative offset to account for negative values that could be produced by the extrapolation of measures during operations such as Calibrate. These negative values could be corrected later instead of rejected during the extrapolation.
Setting an appropriate geodatabase spatial domain的更多相关文章
- Relationship between frequency domain and spatial domain in digital images
今天又复习了一遍<<Digital Image Processing>>的第四章,为了加深对频域的理解,我自己用PS画了一张图.如下: 然后做FFT,得到频谱图如下: 从左到右 ...
- convolution in frequency domain
https://blog.csdn.net/myjiayan/article/details/72427995 convolution in frequency domain convolution ...
- The Brain vs Deep Learning Part I: Computational Complexity — Or Why the Singularity Is Nowhere Near
The Brain vs Deep Learning Part I: Computational Complexity — Or Why the Singularity Is Nowhere Near ...
- 大规模视觉识别挑战赛ILSVRC2015各团队结果和方法 Large Scale Visual Recognition Challenge 2015
Large Scale Visual Recognition Challenge 2015 (ILSVRC2015) Legend: Yellow background = winner in thi ...
- ArcEngine二次开发错误编码对照表(转)
阅读数:3323 每当我们在进行AE开发,出现错误时经常会出现错误代码,但是我们并不知道它到底代表什么意思,这里的而错误编码我们可以对照着找到我们需要的时候常详细信息(问题是,经常还是会出现没有错误编 ...
- AE错误代码解释
每当我们在进行AE开发,出现错误时经常会出现错误代码,但是我们并不知道它到底代表什么意思,这里的而错误编码我们可以对照着找到我们需要的时候常详细信息(问题是,经常还是会出现没有错误编码HRESULT ...
- Indexing Sensor Data
In particular embodiments, a method includes, from an indexer in a sensor network, accessing a set o ...
- Going Deeper with Convolutions阅读摘要
论文链接:Going deeper with convolutions 代码下载: Abstract We propose a deep convolutional neural network ...
- 论文解读《The Emerging Field of Signal Processing on Graphs》
感悟 看完图卷积一代.二代,深感图卷积的强大,刚开始接触图卷积的时候完全不懂为什么要使用拉普拉斯矩阵( $L=D-W$),主要是其背后的物理意义.通过借鉴前辈们的论文.博客.评论逐渐对图卷积有了一定的 ...
随机推荐
- 2017年上海金马五校程序设计竞赛:Problem B : Sailing (广搜)
Description Handoku is sailing on a lake at the North Pole. The lake can be considered as a two-dime ...
- bzoj 3224 裸平衡树
裸的平衡树,可以熟悉模板用,写题写不出来的时候可以A以下缓解下心情. /************************************************************** P ...
- Pycharm中快捷键大全
#1.按住ctrl然后鼠标放在函数上就会提示出这个函数有那些参数,双击进入该函数. 1.Pycharm中快捷键大全,遇到一个更新一个 撤销与反撤销:Ctrl + z,Ctrl + Shift + z ...
- Linux nc (netcat) 详解
Linux nc (netcat) 详解 http://blog.csdn.net/michael493439861/article/details/7445454
- 堆外内存: Chronicle Map
https://www.javacodegeeks.com/2015/04/chroniclemap-java-architecture-with-off-heap-memory.html Java堆 ...
- python基础之初识python
Python的发展史 1989年圣诞节期间,吉多·范罗苏姆为了打发时间,开发了python这门语言.真他妈牛逼. Python崇尚优美.清晰.简单,是一门优秀并广泛使用的语言.2007年在TIOBE榜 ...
- MySQL的事务理解
在学习事务这一概念前,我们需要需要构思一个场景 场景构思 假设该场景发生于一个银行转账背景下,月中,又到了发工资的日子.学校打算给A老师发放一个月的工资.(此处,我们假设转账都是由人工操作的),整个过 ...
- System Center VMM请注意不同语言版本的差异
在私有云的项目中,经常需要判断System Center一些组件的连接是否OK. 我这里有开发,和测试两个环境,开发是英文版的System Center VMM,测试用的是中文版的System Cen ...
- 洛谷 P2415 集合求和【数学公式/模拟】
给定一个集合s(集合元素数量<=30),求出此集合所有子集元素之和. 输入输出格式 输入格式: 集合中的元素(元素<=1000) 输出格式: 和 输入输出样例 输入样例#1: 2 3 输出 ...
- bzoj3942
有一个S串和一个T串,长度均小于1,000,000,设当前串为U串,然后从前往后枚举S串一个字符一个字符往U串里添加,若U串后缀为T,则去掉这个后缀继续流程.将s中的每一个字符压入栈暴力将s中的字符和 ...