Administrative division indexing method and system for raster data

By traversing and calculating grid point values, judging and cumulative administrative division area, the problems of large errors and slow speeds of administrative division statistics in the existing technology are solved, and higher statistical accuracy and speed are achieved.

CN114064822BActive Publication Date: 2025-02-18BEIJING SIPAIDE INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010743828.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-29
Publication Date
2025-02-18
Estimated Expiration
2040-07-29

AI Technical Summary

Technical Problem

When conducting administrative division statistics for grid data, the prior art has problems such as large statistical errors and slow calculation speed, and it is impossible to complete the division statistics accurately and quickly.

Method used

By traversing all grid points within the administrative division range to be indexed, calculating the grid point value of each grid point, judging the administrative division to which the grid point belongs, and cumulating the area of ​​each administrative division, the accuracy and speed of administrative division index are improved.

Benefits of technology

It achieves higher accuracy and speed of administrative division statistics, reduces statistical errors, and improves the efficiency of data search and statistics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114064822B_ABST
    Figure CN114064822B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for indexing administrative divisions of raster data, the method comprising: traversing all grid points within the scope of the administrative division to be indexed; calculating the grid point value of each grid point; there are 1-4 partial areas of administrative divisions in each of the grid points, the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point, and the ratio is stored and sorted according to the coding of the corresponding administrative division; judging the administrative division to which the grid point index belongs according to the grid point value, and accumulating the areas of each administrative division. The present invention classifies and assigns values ​​to the grid points to judge whether the grid points are split grid points, and if they are split grid points, the corresponding administrative division area is accumulated according to the area of ​​the administrative division to which the grid points belong, thereby realizing the indexing of the administrative division of each grid point and improving the accuracy and speed of administrative division statistics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image recognition and information indexing, and in particular to a method and system for indexing administrative divisions of raster data. Background Art

[0002] In order to meet the needs of the agricultural climate zoning project, taking Guangxi litchi as an example, the growth of litchi is related to the "annual average temperature (℃)", "annual extreme minimum temperature (℃)", "total low temperature accumulation from December to March with daily average temperature ≤10℃", and "number of consecutive days with daily average temperature ≤15℃ from March to May"; these related factor data are raster data with a resolution of 1 km. After a series of calculations, the distribution of litchi suitability in Guangxi is finally obtained, that is, the raster product data with a resolution of 1 km. The product data contains 4 values: 1 for the most suitable, 2 for suitable, 3 for sub-suitable, and 4 for unsuitable; according to the user's requirements, the product data needs to be zoning statistics, that is, the area of ​​the four types of regions in each county in Guangxi is calculated.

[0003] To achieve the above purpose, relevant technologies already exist, such as: Figure 1 As shown in the figure, taking Guangxi as an example, when doing regional statistics, the county polygons of Guangxi are traversed. For each county polygon, the grid points within the circumscribed rectangle of the polygon are traversed; for each grid point, it is determined whether the grid point is within the polygon. If so, the area of ​​the grid point is accumulated; otherwise, the next grid point is traversed. However, this technology has the following problems:

[0004] 1. The statistical error is relatively large. The reason is that a grid point may belong to multiple administrative region polygons, but this technology cannot split the grid points. It can only simply determine whether a grid point is within the administrative region polygon, which will inevitably lead to repeated or missed statistics.

[0005] 2. The calculation speed is slow and cannot meet user requirements. Each time this technology performs zoning statistics, each grid point must be judged at least once whether it is within a certain polygon; administrative area polygons are often very complex, with many nodes, and the larger the scale, the more nodes, and the slower the speed.

[0006] In summary, how to complete zoning statistics accurately and quickly is an urgent problem to be solved in this field. Summary of the invention

[0007] The purpose of the present invention is to provide a method and system for administrative division indexing of raster data to improve the accuracy and speed of administrative division indexing.

[0008] To achieve the above object, the present invention provides an administrative division indexing method for raster data, the method comprising:

