Recently, I had a quiet look at the previously collected ebook. The following is the reading notes of "Query" in chapter 5th of "ArcGIS Geographic Information System Tutorial _ 5th Edition" (Li Yu Long).
1. Common Applications for queries:
Select features of interest : Find which features meet specific criteria. For example, the current Chengdu which prices are I can withstand the price range? There should be no.
Explore Pattern Styles : Create a map from the selected features and check its spatial distribution. For example, in the end, where is the discharge of large quantities, causing such heavy pollution?
To isolate the elements for further analysis : for example, to analyze the individual's benefits, we must first choose the employees with high wages and less work.
Explore the spatial relationship : Which train can reach the 50-kilometer city near the destination?
Create raster queries : Vector queries are used very much, but rasters can also be queried by cells. For example, from the land use type map for nearly 3 years, the area of the city's building range changes.
Queries mainly include spatial query and attribute query (Attribute query).
2. Attribute Query
Property queries adhere to the SQL syntax, but require that each expression condition must contain a field name (even for the same field), such as SQL does not correctly recognize the expression "gay" = ' wage high ' and ' work less ' and should be written as "gay" = ' wage high ' and ' gay ' = ' work less '.
In addition to and, or, and not, XOR is sometimes useful.
When multiple expressions are encountered, use parentheses to differentiate the order of judgments, or use Select in current selection to select one step at a time.
When you blur a query, remember that the wildcard character in the Shapefile file '% ' denotes any character, ' _ ' represents a character; ' Denotes any character, '? ' Represents a character.
For example: "NAME" like '% lijie% ', expressed in 2nd%, may be considered superfluous, usually this is the case. But it's OK to avoid a special case where there are some unexpected spaces behind the name so that the correct content cannot be selected.
3. Spatial query
Spatial query is a powerful tool unique to GIS, which is based on spatial relation. For example, you are familiar with panning and zooming is also a special type of spatial query. The pan and Bloom operations define an interest rectangle based on XY coordinates and submit the software to return all the features that fall into it.
Because the accuracy and geometric accuracy of feature classes are different, there are often two of identical objects in the real world (such as river rulers and rivers) that cannot be fully matched when compared to their XY coordinates in a GIS. Specifying a search radius is useful when evaluating spatial conditions, and you can use features that do not require exact matching.
Take the problem of intersection of city and river as an example. Cities under the national scale are expressed by points, while rivers are expressed by generalized lines. Even if the city really intersects with the river, if the point takes place on the line that represents the journey to the monkey is just lucky, applying a search radius is a solution, assuming that a typical big city may be represented by a 10km2 on one side, setting a search radius of 5km might produce an acceptable result. Even so, you may encounter some incorrect results (positive correlation and negative values).
You must always remember the difference between real-world entities and the entities represented by GIS, and mitigate problems caused by scale or precision. For example, in this case, the user may continue to execute the query, but then check each selected city with an online image to ensure that the correct relationship exists.
4. Spatial relations
include : Checks if one feature contains another. It is divided into the following six situations:
A is strictly equal to B (with exactly the same geometrical characteristics), corresponding to is identical to (a equals B);
b All elements are completely surrounded by a, corresponding to a completely contains B (a completely contains B), also corresponds to B completely within a (b is completely within a range);
B is located within a, but they share an edge that corresponds to contains (A contains B) and also to B within a (b in the range of a);
Whether the center of a feature in A is within a feature range of B, corresponding to a has their center in B (a center at B).
intersect : Returns any feature in a that touches, crosses, or overlays any part of a feature in B. A is crossed by the boundary of B (A is traversed by the boundary of B) and returns a feature that crosses only the feature boundaries in B.
Proximity : Detects how close a feature in A is to a feature in B. The most common detection is is within a distance of (in ... Distance), select a feature that is within a specific distance of B in a. For example, return all plots within a 2-kilometer radius of the school. Adjacency (adjacency) is a special neighborhood where distance becomes 0, in fact the boundaries of features are in contact with each other, these conditions are share a line segment with (...). Share a line segment) and touch the boundary of (contact ... Boundary) operator is overridden.
5. Feature Selection method
3 Feature selection methods are available in ArcMap: Interactive selection, selection by attributes, and by location.
working with layers that contain selections, there is a very important principle in ArcMap: The layer features are selected, only the selected parts are processed, otherwise they are all processed.
Interactive Selection Method :
Create selection layer : After selecting a feature, you can right-create a selection layer, and the selection layer appears above the original layer, with several advantages, not only to specify its own symbol, but also to display independently of the original layer. If the selected collection is the focus of a complex analysis, the layer retains the selected features for future use, avoiding the risk of accidentally clearing the selection and having to execute it again . Select layers can be used to enter the same collection of features into different tools or commands, which is useful for viewing and documenting intermediate results for long and complex series queries. Users can also save the layer as a layer file and then use it in other map documents. When editing a source layer or selection layer, it changes at the same time.
Because feature classes are based, multiple copies of a feature are not created, and the source data is changed. This is the best solution when a temporary copy is needed, and the feature comes from your own data or an institutional database shared by multiple users.
definition query: A definition query is a property of a layer, similar to selecting a layer, but not from the selected collection, and the query actually executes the goal of defining which features are included in the layer. Like a layer, a definition query points to the original database instead of creating a copy of it, and shares the same advantages and disadvantages.