zoukankan      html  css  js  c++  java
  • Setting an appropriate geodatabase spatial domain

    原文地址:http://webhelp.esri.com/arcgisdesktop/9.1/body.cfm?tocVisable=1&ID=1470&TopicName=Setting%20an%20appropriate%20geodatabase%20spatial%20domain

    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.

    1. Will the precision of the data maintain the precision of your data collection?
    2. Will the spatial domain cover the entire extent of your study area?
    3. 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



    1. In ArcCatalog or ArcMap, click the Tools menu and click Options.
    2. Click the Geoprocessing tab.
    3. Click the Environments button.
    4. Expand General Settings.
    5. For Output Spatial Reference, click As Specified Below.
    6. Next to the following input box, click the folder icon.
    7. On the Coordinate System tab, click Import.
    8. Navigate to and select the first feature class that you imported into the geodatabase.
    9. Click Add.
    10. 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>ArcGISReference Systems in the usstpln83 and utm shapefiles.

    Determine the extent of your study area



      1. 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>ArcGISMetadataData
        • Geography Network
      1. 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.
    1. Zoom in to the part of the world that you plan to use as a study area.
    2. Use the New Rectangle tool on the Draw toolbar to draw a rectangle defining your new study area on the map.
    3. Right-click that new rectangle and click Properties.
    4. Click the Size and Position tab.
    5. Under Position for Anchor Point, click the lower left box.
    6. 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.
    7. Under Position for Anchor Point, click the upper right box.
    8. 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



    1. In ArcCatalog, navigate to your geodatabase, right-click, point to New, and click Feature Class.
    2. For name, type an appropriate name, such as StudyArea.
    3. Click Next.
    4. If necessary, specify a configuration keyword and click Next.
    5. In the fields list, click the SHAPE field.
    6. In the Field Properties table, click the Browse button next to the Spatial Reference property.
    7. On the Coordinate System tab, click Select and select your coordinate system.
    8. Click the X/Y Domain tab.
    9. 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.
    10. Click OK to the Spatial Reference Properties dialog box.
    11. 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:
    Equation 

    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.

    Dataset example 

    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.

  • 相关阅读:
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.7 @Resource
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.6 CustomAutowireConfigurer
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.5 使用泛型作为自动装配限定符
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.4 使用@Qualifier微调基于注解的自动装配
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.3 使用@Primary微调基于注解的自动装配
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.2 @Autowired
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9.1 @Required
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.9 基于注解的容器配置
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.8.3 使用FactoryBean自定义实例化逻辑
    Spring框架参考手册(4.2.6版本)翻译——第三部分 核心技术 6.8.2 使用BeanFactoryPostProcessor定制配置元数据
  • 原文地址:https://www.cnblogs.com/daidaigua/p/3360896.html
Copyright © 2011-2022 走看看