[0009] Traverse all grid points within the administrative division to be indexed;

[0010] Calculate the grid point value of each grid point; each grid point contains 1-4 partial areas of administrative divisions, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point, and the ratio is stored and sorted according to the code of the corresponding administrative division;

[0011] The administrative division to which the grid point index belongs is determined according to the grid point value, and the areas of each administrative division are accumulated.

[0012] Optionally, before traversing all grid points within the administrative division to be indexed, the method further includes:

[0013] Encode all administrative divisions within the indexed administrative division to generate an administrative division code table;

[0014] Perform grid division on the administrative division range to be indexed, and obtain a division grid result consisting of a number of grid points;

[0015] Obtaining a single-value thematic map of administrative divisions in a geographic information system, determining a color value of each administrative division; and storing the color value in association with the administrative division code table.

[0016] Optionally, the calculation of the grid point value of each grid point specifically includes

[0017] Define grid point values: when a grid point belongs to only one administrative division, the grid point value of the grid point is the code of the administrative division; when a grid point belongs to two administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; when a grid point belongs to three administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid points of two administrative divisions in each administrative division to the area of ​​the grid point, the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; when a grid point belongs to four administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions;

[0018] Counting the color value and the number of pixels corresponding to each administrative division in the grid;

[0019] Calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point;

[0020] The ratios are arranged in ascending order according to the codes of the administrative divisions, and stored in a storage sequence corresponding to the grid points.

[0021] Optionally, the storage space of each of the grid points occupies 4 bytes, and the value stored in each byte is the number "0"-"9" in the ASCII code; when the grid point belongs to only one administrative division, the 4 bytes of the grid point store the code of the administrative division; when the grid point belongs to two or three administrative divisions, every 2 bytes of the grid point store a ratio; when the grid point belongs to four administrative divisions, every 1 byte of the grid point stores a ratio;

[0022] The storage space of the code of each administrative division occupies 4 bytes, and the value stored in each byte is the letters "A"-"Z" in the ASCII code, and the 4 bytes represent the province, city, county and township respectively.

[0023] Optionally, judging the administrative division to which the grid point index belongs according to the grid point value and accumulating the areas of each administrative division specifically includes:

[0024] When it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", it is determined that the grid point corresponding to the grid point value belongs to an administrative division, and the area of ​​the grid point is accumulated to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value;

[0025] When it is determined that the value stored in each byte of the grid point value is between "0" and "9", the code of the administrative division to which the grid point belongs is searched, and the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point is obtained according to the code of each administrative division, and the area of ​​the grid point in each administrative division is calculated, and the area of ​​the grid point in each administrative division is accumulated to the corresponding administrative division area.

[0026] Optionally, searching for the code of the administrative division to which the grid point belongs specifically includes:

[0027] Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division;

[0028] When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different;

[0029] When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different;

[0030] When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

[0031] The present invention also provides an administrative division index system for raster data, the system comprising:

[0032] Traversing grid point units is used to traverse all grid points within the administrative division to be indexed;

[0033] A grid point value calculation unit, used to calculate the grid point value of each grid point; each grid point has 1-4 administrative division partial areas, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point, and the ratio is stored and sorted according to the code of the corresponding administrative division;

[0034] The index statistics unit is used to determine the administrative division to which the grid point index belongs according to the grid point value, and accumulate the areas of each administrative division.

[0035] Optionally, the grid point value calculation unit includes

[0036] A definition subunit is used to define a grid point value: when a grid point belongs to only one administrative division, the grid point value of the grid point is the code of the administrative division; when a grid point belongs to two administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; when a grid point belongs to three administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid points of two administrative divisions in each administrative division to the area of ​​the grid point, the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; when a grid point belongs to four administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions;

[0037] A pixel counting subunit, used to count the color value and the number of pixels corresponding to each administrative division in the grid point;

