A method for regional analysis based on spatial grid index
By employing the Uber H3 grid indexing algorithm in geographic feature point and polygon data, and establishing grid index fields for joint queries, the problem of decreased spatial query performance under large data volumes is solved, achieving efficient regional analysis and good scalability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XINZHI DAOSHU (SHANGHAI) TECH CO LTD
- Filing Date
- 2022-09-09
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies suffer from decreased spatial query performance when processing large amounts of geographic feature point and polygon data, and struggle to support rapidly growing business application demands, especially when the data volume reaches millions or even tens of millions, making it impossible to perform a large number of concurrent tasks.
The Uber H3 grid spatial indexing algorithm is used to create a hexadecimal grid index for geographic feature point and area data. Joint queries are performed through the grid index fields, replacing the traditional spatial index and achieving efficient regional analysis.
It improves query efficiency, reduces index overhead and maintenance costs, supports multi-size indexes, enhances retrieval performance and computational efficiency, and maintains good scalability.
Smart Images

Figure CN115543998B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of spatial analysis of big data in geographic information systems, and in particular relates to a regional analysis method based on spatial grid index. Background Technology
[0002] With social development and economic progress, the public security industry faces increasing challenges from informatization, and system construction is paying more and more attention to the accuracy and timeliness of "events, things, and people". In project applications, there is often a need to perform spatial query analysis on a large number of geographic feature points (points of interest, POIs), such as performing spatial query analysis on millions or even tens of millions of POI data such as police incidents, monitoring equipment, and personnel trajectories according to geographic feature surfaces (AOIs).
[0003] The usual approach is as follows: First, establish a business-specific spatial database based on business needs; second, create spatial indexes for POI and AOI data respectively; third, perform a joint spatial query on AOI and POI based on business needs, obtain the query analysis results in real time, and then visualize the results on the client side. This approach is acceptable for hundreds of thousands of data points, but when the data volume reaches millions or even tens of millions, the performance of spatial join queries drops significantly, and it cannot handle a large number of concurrent tasks, making it difficult to support the rapidly growing business application needs.
[0004] Therefore, there is an urgent need for a solution that can meet the ever-increasing data volume, the growing business complexity, and maintain good performance. Summary of the Invention
[0005] This invention provides a region analysis method based on spatial grid indexing, which solves the above problems.
[0006] To solve the above-mentioned technical problems, the present invention is achieved through the following technical solution:
[0007] This invention provides a regional analysis method based on spatial grid indexing, which performs regional analysis on geographic point of interest (POI) and geographic area of interest (AOI) using spatial grid indexing, including the following steps:
[0008] Step 1: Create a thematic data table of geographic feature points (POIs). The data in the thematic data table of geographic feature points (POIs) includes attribute information such as identifier, coordinates, name, type, time, and address.
[0009] Step 2: Create a grid index field for the POI thematic database table: Use the Uber H3 grid spatial indexing algorithm to create a hexadecimal grid index for the POI data;
[0010] Step 3: Create a geographic feature surface AOI thematic data table: The geographic feature surface AOI thematic data table includes attribute information such as identifier, name, alias, coordinates, type, center point, level, and parent identifier. Each data entry in this table represents a geographic feature surface record. Step 4: Using the Uber H3 grid spatial indexing algorithm, establish a hexadecimal grid index table with resolution level k for the entire geographic feature surface range, and establish a mapping relationship between each geographic feature surface record in the geographic feature surface AOI thematic data table described in Step 3 and this grid index table. Step 5: Based on the resolution k used when creating the grid index table in Step 4, calculate the index value when the query precision level is n. If the query precision level is equal to the resolution k used when generating the grid index table in Step 4, set n=k.
[0011] Step 6: Filter geographic feature points based on conditions: After grouping and statistically analyzing the geographic feature point (POI) data and the hexadecimal grid index table described in Step 4 according to the calculated query precision level n, perform a joint query with the geographic feature surface (AOI) thematic data table described in Step 3 to establish the spatial relationship between each geographic feature point (POI) and each geographic feature surface record, and filter out the statistical analysis results that meet the conditions.
[0012] The present invention has the following advantages over the prior art:
[0013] (1) This invention no longer creates spatial indexes for spatial data, but instead creates grid index fields, which reduces the overhead of creating indexes and the maintenance cost.
[0014] (2) This invention supports multi-size spatial indexes to meet the accuracy requirements of different businesses. When the accuracy requirements are not high, it further improves the retrieval performance.
[0015] (3) The present invention uses the Uber H3 grid spatial indexing algorithm, which generates an index that is globally unique. Only the Uber H3 index needs to be known, and it can be converted to and from spatial fields.
[0016] (4) In the query process of this invention, spatial matching is no longer performed, but hexadecimal character matching is used, which greatly improves the computational efficiency;
[0017] (5) As the amount of data continues to increase and the complexity of business grows, this invention maintains good scalability in the direction of regional analysis.
[0018] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating the steps of the region analysis method based on spatial grid indexing of the present invention.
[0021] Figure 2 A flowchart of a traditional regional analysis method. Detailed Implementation
[0022] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0023] Existing traditional methods for implementing regional analysis workflows include: Figure 2 As shown, the specific steps include: establishing a business-specific spatial database based on business needs; then, creating spatial indexes for POI and AOI data respectively; next, performing a joint spatial query on AOI and POI based on business needs, obtaining the query analysis results in real time, and then visualizing them on the client side. However, for data volumes reaching millions or even tens of millions, the performance of spatial join queries degrades significantly, and it cannot handle large numbers of concurrent tasks, making it difficult to support the rapidly growing demands of business applications. Therefore, this technical solution is proposed.
[0024] This invention introduces a highly efficient spatial indexing algorithm that enables cascading spatial query analysis with different precision (resolution) across different datasets. Furthermore, the efficiency improvement of this indexing algorithm is significant as the amount of data increases and the complexity of spatial queries increases.
[0025] Please see Figure 1 As shown, the present invention provides a regional analysis method based on spatial grid indexing, which is applied to the analysis of millions or even tens of millions of POI data such as police reports, monitoring equipment, and personnel trajectories, and performs partitioned spatial query analysis according to geographic feature surfaces (new area surfaces, AOIs), including the following steps:
[0026] Step 1: Create a thematic data table for Points of Interest (POIs). The data in the thematic data table for Points of Interest (POIs) includes attribute information such as identifier, coordinates, name, type, time, and address.
[0027] Specifically, the process involves: First, installing the PostGIS extension and the H3-PG extension plugin for the PG data. Then, importing the obtained police incident data table (case_poi), and creating a corresponding POI thematic data table with each police incident as a geographic feature point. This table contains attribute information such as the geographic identifier, coordinates, geographic name, type, time, and address of the corresponding police incident geographic feature point. Types include "minor, ordinary, relatively serious, serious, etc."; events include "this month, this year, today, this week, etc."
[0028] Step 2: Create a grid index field for the POI thematic database table: Use the Uber H3 grid spatial indexing algorithm to create a hexadecimal grid index for the POI data;
[0029] Specifically, a spatial grid index field (h3_index) is created for the police incident data table, and a hexadecimal grid index is established for the geographical feature point (POI) data of police incidents, specifically by generating spatial grid index values at a resolution of k=14.
[0030] Step 3: Create a geographic feature polygon AOI thematic data table: The geographic feature polygon AOI thematic data table includes attribute information such as identifier, name, alias, coordinates, type, center point, level, and parent identifier. Each data entry in this table represents a geographic feature polygon record.
[0031] In this specific embodiment, the county-level administrative division data table (county_aoi) is imported, taking Xi'an City, Shaanxi Province as an example. This table contains attribute information such as geographic identifier, geographic name, geographic alias, geographic coordinates, geographic type, geographic center point, geographic level, and geographic parent identifier of the corresponding geographic surface feature AOI thematic data of Xi'an City; Step 4: Using the Ube rH3 grid spatial indexing algorithm, a hexadecimal grid index table with a resolution level of k is established for the entire range of the geographic feature surface, and the mapping relationship between each geographic feature surface record in the geographic feature surface AOI thematic data table described in Step 3 and the grid index table is established;
[0032] In this specific embodiment, the steps are as follows: 1. Create an administrative division data spatial grid index mapping table (relation_county); 2. The spatial grid index field (h3_index) is the spatial grid index value generated at a resolution of k=14; 3. The county-level administrative division identifier field (county_id) is used as a foreign key; 4. Based on the resolution k used when creating the grid index table in step 4, calculate the index value when the query precision level is n. If the query precision level is equal to the resolution k used when generating the grid index table in step 4, then n=k.
[0033] In this specific embodiment, the index value is calculated based on the created grid index value k=14, when the query precision is n=12.
[0034] Step 6: Filter geographic feature points based on conditions: After grouping and statistically analyzing the geographic feature point POI data and the hexadecimal grid index table described in Step 4 according to the grid index value with a query precision level of n, perform a joint query with the geographic feature surface AOI thematic data table described in Step 3 to establish the spatial relationship between each geographic feature point POI and each geographic feature surface record, and filter out the statistical analysis results that meet the conditions.
[0035] Specifically, in this particular embodiment:
[0036] Set the query filter conditions for the police incident table: select "major" as the case type associated with the police incident data table, select "this month" for the time, and group and count according to the police incident index value; then, group and count according to the index field (h3_index) for both the spatial grid index mapping table and the police incident data table; and perform a joint query on the statistical results of the above two steps in conjunction with the district and county-level administrative division data table (county_aoi).
[0037] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A regional analysis method based on spatial grid indexing, which performs regional analysis on geographic point of interest (POI) and geographic area of interest (AOI) using spatial grid indexing, characterized in that... Includes the following steps: Step 1: Create a thematic data table of geographic feature points (POIs). The data in the thematic data table of geographic feature points (POIs) includes attribute information such as identifier, coordinates, name, type, time, and address. Step 2: Create a grid index field for the POI thematic database table: Use the Uber H3 grid spatial indexing algorithm to create a hexadecimal grid index for the POI data; Step 3: Create a geographic feature surface AOI thematic data table: The geographic feature surface AOI thematic data table includes attribute information such as identifier, name, alias, coordinates, type, center point, level, and parent identifier. Each data entry in this table is a geographic feature surface record. Step 4: Using the Uber H3 grid spatial indexing algorithm, establish a hexadecimal grid index table with a resolution of k for the entire range of geographic feature surfaces, and establish a mapping relationship between each geographic feature surface record in the geographic feature surface AOI thematic data table described in Step 3 and the grid index table. Step 5: Based on the resolution k used when creating the grid index table in Step 4, calculate the index value when the query precision level is n. If the query precision level is equal to the resolution k used when generating the grid index table in Step 4, take n=k. Step 6: Filter the geographic feature points (POIs) based on the calculated query precision level n of the grid index value. After grouping and statistically analyzing the geographic feature point (POI) data and the hexadecimal grid index table described in Step 4, perform a joint query with the geographic feature surface (AOI) thematic data table described in Step 3 to establish the spatial relationship between each geographic feature point (POI) and each geographic feature surface record, and filter out the statistical analysis results that meet the conditions.