Spatial Query in GIS

Source: Internet
Author: User

Spatial Query and analysis are at the core of GIS, and most of the daily tasks of GIS engineering projects are related to query. GIS Query types can be divided into three types: simple attribute query, spatial location-related query, and joint query related to spatial location and attribute. In this topic, we will detail how to perform these three queries in Supermap GIS 5 Desktop products.

 

1. Simple attribute Query

A simple property query means that the query condition is only related to the attributes of a spatial object, but not to the geographical location of the object. This type of query is usually "What are three-star hotels in XX City ?", "What are the lakes in a province with an area greater than 100 square kilometers ?", "Is a building with a floor height lower than 6 floors in a certain residential area ?" And so on. In the Supermap GIS 5 desktop product, this type of query can be completed by map SQL query and dataset SQL query. The following describes how to query hotels with more than three stars in Beijing.

Step 1: Prepare the travel traffic map data of Beijing.

Step 2: Open the map, as shown in:

 

Beijing Tourism and traffic map (partial)

 

Step 3 select "query-> SQL query ...", The SQL query dialog box is displayed as follows:

Menu position

Map query dialog box

 

Step 4: Enter query conditions for query

Assume that the "hotel star" field is userdef and "userdef> = 3" is entered in the query conditions. You can directly enter the query conditions, you can also click the appropriate project input on each project. If you want to browse the query results in the Map window, check the "Browse map" check box, or save the query results as datasets.

Step 5: browse the query results.

The result is displayed in the Properties window, as shown in. You can locate the corresponding hotel through properties, or locate the hotel properties by map.

Query Result Display

 

 

2. Joint query related to both spatial locations and attribute Conditions

The query described in the previous section is the simplest type of GIS Query. The query conditions only involve attribute conditions. However, more query conditions require both attribute conditions and spatial conditions. The following uses a typical spatial query problem in GIS as an example to describe how to use the comprehensive query in the Supermap GIS 5 desktop product.

Problem: A Street needs to be expanded from 20 meters to 40 meters. Therefore, the buildings on both sides of the street need to be demolished. In order to consider the cost of demolition, it is necessary to calculate the area of the building that falls within the demolition range and has 6 floors at the same time. Assume that the demolition cost is RMB/meter 2, and the final demolition cost is calculated, to help determine whether to expand the road.

Step 1: Prepare data, that is, street chart and street building diagram.

Road and building Diagram

Step 2: create a buffer for the road.

Create a buffer

Buffer result

Step 3: Use the Supermap GIS 5 desktop product for comprehensive query.

Function entry of Integrated Query

Integrated Query dialog box

 

Step 4: select the computing object and enter the query conditions.

The spatial query dialog box is a floating window. You need to select an object in the Map window as the computing object. Spatial Query supports different query conditions for the same computing object on different layers. You can select different layers, select a condition in the space query condition, and enter the attribute conditions in the attribute condition input box. You can also select different layers for query.

In this example, we select the generated buffer polygon as the calculation object, so first use the mouse to select the polygon. Enter "smuserid> = 6" in the property condition (assuming that smuserid represents the number of floors of the building), and select "intersection with query object" in the space condition ", click "query.

The query result is displayed as an attribute table in the Map window. If you perform a multi-layer query, multiple attribute tables are generated. One Attribute Table corresponds to one layer to be queried. In each query result attribute table, you can locate records or save all or some objects in the Attribute Table as datasets.

After the query is completed, you can perform further Operations and Analysis on the results, which is exactly the same as using a common dataset.

Query Result

 

Step 5: Save the query result as a dataset. You can use the shortcut menu in the Integrated Query output window: Save As a dataset.

Save the result as a dataset

Step 6: Open the saved result, browse the property data, and perform analysis and statistics. Specifically, you can use the shortcut menu in the Workspace Manager to display the property data of the dataset, and then use the statistical function of the Property Window to complete the statistical function.

Shortcut menu location

Entry to the field statistics function

Field statistics dialog box

Use the statistical dialog box to calculate the total area of the demolition by calculating the sum of the area field, so that you can know the demolition cost. So far, this question has been answered. In reality, many problems may be more complicated than this example, and can be completely solved according to the above steps and ideas.

 

 

3. Simple space Query

Two of the three types of queries are described above. The third type of queries are only related to spatial conditions. You can use the Integrated Query dialog box to perform queries. The query method is basically the same as the second type, the only difference is that the attribute condition must be null. For detailed steps of space-based queries, refer to the steps in the second query.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.