[0038] A ratio calculation subunit, used to calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point;

[0039] The ratio sorting arranges the ratios in ascending order according to the codes of the administrative divisions, and stores them in the storage sequence corresponding to the grid points.

[0040] Optionally, the storage space of each of the grid points occupies 4 bytes, and the value stored in each byte is the number "0"-"9" in the ASCII code; when the grid point belongs to only one administrative division, the 4 bytes of the grid point store the code of the administrative division; when the grid point belongs to two or three administrative divisions, every 2 bytes of the grid point store a ratio; when the grid point belongs to four administrative divisions, every 1 byte of the grid point stores a ratio;

[0041] The storage space of the code of each administrative division occupies 4 bytes, and the value stored in each byte is the letters "A"-"Z" in the ASCII code, and the 4 bytes represent the province, city, county and township respectively.

[0042] Optionally, the index statistics unit includes:

[0043] The non-divided grid point area accumulation subunit is used to determine that the grid point corresponding to the grid point value belongs to an administrative division when it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", and accumulate the grid point area to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value;

[0044] The divided grid point area accumulation subunit is used to search for the code of the administrative division to which the grid point belongs when it is determined that the value stored in each byte in the grid point value is between "0" and "9", obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point according to the code of each administrative division, calculate the area of ​​the grid point in each administrative division, and accumulate the area of ​​the grid point in each administrative division to the corresponding administrative division area.

[0045] The searching for the code of the administrative division to which the grid point belongs specifically includes:

[0046] Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division;

[0047] When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different;

[0048] When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different;

[0049] When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

[0050] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the administrative division indexing method and system of the grid data provided by the present invention classifies and assigns values ​​to the grid points to determine whether the grid points are split grid points. If they are split grid points, the corresponding administrative division area is accumulated according to the area of ​​the administrative division to which the grid points belong, thereby realizing the indexing of the administrative division of each grid point and improving the accuracy of administrative division statistics. In addition, the present invention predetermines the administrative division of the grid points in a spatially segmented manner, that is, the grid point value of each grid point is assigned the code and area ratio of the administrative division, and in the subsequent area accumulation, only the code and accumulated area of ​​the accumulated administrative division need to be determined, thereby improving the speed of data search and statistics. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A flowchart of a method for indexing administrative divisions of raster data in the prior art;

[0053] Figure 2 A flowchart of a method for indexing administrative divisions of raster data provided by an embodiment of the present invention;

[0054] Figure 3 A flowchart of grid point value calculation provided by an embodiment of the present invention;

[0055] Figure 4 This is a schematic diagram of the two administrative regions to which the grid points belong;

[0056] Figure 5 This is a schematic diagram of the three administrative regions to which the grid points belong;

[0057] Figure 6 Schematic diagram of the four administrative regions to which the grid points belong. DETAILED DESCRIPTION

[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The purpose of the present invention is to provide a method and system for administrative division indexing of raster data to improve the accuracy and speed of administrative division indexing.

[0060] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0061] like Figure 2 As shown, the administrative division indexing method for raster data provided in this embodiment includes the following steps:

[0062] S1: Encode all administrative divisions within the indexed administrative division and generate an administrative division code table;

[0063] When defining the administrative area code table, it is necessary to determine that the definition fields are also included: administrative area code, administrative area name, internal code. According to actual needs, boundary ranges, coloring points, etc. may also be included. For the administrative area code used in the subsequent implementation of the internal code, its storage space occupies 4 bytes, and the value stored in each byte can be any letter of the letter "A"-"Z" in the ASCII code, or any letter of "a"-"z". The 4 bytes represent the province, city, county and township respectively. For the convenience of description, in this embodiment, each byte value is encoded starting from the ASCII code 'A', and the encoding table shown in Table 1 below can be obtained.

[0064] Table 1

[0065] Province city county Township Byte 3 Byte 2 Byte 1 Byte 0 Shanxi Province Jinzhong City Yushe County Xima Township A A A A Shanxi Province Jinzhong City Yushe County Shirakita Township A A A B Shanxi Province Jinzhong City Taigu County Chengguan Town A A B A Shanxi Province Datong City Tianzhen County Chengguan Town A B A A Hebei Province Shijiazhuang City Zhengding County Chengguan Town B A A A … … … … … … … …

[0066] S2: Perform grid division on the administrative division range to be indexed, and obtain a division grid result consisting of a number of grid points;

[0067] The grid division can set the size of the divided cells according to the accuracy or resolution requirements. The smaller the cell size, the more accurate the statistical results. However, the more cell divisions there are, the slower the data search speed will be. Therefore, the number of cells cannot be increased indefinitely. It is necessary to find a balance between the number of cells and the search speed to ensure statistical accuracy and speed.

[0068] S3: Obtaining a single-value thematic map of administrative divisions in a geographic information system, determining a color value of each administrative division; and storing the color value in association with the administrative division code table;

[0069] This embodiment uses an existing geographic information system (GIS) platform to create a map window, add an administrative division single-value thematic layer to the map window, and each administrative region polygon corresponds to a color value; so as to facilitate the subsequent identification of administrative divisions.

[0070] S4: traverse all grid points within the administrative division to be indexed;

[0071] In actual application, the administrative area polygon is traversed, the viewport size is set to the bounding rectangle size / resolution*10, the bounding rectangle is obtained, and the grid point size is expanded to ensure that the grid points intersecting with the administrative area polygon are completely included.

[0072] S5: Calculate the grid point value of each grid point; each grid point contains 1-4 partial areas of administrative divisions, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point, and the ratio is stored and sorted according to the code of the corresponding administrative division;

[0073] like Figure 3 As shown, step S5 specifically includes the following steps:

[0074] S51: Define grid point values: The storage space of each grid point occupies 4 bytes, and the value stored in each byte is the number "0" to "9" in ASCII code. The assignment of grid point values ​​is divided into three cases:

[0075] (1) When a grid point belongs to only one administrative division, the grid point value is the code of the administrative division, and the 4 bytes of the grid point store the code of the administrative division; that is, the grid point is a non-divided grid point. In the subsequent administrative division statistics, the area of ​​the grid point can be directly accumulated into the area of ​​the administrative division to which it belongs.

[0076] (2) When the grid point belongs to two administrative divisions, such as Figure 4 As shown in the figure, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; each 2 bytes of the grid point stores a ratio; then 4 bytes store the area ratios corresponding to the two administrative divisions. In the subsequent administrative division statistics, the area ratio can be used as the weight of the administrative division to which it belongs, and the area of ​​the grid point can be accumulated into the area of ​​the administrative division to which it belongs according to this weight.

[0077] When the grid points belong to three administrative divisions, such as Figure 5As shown, the grid point value of the grid point is the ratio of the area of ​​the grid points of two administrative divisions in each administrative division to the area of ​​the grid point, and the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; each 2 bytes of the grid point stores a ratio; then 4 bytes store the area ratios corresponding to the two administrative divisions, and the remaining area ratio can be obtained by subtracting the stored value from 1, which can reduce the amount of data storage, while ensuring that the storage space and storage format of the grid point value are consistent, which is more convenient for subsequent data processing. In the subsequent administrative division statistics, the area ratio can be used as the weight of the administrative division to which it belongs, and the area of ​​the grid point can be accumulated into the area of ​​the administrative division to which it belongs according to this weight.

[0078] (3) When the grid points belong to four administrative divisions, such as Figure 6 As shown, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratio is arranged in ascending order according to the code of the administrative division; each byte of the grid point stores a ratio, and in the subsequent administrative division statistics, the area ratio can be used as the weight of the administrative division to which it belongs, and the area of ​​the grid point is accumulated to the area of ​​the administrative division to which it belongs according to this weight.

[0079] S52: Counting the color value and the number of pixels corresponding to each administrative division in the grid point;

[0080] S53: Calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point; it is necessary to ensure that the sum of the calculated ratios is 1.

[0081] S54: Arrange the ratios in ascending order according to the codes of the administrative divisions, and store them in a storage sequence corresponding to the grid points.

[0082] S6: Determine the administrative division to which the grid point index belongs according to the grid point value, and accumulate the areas of each administrative division.

[0083] The step S6 specifically includes:

[0084] S61: When it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", it is determined that the grid point corresponding to the grid point value belongs to an administrative division, and the area of ​​the grid point is accumulated to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value;

[0085] S62: When it is determined that the value stored in each byte of the grid point value is between "0" and "9", the code of the administrative division to which the grid point belongs is searched, and the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point is obtained according to the code of each administrative division, and the area of ​​the grid point in each administrative division is calculated, and the area of ​​the grid point in each administrative division is accumulated to the corresponding administrative division area.

[0086] The code of the administrative division to which the grid point belongs is specifically searched as follows:

[0087] Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division;

[0088] When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different;

[0089] When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different;

[0090] When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

[0091] The advantages of the present invention are described below by a group of comparative examples:

[0092] Table 2 shows the statistical results of the regionalization of Guangxi region using the existing method of only judging whether the grid point is within the polygon

[0093]

[0094]

[0095]

[0096] Table 3 is the statistical result of the division of Guangxi region indexed by the administrative division indexing method of the raster data of the present invention.

[0097]

[0098]

[0099]

[0100]

[0101] It can be clearly seen from the deviation means in Table 2 and Table 3 that the deviation of the present application is smaller than that of the prior art, which shows that the statistical results of the administrative division indexing method for raster data provided by the present invention are more accurate.

[0102] Table 4 is a comparison table of the operation speed of the prior art and the present invention.

[0103]

[0104] It can be seen that the statistical speed of the present invention is much lower than that of the prior art.

[0105] This embodiment also provides a system for indexing administrative divisions of raster data corresponding to the above-mentioned method for indexing administrative divisions of raster data, the system comprising:

[0106] Traversing grid point units is used to traverse all grid points within the administrative division to be indexed;

[0107] A grid point value calculation unit, used to calculate the grid point value of each grid point; each grid point has 1-4 administrative division partial areas, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point, and the ratio is stored and sorted according to the code of the corresponding administrative division;

[0108] The index statistics unit is used to determine the administrative division to which the grid point index belongs according to the grid point value, and accumulate the areas of each administrative division.

[0109] Furthermore, the grid point value calculation unit includes

[0110] A definition subunit is used to define a grid point value: when a grid point belongs to only one administrative division, the grid point value of the grid point is the code of the administrative division; when a grid point belongs to two administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; when a grid point belongs to three administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid points of two administrative divisions in each administrative division to the area of ​​the grid point, the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; when a grid point belongs to four administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions;

[0111] A pixel counting subunit, used to count the color value and the number of pixels corresponding to each administrative division in the grid point;

[0112] A ratio calculation subunit, used to calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point;

[0113] The ratio sorting arranges the ratios in ascending order according to the codes of the administrative divisions, and stores them in the storage sequence corresponding to the grid points.

[0114] It should be noted that the storage space of each grid point occupies 4 bytes, and the value stored in each byte is the number "0"-"9" in the ASCII code; when the grid point belongs to only one administrative division, the 4 bytes of the grid point store the code of the administrative division; when the grid point belongs to two or three administrative divisions, every 2 bytes of the grid point store a ratio; when the grid point belongs to four administrative divisions, every 1 byte of the grid point stores a ratio;

[0115] The storage space of the code of each administrative division occupies 4 bytes, and the value stored in each byte is the letters "A"-"Z" in the ASCII code, and the 4 bytes represent the province, city, county and township respectively.

[0116] Furthermore, the index statistics unit includes:

[0117] The non-divided grid point area accumulation subunit is used to determine that the grid point corresponding to the grid point value belongs to an administrative division when it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", and accumulate the grid point area to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value;

[0118] The divided grid point area accumulation subunit is used to search for the code of the administrative division to which the grid point belongs when it is determined that the value stored in each byte in the grid point value is between "0" and "9", obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point according to the code of each administrative division, calculate the area of ​​the grid point in each administrative division, and accumulate the area of ​​the grid point in each administrative division to the corresponding administrative division area.

[0119] The searching for the code of the administrative division to which the grid point belongs specifically includes:

[0120] Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division;

[0121] When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different;

[0122] When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different;

[0123] When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

[0124] As for the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.

[0125] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for indexing administrative divisions of raster data, characterized in that: The method comprises: Traverse all grid points within the administrative division to be indexed; Calculate the grid point value of each grid point; each grid point contains 1-4 partial areas of administrative divisions, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point or the code of the administrative division, and the ratio is stored and sorted according to the code of the corresponding administrative division; Determine the administrative division to which the grid point index belongs according to the grid point value, and accumulate the area of ​​each administrative division; The storage space of each grid point occupies 4 bytes, and the value stored in each byte is the number "0"-"9" in the ASCII code or the letter "A"-"Z" in the ASCII code; when the grid point belongs to only one administrative division, the 4 bytes of the grid point store the code of the administrative division; when the grid point belongs to two or three administrative divisions, every 2 bytes of the grid point store a ratio; when the grid point belongs to four administrative divisions, every 1 byte of the grid point stores a ratio; The storage space of the code of each administrative division occupies 4 bytes, and the value stored in each byte is the letters "A" to "Z" in the ASCII code, and the 4 bytes represent the province, city, county and township respectively; The step of determining the administrative division to which the grid point index belongs according to the grid point value and accumulating the areas of each administrative division specifically includes: When it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", it is determined that the grid point corresponding to the grid point value belongs to an administrative division, and the area of ​​the grid point is accumulated to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value; When it is determined that the value stored in each byte of the grid point value is between "0" and "9", the code of the administrative division to which the grid point belongs is searched, and the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point is obtained according to the code of each administrative division, and the area of ​​the grid point in each administrative division is calculated, and the area of ​​the grid point in each administrative division is accumulated to the corresponding administrative division area.

2. The administrative division indexing method of raster data according to claim 1, characterized in that: Before traversing all grid points within the administrative division to be indexed, the method further includes: Encode all administrative divisions within the indexed administrative division to generate an administrative division code table; Perform grid division on the administrative division range to be indexed, and obtain a division grid result consisting of a number of grid points; Obtaining a single-value thematic map of administrative divisions in a geographic information system, determining a color value of each administrative division; and storing the color value in association with the administrative division code table.

3. The administrative division indexing method of raster data according to claim 1, characterized in that: The calculating of the grid point value of each grid point specifically includes: Define grid point values: when a grid point belongs to only one administrative division, the grid point value of the grid point is the code of the administrative division; when a grid point belongs to two administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; when a grid point belongs to three administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid points of two administrative divisions in each administrative division to the area of ​​the grid point, the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; when a grid point belongs to four administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; Counting the color value and the number of pixels corresponding to each administrative division in the grid; Calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point; The ratios are arranged in ascending order according to the codes of the administrative divisions, and stored in a storage sequence corresponding to the grid points.

4. The administrative division indexing method of raster data according to claim 1, characterized in that: The code of the administrative division to which the grid point belongs is specifically searched as follows: Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division; When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different; When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different; When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

5. An administrative division indexing system for raster data, characterized in that: The system comprises: Traversing grid point units is used to traverse all grid points within the administrative division to be indexed; A grid point value calculation unit, used to calculate the grid point value of each grid point; each grid point contains 1-4 partial areas of administrative divisions, and the grid point value is the ratio of the area occupied by each administrative division in the grid point to the area of ​​the grid point or the code of the administrative division, and the ratio is stored and sorted according to the code of the corresponding administrative division; An index statistics unit, used for determining the administrative division to which the grid point index belongs according to the grid point value, and accumulating the area of ​​each administrative division; The storage space of each grid point occupies 4 bytes, and the value stored in each byte is the number "0"-"9" in the ASCII code or the letter "A"-"Z" in the ASCII code; when the grid point belongs to only one administrative division, the 4 bytes of the grid point store the code of the administrative division; when the grid point belongs to two or three administrative divisions, every 2 bytes of the grid point store a ratio; when the grid point belongs to four administrative divisions, every 1 byte of the grid point stores a ratio; The storage space of the code of each administrative division occupies 4 bytes, and the value stored in each byte is the letters "A" to "Z" in the ASCII code, and the 4 bytes represent the province, city, county and township respectively; The index statistics unit includes: The non-divided grid point area accumulation subunit is used to determine that the grid point corresponding to the grid point value belongs to an administrative division when it is determined that the value stored in each byte of the grid point value is greater than or equal to "A", and accumulate the grid point area to the area of ​​the administrative division according to the code of the administrative division corresponding to the grid point value; The grid point area accumulation subunit is used to search for the code of the administrative division to which the grid point belongs when it is determined that the value stored in each byte of the grid point value is between "0" and "9", obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point according to the code of each administrative division, calculate the area of ​​the grid point in each administrative division, and accumulate the area of ​​the grid point in each administrative division to the corresponding administrative division area; The searching for the code of the administrative division to which the grid point belongs specifically includes: Taking the grid point as the center, there are multiple layers of grid points around the grid point, and whether there is a non-divided grid point in each layer of grid points is determined to determine the code of the administrative division to which the grid point belongs; the non-divided grid point is a grid point that belongs to only one administrative division; When the grid point belongs to two administrative divisions, determining two non-dividing grid points closest to the grid point, and the two non-dividing grid points belong to two administrative divisions respectively, that is, the grid point values ​​of the two non-dividing grid points are different; When the grid point belongs to three administrative divisions, three non-dividing grid points closest to the grid point are determined, and the three non-dividing grid points belong to three administrative divisions respectively, that is, the grid point values ​​of the three non-dividing grid points are different; When the grid point belongs to four administrative divisions, four non-divided grid points closest to the grid point are determined, and the four non-divided grid points belong to four administrative divisions respectively, that is, the grid point values ​​of the four non-divided grid points are different.

6. The administrative division indexing system for raster data according to claim 5, characterized in that: The grid point value calculation unit includes Define subunits, which are used to define grid point values: when a grid point belongs to only one administrative division, the grid point value of the grid point is the code of the administrative division; When a grid point belongs to two administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; when a grid point belongs to three administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid points of two of the administrative divisions in each administrative division to the area of ​​the grid point, the two ratios are arranged in ascending order according to the codes of the administrative divisions, and the corresponding grid point value of the third administrative division is the difference between 1 and the two ratios; When a grid point belongs to four administrative divisions, the grid point value of the grid point is the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point, and the ratios are arranged in ascending order according to the codes of the administrative divisions; A pixel counting subunit, used to count the color value and the number of pixels corresponding to each administrative division in the grid point; A ratio calculation subunit, used to calculate the ratio of the number of pixels corresponding to the same color value to the total number of all pixels in the grid point, and obtain the ratio of the area of ​​the grid point in each administrative division to the area of ​​the grid point; The ratio sorting arranges the ratios in ascending order according to the codes of the administrative divisions, and stores them in the storage sequence corresponding to the grid points.

Citation Information

Patent Citations

  • Upscaling conversion method for discrete spatial data

    CN102521271A

  • Mesoscale convection system identification and tracking method based on stationary satellite infrared cloud atlas

    CN110414420A