CN117271695A - Vector space data superposition analysis method and device, electronic equipment and storage medium - Google Patents

Vector space data superposition analysis method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117271695A
CN117271695A CN202311544352.9A CN202311544352A CN117271695A CN 117271695 A CN117271695 A CN 117271695A CN 202311544352 A CN202311544352 A CN 202311544352A CN 117271695 A CN117271695 A CN 117271695A
Authority
CN
China
Prior art keywords
geospatial
grid
codes
coding
trellis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311544352.9A
Other languages
Chinese (zh)
Other versions
CN117271695B (en
Inventor
邓新星
张启迪
唐松强
邬远祥
徐震
顾丹鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang East China Engineering Digital Technology Co ltd
PowerChina Huadong Engineering Corp Ltd
Original Assignee
Zhejiang East China Engineering Digital Technology Co ltd
PowerChina Huadong Engineering Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang East China Engineering Digital Technology Co ltd, PowerChina Huadong Engineering Corp Ltd filed Critical Zhejiang East China Engineering Digital Technology Co ltd
Priority to CN202311544352.9A priority Critical patent/CN117271695B/en
Publication of CN117271695A publication Critical patent/CN117271695A/en
Application granted granted Critical
Publication of CN117271695B publication Critical patent/CN117271695B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2465Query processing support for facilitating data mining operations in structured databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Remote Sensing (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a vector space data superposition analysis method, a vector space data superposition analysis device, electronic equipment and a storage medium. The method of the invention comprises the following steps: 1) Inputting vector space data, acquiring the geometric type and complete longitude and latitude coordinate information of the vector space data, and coding the vector space data into an earth space grid coding set according to coding rules; 2) Combining the geospatial trellis codes using a method of inverting a recursive bipartite process in the coding rule to compress a set of geospatial trellis codes; 3) Ordering all codes in the compressed geospatial grid code set according to a dictionary sequence; 4) Carrying out the operations of the steps 1) -3) on each vector space data; 5) And performing space superposition analysis calculation on the ordered geospatial grid coding set. The vector space data superposition analysis method improves the calculation efficiency, has more visual data organization mode, and is also suitable for distributed operation.

Description

Vector space data superposition analysis method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of database analysis technologies, and in particular, to a method and apparatus for superposition analysis of vector space data, an electronic device, and a storage medium.
Background
Vector space data is a data model describing the spatial distribution of entities on the earth reference ellipsoid in the form of points, lines, polygons and combinations of the three in the geometric figure. Early vector space data was managed in file form, limited by business specific software functions and capabilities. Storing management vector space data through relational databases (Relational Database Management System, RDBMS) has become the dominant technology at present, and the search query capability of the databases improves the computational efficiency of the superposition analysis of vector space data. However, with the advent of the big data age, the data scale is expanding continuously, the file type and vector space data in the relational database are still subjected to superposition analysis calculation based on the traditional longitude and latitude coordinates, and the cost and burden of the database are increased due to the large data volume retrieval and calculation, so that the superposition analysis efficiency is seriously reduced.
The national standard of the people's republic of China (GB/T40087-2021) prescribes the requirements and the coding method of the geospatial mesh subdivision, and a unified and efficient geospatial data organization reference frame is established. The coding method is characterized in that when longitude and latitude coordinates are converted into corresponding grid codes, coding bits are selected according to the conversion grid stages, morton cross coding is performed to obtain one-dimensional binary codes, dimension reduction of space positions is achieved, the binary codes are converted into quaternary numbers, and codes of hemispheres are added to the forefront end of the binary codes to form the earth space grid codes.
There are various methods for optimizing the superposition analysis of the spatial data at present, such as the Chinese patent publication number CN113704380A, which is a distributed superposition analysis method, a device and a storage medium based on a spatial grid, the data is divided through the grid, after the data is identified, only the identified data is subjected to superposition analysis calculation, and the performance bottleneck caused by the big data is solved through the distributed method. The grid division is mainly used for dividing data and does not directly participate in the calculation process, and the method essentially calculates endpoint data represented by longitude and latitude without dimension reduction of space calculation. In addition, the method requires a user to have a distributed computing base, or at least a storage medium accessible by multiple devices, which limits the scope of use of the method.
Disclosure of Invention
The invention provides a vector space data superposition analysis method, a vector space data superposition analysis device, electronic equipment and a storage medium based on an earth space grid coding rule, which are used for converting vector space data into an earth space grid coding set, namely a set formed by summarizing a plurality of earth space grid codes. In the process, the dimension reduction of the longitude and latitude data is one-dimensional coding, and the superposition analysis operation is carried out on the geospatial grid coding set to replace the traditional longitude and latitude operation, so that the calculation efficiency bottleneck caused by the traditional longitude and latitude calculation method in a big data scene is solved.
The first object of the present invention is to provide a vector space data superposition analysis method, comprising the following steps:
1) Acquiring the geometric type and complete longitude and latitude coordinate information of vector space data, and coding the vector space data into an earth space grid coding set according to a coding rule;
2) Combining the geospatial trellis codes using a method of inverting a recursive bipartite process in the coding rule to compress a set of geospatial trellis codes;
3) Ordering all codes in the compressed geospatial grid code set according to a dictionary sequence;
4) Performing the operations of steps 1) to 3) above for each vector space data;
5) And performing space superposition analysis and calculation on all the sequenced geospatial grid code sets to obtain a result geospatial grid code set.
Further, the obtaining the geometric type and the complete longitude and latitude coordinate information of the vector space data, and encoding the vector space data into the geospatial grid encoding set according to the encoding rule includes:
1) Importing the vector space data file into a database to obtain longitude and latitude information of positioning points in the vector space data;
2) And carrying out subdivision coding on the vector space data at the input grid level according to the coding rule to obtain a geospatial grid coding set.
Further, the spatial superposition analysis calculation of all the sequenced geospatial grid code sets includes a method adopting any one or more of the following combinations:
1) Calculating the two geospatial grid coding sets by adopting a space superposition analysis calculation method of intersection;
2) Calculating two geospatial grid coding sets by adopting a merging space superposition analysis calculation method;
3) Calculating two geospatial grid coding sets by adopting a cut space superposition analysis calculation method;
4) And calculating the two geospatial grid coding sets by adopting a space superposition analysis calculation method of intersection negation.
Further, the calculating the two geospatial grid code sets by adopting a spatial superposition analysis calculation method of intersection comprises the following steps:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the intersection screening rule, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) And repeatedly carrying out numerical comparison until any one of the two geospatial grid coding sets is traversed, stopping the comparison, and finally obtaining a result geospatial grid coding set.
Further, the calculating the two geospatial grid coding sets by adopting a combined space superposition analysis calculation method comprises the following steps:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the calculation and screening rule, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) Repeatedly comparing the numerical values until any one of the two geospatial grid coding sets is traversed;
4) After traversing any source geospatial grid code set, storing the residual geospatial grid codes which are not traversed in the other source geospatial grid code set into a result geospatial grid code set.
Further, the calculating the two geospatial grid code sets by using a clipping space superposition analysis calculation method includes:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result and the clipping screening rule of each round, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) Repeating the numerical comparison process until any geospatial grid coding set is traversed;
4) After any geospatial grid code set is traversed, if the first geospatial grid code set has residual geospatial grid codes, storing all the residual geospatial grid codes into the geospatial grid code set; if there are more residual geospatial trellis codes in the second set of geospatial trellis codes, deleting all of the residual geospatial trellis codes therein.
Further, the calculating the two geospatial grid code sets by adopting a space superposition analysis calculation method of intersection negation includes:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the intersection inversion screening rule, storing the result into a result geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the result to start the next round of comparison;
3) Repeating the numerical comparison process until any geospatial grid coding set is traversed;
4) After any one of the geospatial trellis code sets has been traversed, if there are remaining geospatial trellis codes in another geospatial trellis code set at this time, all of these remaining geospatial trellis codes are stored in the resultant geospatial trellis code set.
A second object of the present invention is to provide a vector space data superposition analysis apparatus, comprising:
1) The coding module is used for acquiring the geometric type and complete longitude and latitude coordinate information of the vector space data and coding the vector space data into an earth space grid coding set according to a coding rule;
2) And a compression module: a method for merging geospatial trellis codes to compress a set of geospatial trellis codes using a recursive bipartite process in an inversion coding rule;
3) And a sequencing module: all codes in the compressed geospatial grid code set are ordered according to dictionary sequence;
4) And the superposition analysis module is used for: and the method is used for carrying out space superposition analysis and calculation on all the sequenced geospatial grid coding sets to obtain a result geospatial grid coding set.
A third object of the present invention is to provide an electronic apparatus including:
a memory for storing a computer program;
and the processor is used for executing the program stored in the memory and realizing the steps of the vector space data superposition analysis method.
A fourth object of the present invention is to provide a computer-readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of the vector space data superposition analysis method described in any of the above.
The beneficial technical effects of the invention are as follows:
1) The longitude and latitude coordinate codes are converted into the earth space grid codes, so that dimension reduction from two-dimensional data to one-dimensional data is realized, longitude and latitude calculation is converted into bitwise operation of one-dimensional codes, calculation dimension is reduced, and calculation efficiency is improved.
2) The national standard earth space grid code (GB/T40087-2021) is used as an intermediate data organization mode, and results can be transmitted through two different intermediate data organization modes of coding and vector data, so that the method is more flexible. In particular, the binary form of the geospatial trellis code itself has the meaning of representing data, which is more intuitive than traditional spatial data organization.
3) The codes with similar values in the geospatial grid codes are often more similar in space position, when the data are subjected to distributed computation, the codes are used as data distribution bases, the data with similar space positions and easy to generate association can be distributed on the same data node, the input and output among the nodes in the whole computation process can be effectively reduced, and the method is more suitable for distributed computation.
The vector space data superposition analysis method converts longitude and latitude coordinate codes into earth space grid codes for calculation, improves the calculation efficiency, has more visual data organization mode and is also suitable for distributed operation.
Drawings
FIG. 1 is a diagram showing the steps of a method for superposition analysis of vector space data according to an embodiment of the present invention;
FIG. 2 is a graphic of the shp1 visualization of an embodiment of the present invention;
FIG. 3 is a graphic of the shp2 visualization of an embodiment of the present invention;
fig. 4 is a spatial position relationship diagram of shp1 and shp2 according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a 32-bit encoding rule according to an embodiment of the present invention;
FIG. 6 is an A1 code and a grid diagram obtained by dividing vector space data shp1 according to an embodiment of the present invention;
FIG. 7 is a B1 code and a grid diagram obtained by dividing vector space data shp2 according to an embodiment of the present invention;
FIG. 8 is a diagram showing a comparison of the trellis-encoded set A1 and the vector space data shp1 according to an embodiment of the present invention;
FIG. 9 is a diagram showing a comparison of the trellis-encoded set A2 and the vector space data shp2 according to an embodiment of the present invention;
fig. 10 is a mesh diagram of mesh-level vector space data shp1 and shp2 according to embodiment 24 of the present invention;
FIG. 11 is a diagram illustrating trellis-encoded merge according to an embodiment of the present invention;
FIG. 12 is a diagram showing an example of combining the grid codes of the grid code set A1 according to the embodiment of the present invention;
FIG. 13 is a block diagram of a trellis coded set A2 after combining trellis coded set A1 according to an embodiment of the present invention;
FIG. 14 is a grid coding set A2' after combining the grid-level vector space data according to embodiment 24 of the present invention;
FIG. 15 is a grid code set B2' after combining the grid level vector space data according to embodiment 24 of the present invention;
FIG. 16 is a schematic diagram of four spatial superposition analysis calculation methods according to embodiments of the present invention;
FIG. 17 is a diagram showing a first-round numerical comparison performed during intersection according to an embodiment of the present invention;
FIG. 18 is a diagram illustrating grid level difference comparison during intersection according to an embodiment of the present invention;
FIG. 19 is a graph comparing the results of the grid level intersection of example 21 of the present invention with the results of the conventional longitude and latitude intersection;
fig. 20 is a graph comparing the result of the grid level intersection with the result of the conventional longitude and latitude intersection in embodiment 24 of the present invention.
Detailed Description
For a further understanding of the present invention, preferred embodiments of the invention are described below in conjunction with the examples, but it should be understood that these descriptions are merely intended to illustrate further features and advantages of the invention, and are not limiting of the claims of the invention.
The coding rule in the embodiment of the invention refers to the terrestrial space grid coding rule (GB/T40087-2021).
The method for analyzing superposition of vector space data in this embodiment, as shown in fig. 1, includes the following steps:
s1, acquiring the geometric type and complete longitude and latitude coordinate information of vector space data, and coding the vector space data into an earth space grid coding set according to coding rules.
And inputting vector space data, acquiring space information of the vector space data, including geometric types and complete longitude and latitude coordinate information, and coding the vector space data into a geospatial grid coding set of a selected grid level according to coding specifications. Typically, if a vector space dataset contains multiple spatial objects, the multiple objects are encoded separately.
The grid level parameters of the geospatial grid coded object of embodiments of the present invention may be specified by an operator, and the manner of specification may be through SQL parameter input.
It should be noted that, in order to avoid the redundancy of the data description part in the description process, the embodiment of the present invention uses 21 grid levels for detailed calculation and description, and the granularity of the grid levels is coarse. According to the coding rule, the precision and the data length can be improved by 4 times when the grid level is improved by one level. In the following description of the embodiment, an effect diagram of 24 grid stages used under the same operation procedure will be attached when accuracy is required to be represented. In actual production, the grid level should be selected according to production requirements and accuracy requirements.
The following specific operation steps of this embodiment are:
s11, importing the vector space data file into a database to obtain longitude and latitude information of locating points in the vector space data.
The vector space data file is used to describe the geometry object: the points, lines and polygons can store the geometric positions of space objects such as mountains, rivers, lakes and the like and the attributes of the space objects. shapefile is the most widely used vector space data format in the world. postgres database is an open source relational database that is widely used throughout the world, while postgis is an open source extension of postgres database that increases support for geographic objects. In the examples of the present invention, the databases described below refer to postgres databases with postgis extensions installed.
Shapefile containing vector space data is imported into the postgres database where postgis extensions are installed. When importing the vector space data file, the vector space data importing database may use the open source transformation tool shp2pg or ogr2ogr. The open source database and tools described above are publicly available. After the vector space data file is imported into the database, the coordinate information can be directly checked in the database.
For example, two vector space data files shp1 and shp2 are imported into the postgres database.
After the introduction, the coordinate information of shp1 is: MULTIPOLYGON (((120.48039112 27.150763976, 120.480348173 27.150732942, 120.48030281 27.150694776, 120.480256568 27.15064, 120.48006899 27.150399257, 120.480035252 27.150405856, 120.479888964 27.150429642, 120.479607377 27.150507022, 120.479544831 27.15052644, 120.479541314 27.150526407, 120.479474437 27.150558409, 120.47926969 27.150656384, 120.479029215 27.150728022, 120.479019418 27.150817068, 120.479055234 27.150864169, 120.479059865 27.150901684, 120.479075357 27.150986189, 120.479102526 27.15102434, 120.479126003 27.151057309, 120.479176583 27.151110596, 120.479303277 27.151172166, 120.479327446 27.151212722, 120.479393172 27.151248146, 120.479559805 27.151336645, 120.479665778 27.151371838, 120.480062341 27.151381505, 120.48015 27.151369149, 120.48017465 27.151365682, 120.480501419 27.151168645, 120.48039112 27.150763976))). Each coordinate point is represented by a small circle, and is visualized by connecting all coordinate points as shown in fig. 2. The Shp1 graph is a 29-sided polygon, the coordinate information contains the longitude and latitude of 30 coordinate points, and the last coordinate point coincides with the first coordinate point.
After the introduction, the coordinate information of shp2 is: multimoloygon (((120.478755234 27.151057309, 120.481348173 27.151057309, 120.481348173 27.150899257, 120.478755234 27.150899257, 120.478755234 27.151057309))). Each coordinate point is represented by a small circle, and visualized by connecting the coordinate points as shown in fig. 3. The shp2 graph is a rectangle, the coordinate information comprises longitude and latitude of five coordinate points, and the fifth coordinate point is coincident with the first coordinate point.
The relationship of shp1 and shp2 in terms of spatial position is shown in fig. 4.
S12, carrying out subdivision coding on the vector space data according to a coding rule at an input grid level to obtain a geospatial grid coding set.
The embodiment divides and codes vector space data according to coding rules, and the specific operation is as follows:
1) An input grid level value is obtained. For example, grid level values may be obtained from input SQL parameters.
2) Vector space data is split from both latitude and longitude sides at a specified mesh level according to the splitting method specified in 5.1 in the encoding rule.
3) And determining the positioning point of each grid, and converting the longitude and latitude coordinates of the positioning point into the geospatial grid code according to the coding mode described by 6.2.3 coding rules.
The annex C of the coding rule shows that each grid locating point is the corner point position closest to the intersection point of the equatorial plane and the initial meridian plane in all the corner points of the grid, so that the locating point of each grid is determined according to the corner point position. And converting longitude and latitude coordinates of the positioning points into geospatial grid codes according to the coding mode described by the 6.2.3 coding rules.
4) All the geospatial grid codes obtained by the subdivision form a set, and the set is named as a geospatial grid code set.
The SQL parameter input in this embodiment is 21, and according to the above method, the vector space data shp1 is subjected to subdivision coding to obtain the geospatial grid coding set A1: g001133022-013102-101112, G001133022-013102-101113, G001133022-013102-101130, G001133022-013102-101131, G001133022-013102-101132, G001133022-013102-101133, G001133022-013102-101301, G001133022-013102-101310, G001133022-013102-101311, G001133022-013102-110002, G001133022-013102-110020, G001133022-013102-110021, G001133022-013102-110022, G001133022-013102-110023, G001133022-013102-110200, G001133022-013102-110201.
According to the coding rule 6.2.1, as shown in fig. 5, each code can be disassembled into 9-bit level codes, 6-bit hierarchical codes, 6-bit second level codes and codes below 11-bit second level codes according to the grid level. The number of the grid stages of the codes corresponds to the number of the codes in sequence from left to right, so the 21-stage grid codes should have 9-bit degree codes, 6-bit hierarchical codes and 6-bit second codes. For example, the first code G001133022-013102-101112 in A1 can be disassembled into a 9-bit level code 001133022,6-bit hierarchical code 013102,6-bit second level code 101112. The degree codes of all grids belonging to the same degree are identical, and the hierarchical codes of all grids belonging to the same partition are identical. shp1 is within 1 minute (120 degrees of longitude 28-120 degrees of 29', 27 degrees of latitude 9-27 degrees of 10') of the same 1 degree of east-west span in the geospatial, so that the degree level codes and the grading codes of all grid codes obtained by subdivision are consistent. For example, G001133022-013102-101112 and G001133022-013102-101113 are each 001133022 in degree scale and 013102 in degree scale. The mesh obtained by splitting shp1 and the second-level code identifier in the corresponding A1 code of each mesh are shown in fig. 6, and for convenience of viewing, in fig. 6, consistent degree-level codes and hierarchical codes are omitted, and only second-level codes are identified.
The vector space data shp2 is subjected to subdivision coding in the same mode to obtain a grid set, and all grids in the set are coded in the same mode according to a coding rule to obtain a geospatial grid coding set B1. The coding structure of B1 is as follows: g001133022-013102-101033, G001133022-013102-101122, G001133022-013102-101123, G001133022-013102-101132, G001133022-013102-101133, G001133022-013102-110022, G001133022-013102-110023, G001133022-013102-110032, G001133022-013102-110033, G001133022-013102-110122. The mesh obtained by dividing shp2 and the second-level code mark in the corresponding B1 code of each mesh are shown in fig. 7. Like A1, the level coding and the hierarchical coding of all codes in B1 are identical, and for ease of view, in fig. 7 we omit the identical level coding and hierarchical coding, only the second level coding is identified.
A comparison of the geospatial trellis encoded set A1 and the vector space data shp1 is shown in fig. 8, respectively. In fig. 8, the set of meshes is A1, and the polygon filled with shadows is shp1. A comparison of the geospatial trellis encoded set B1 and the vector space data shp2 is shown in fig. 9, respectively. In fig. 9, the set of meshes is B1, and the shaded polygon is shp2.
Note that A1 and A2 are split at 21 mesh stages, and the mesh stages have a large particle size, so A1 and A2 are greatly different from shp1 and shp 2. According to the coding rule, the precision and the data length can be improved by 4 times when the grid level is improved by one level. To represent the actual effect, a finer granularity 24 grid level effect graph is shown as shown in FIG. 10. In fig. 10, the shaded polygons are shp1 and shp2, respectively, and the sets made up of meshes are A1 'and A2', respectively. After the precision is increased from the 21 grid level to the 24 grid level, the grid sets A1', A2' obviously increase the reduction degree of the vector space data shp1, shp 2. In order to avoid the excessively long data length in the description process, in the description of the following embodiment, we will continue to use 21 grid levels to describe, and only when the accuracy needs to be represented, attach an effect diagram of using 24 grid levels in the same operation process.
S2, combining the geospatial grid codes by using a recursive bipartite process method in the inversion coding rule so as to compress the geospatial grid code set.
The encoding rule is to recursively divide the grids step by step from the longitude and latitude directions, and divide vector space data into a large number of grids. When vector space data superposition analysis based on geospatial trellis encoding is performed in a computer, the more geospatial trellis encoding is involved in the calculation, the greater the calculation amount, and the calculation efficiency is reduced. In order to increase the computational efficiency, it is desirable to reduce the total number of geospatial trellis codes involved in the operation.
The embodiment adopts the following method to reduce the total number of the geospatial grid codes participating in the operation: the recursive halving process in the encoding rules is reversed. According to the coding rule 5.5, the earth reference ellipsoid is progressively split downwards by 0-32-level geospatial grid coding. By reversing this subdivision process, the 0-32 level geospatial trellis codes are combined step-by-step upward.
This process can be described as: as shown in fig. 11, any geospatial trellis code X is set, with the trellis stage of X being N. And (3) dividing X downwards to the (N+1) grid level according to the coding rule to obtain the geospatial grid coding set Y. Let the geospatial trellis coded set be P and Y be the proper subset of P, i.e. p=y+z, Z being the difference between set P and set Y. If P is to be compressed, the recursive bipartite process in the coding rule may be reversed, combining Y to X, i.e. combining Y to X in p=y+z, resulting in P' =x+z. Where P and P 'represent the geospatial are identical, but the total number of geospatial trellis codes in P' is less than P. This process is repeated to merge the geospatial trellis codes to compress the geospatial trellis code set without changing the geospatial represented by the set.
The following is a specific example of encoding A1, B1, merging recursively stepwise, compressing. In A1, as shown in fig. 12, the geospatial trellis codes G001133022-013102-101120, G001133022-013102-101121, G001133022-013102-101122, G001133022-013102-101123 may be combined to obtain G001133022-013102-10112. The same procedure combined compression yields G001133022-013102-10113 and G001133022-013102-11002, with the overall effect shown in fig. 13. The three sets of geospatial trellis codes are combined into three geospatial trellis codes of higher trellis stages. On the premise of not changing the geospatial represented by the set, all the geospatial trellis codes in fig. 13 cannot be combined upwards, and the combining process is finished to obtain a compressed geospatial trellis code set, designated as A2. In fig. 13, for ease of view, we omit consistent level coding and hierarchical coding, identifying only second level coding. The coding structure of A2 is as follows: g001133022-013102-101112, G001133022-013102-101113, G001133022-013102-110002, G001133022-013102-10112, G001133022-013102-10113, G001133022-013102-11002, G001133022-013102-101301, G001133022-013102-101310, G001133022-013102-101311, G001133022-013102-110200, G001133022-013102-110201.
The geospatial represented by the geospatial trellis code of one higher trellis stage corresponding to each geospatial trellis code in B1 is not a proper subset of the geospatial represented by B1. All geospatial trellis codes in B1 cannot continue to merge upward. Thus, B2 obtained after compression remains unchanged from B1.
In this embodiment, 21 trellis stages are used for the sake of simplifying the description process, resulting in a small number of compressible geospatial trellis codes. The geospatial trellis code in A1 cannot continue up-merge after the first recursive merge. The number of merges and the number of recursions may increase when a high precision grid stage is used in practice. If we split shp1 using 24-level trellis stages, the total number of geospatial trellis codes for the geospatial trellis code sets A1', A1' becomes large. The combination compression of A1 'to A2' has a more pronounced effect on the reduction of the total number in the compression process, as shown in FIG. 14. When the grid level parameter is set to 24 levels, the set of the geospatial grid codes obtained by split coding shp2 is set to be B1'. The effect of B2 'obtained by subjecting B1' to the compression process is shown in FIG. 15.
S3, ordering all codes in the compressed geospatial grid coding set according to a dictionary sequence.
After the compression process of the set of geospatial grid codes is completed, all geospatial grid codes in the set are ordered according to dictionary ordering, and preparation is made for code size comparison in the subsequent step.
In this embodiment, the dictionary ordering may be described as:
1) And (3) taking the first bit after the earth grid codes G as the first bit, comparing all the earth grid codes in the set from the first bit, and sequencing according to the numerical value from small to large.
2) And under the condition that the first bits are equal, comparing according to the second bits, and sorting according to the values from small to large.
3) The comparison is continued according to this rule until the dictionary ordering of the collection is completed. In particular, when a certain code appears without a subsequent number of bits ending at the nth bit, it is ordered at the first bit of the round of comparison at the n+1 round.
For example, the to-be-sorted set is T0:G111, G022, G010, G01. According to the first bit comparison, the first bits of G111, G022, G010 and G01 are respectively 1, 0 and 0, and G022, G010 and G01 are discharged to the front of G111, and the obtained set is T1: G022, G010, G01 and G111. After the first round of comparison, the first bits of G022, G010 and G01 are equal to 0, the second bits are 2, 1 and 1 respectively, and the obtained set is T2:G010, G01, G022 and G111 before G022 is discharged by G010 and G01. After the second round of comparison, the first bits of G010 and G01 are equal, the second bits are equal, and G01 ends without the subsequent bits after two bits, so the set obtained by arranging G01 at the first bit of the round of comparison in the third round of comparison is T3:G01, G010, G022 and G111. And finally completing dictionary ordering of the collection.
The following is a specific example of dictionary ordering the geospatial trellis encoded sets A2, B2.
The first bits of all geospatial trellis codes in A2 are compared, the second bits are compared when equal, and so on. In this embodiment, the code with the 17 th bit value of 0 is arranged in front of the code with the 17 th bit value of 1 as a result of the inconsistent comparison until the 17 th bit (second bit of second-order code) appears; continuing to compare the 18 th bit until the dictionary ordering is completed, and obtaining an ordered geospatial grid coding set A3: g001133022-013102-101112, G001133022-013102-101113, G001133022-013102-10112, G001133022-013102-10113, G001133022-013102-101301, G001133022-013102-101310, G001133022-013102-101311, G001133022-013102-110002, G001133022-013102-11002, G001133022-013102-110200, G001133022-013102-110201.
Dictionary ordering of B2 in the same manner yields B3: g001133022-013102-101033, G001133022-013102-101122, G001133022-013102-101123, G001133022-013102-101132, G001133022-013102-101133, G001133022-013102-110022, G001133022-013102-110023, G001133022-013102-110032, G001133022-013102-110033, G001133022-013102-110122.
And S4, executing the operations of the steps S1-S3 on each vector space data to obtain a corresponding compressed and sequenced geospatial grid coding set.
S5, performing space superposition analysis and calculation on all the sequenced geospatial grid coding sets to obtain a result geospatial grid coding set.
The spatial superposition analysis calculation may calculate two or more geospatial trellis encoded sets obtained.
The space superposition analysis and calculation method of the two geospatial grid coding sets comprises four steps of intersection, merging, clipping and intersection inversion. Four calculation methods are shown in fig. 16.
1) And (3) intersection: for acquiring an intersection of two geospatial trellis-coded sets, i.e., overlapping portions in geospatial;
2) And (3) merging: the method comprises the steps of acquiring a union set of two geospatial grid coding sets, namely, all ranges represented by two vector space data in a geospatial;
3) Cutting: the method is used for acquiring the difference value of two geospatial grid coding sets, namely the range of one vector space data but not the other vector space data in the geographic space, and the two geospatial grid coding sets have a sequence when cut, and can be respectively called a first geospatial grid coding set and a second geospatial grid coding set according to the sequence;
4) Intersection negation: for obtaining the result of the inversion of the intersection of two sets of geospatial trellis codes in geospatial.
The spatial superposition analysis calculation of more than two geospatial trellis coded sets may employ any of the above-described calculation methods, or any combination of the four calculation methods described above. For example, three sets of geospatial trellis codes may be interleaved, first, and second sets of geospatial trellis codes may be interleaved, and then the result of the calculation may be interleaved with a third set of geospatial trellis codes.
Which spatial overlay analysis calculation method is adopted depends on the requirements of the actual production project. The resulting geospatial trellis encoded set of computations may be used as the basis for other further analysis. For example, intersection is often used when calculating whether a farmland is illegally occupied, and the resulting geospatial grid code set can be further used to calculate the location, size, and shape of the illegally occupied farmland. Four spatial superposition analysis calculation methods are described in detail below.
S41, calculating by adopting a space superposition analysis calculation method of intersection.
The whole intersection process is composed of a plurality of rounds of numerical comparison. And respectively taking out the first earth space grid codes from the two earth space grid code sets for intersection to carry out numerical comparison, determining the source of the earth space grid codes for carrying out the next numerical comparison according to the result of each round of numerical comparison, and repeating the numerical comparison process until any earth space grid code set is emptied.
In the comparison, if the two geospatial trellis codes subjected to the numerical comparison are different in trellis stages, the geospatial trellis codes with small trellis stage values need to be temporarily supplemented with 0 at the end until the two geospatial trellis code digits agree during the comparison. The temporary bit-filling 0 is deleted after the numerical comparison, and is restored to the earth space grid coding before the bit filling 0.
For example, G112233 and G1133 are compared in value, G112233 grid level 6, and G1133 grid level 4. The grid level value of G1133 is smaller, the tail of G1133 is temporarily zero-filled into G113300, and then the G113300 is compared with G112233. The 00 deletion of the complement bit is restored to G1133 after the comparison is completed.
S411, respectively taking out the first earth space grid codes from the two earth space grid code sets to carry out first round numerical comparison.
The two geospatial trellis code sets for intersection are set to A, B, and the first geospatial trellis code is taken from A, B and identified as a and b, respectively. And (3) comparing the values of a and b. In an embodiment of the present invention, we take the first geospatial trellis codes G001133022-013102-101112, G001133022-013102-101033 from A3, B3, respectively, from front to back, as shown in fig. 17. The two are compared numerically.
S412, screening the geospatial grid codes according to the numerical comparison result of each round and the intersection screening rule, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison.
In the space superposition analysis calculation of intersection, we divide the comparison result of two geospatial grid coding values into the following two kinds of cases, and process the two kinds of cases according to the following intersection screening rules.
In case 1, the values of the two geospatial trellis codes are equal, and the two geospatial trellis codes are compared in terms of the size of the trellis stages, and the comparison result can be further subdivided into the following two types.
In case 1-1, the grid levels of two geospatial grid codes are equal, a is stored into a result geospatial grid code set R, and geospatial grid codes a 'and B' are continuously taken out from the front to the back from A and B respectively for next round of numerical comparison.
In case 1-2, the grid levels of the two geospatial grid codes are unequal, and the space grid codes with larger grid level values in a and b are stored in a result geospatial grid code set R. If a is stored in R, continuing to take a' from the A from front to back and restarting the next round of numerical comparison with b; if B is stored in R, the next round of value comparison is restarted by continuing to take B' from front to back from B to a.
In case 2, the values of the two geospatial grid codes are not equal, the geospatial grid code with smaller value in a and b is s, the larger value is t, and t is deleted or added with 0 from the end of the code in sequence so that the total bit number of t is consistent with s to obtain t'. After t' and s are converted into binary, the bitwise exclusive OR operation is carried out, and the result of the bitwise exclusive OR operation can be further subdivided into the following two types.
In case 2-1, according to the bit exclusive or operation result being 0, t is stored into the result geospatial grid code set R, and the next geospatial grid code is continuously taken out from the t-source geospatial grid code set from front to back, and the next round of numerical comparison is restarted from s. For example, assuming a is t, a' and b are continuously fetched from A and the next round of numerical comparison is restarted.
In case 2-2, the result of the bitwise exclusive or operation is not 0, and the next geospatial trellis code is continuously fetched from the s-source geospatial trellis code set from front to back and the next round of numerical comparison is restarted with t. For example, assuming a is s, a' and b are continuously fetched from A and the next round of numerical comparison is restarted.
In this embodiment, when comparing the values of G001133022-013102-101112 and G001133022-013102-101033, the values are not equal, which corresponds to case 2. Where G001133022-013102-101112 is of greater value, G001133022-013102-101112 is set to t and G001133022-013102-101033 is set to s. the digits of t and s are consistent, t and s are respectively converted into binary forms to carry out bitwise exclusive OR operation, the binary result of the bitwise exclusive OR operation is 11001, the result is not 0, and the situation 2-2 is met. The forward and backward removal of G001133022-013102-101122 continues from source B3 of s (G001133022-013102-101033), and the next round of numerical comparison resumes with t (G001133022-013102-101112).
S413, repeating the numerical comparison process until any geospatial grid coding set is traversed.
In each round of comparison, the geospatial trellis code is screened by intersecting screening rules. And storing the filtered geocodes into a result geospace grid code set. After traversing any geospatial trellis encoded set, the comparison is ended.
As shown in fig. 18, when comparing the grid levels of G001133022-013102-10112 in A3 and G001133022-013102-101122 in B3, the grid levels are different, the end of G001133022-013102-10112 is first temporarily supplemented with 0, and then the numerical comparison is performed. The two values are not equal, and the condition 2 is met. Wherein the value of G001133022-013102-101122 is larger, G001133022-013102-101122 is set as t, and G001133022-013102-10112 is set as s. Deleting t one bit from the end of the code so that t and s bits remain identical results in t'. Converting both t' and s into binary system to perform bit-wise exclusive OR operation, wherein the operation result is 0, the condition 2-1 is met, and t: g001133022-013102-101122 is stored in the resulting geospatial trellis encoded set R and the next round of numerical comparison is continued from front-to-back fetch G001133022-013102-101123 and s (G001133022-013102-10112) from the geospatial trellis encoded set B3 of t origin. Until either of A3, B3 is traversed.
In this embodiment, B3 is traversed first, and the comparison is finished, and the final geospatial trellis encoded set R is: g001133022-013102-101122, G001133022-013102-101123, G001133022-013102-101132, G001133022-013102-101133, G001133022-013102-110022, G001133022-013102-101123.
A comparison of the result R based on 21 grid level intersection with the result TR obtained by conventional longitude and latitude intersection is shown in fig. 19. Where the polygon filled by the shadow is TR and the set of grids is R. A comparison of the result R 'obtained by intersection and the result TR obtained by superposition analysis in the conventional manner when encoding at 24 mesh levels is shown in fig. 20, in which the polygon filled with shadows is TR and the set of meshes is R'. The difference between R' and TR is significantly reduced as the trellis stage value increases from 21 to 24, and the error in the result of the vector space data superposition analysis implemented by geospatial trellis encoding is further reduced as the trellis stage continues to increase. The method can be split to 32 levels according to the maximum coding specification, and the precision is about 1.5cm.
S42, calculating by adopting a space superposition analysis calculation method.
The whole merging process consists of a plurality of rounds of numerical comparison. And respectively taking out the first earth space grid codes from the two earth space grid code sets for merging, carrying out numerical comparison, determining the source of the earth space grid codes for carrying out the next numerical comparison according to the result of each round of numerical comparison, and repeating the numerical comparison process until any earth space grid code set is emptied.
In the comparison, if the two geospatial trellis codes subjected to the numerical comparison are different in trellis stages, the geospatial trellis codes with small trellis stage values need to be temporarily supplemented with 0 at the end until the two geospatial trellis code digits agree during the comparison. The temporary bit-filling 0 is deleted after the numerical comparison, and is restored to the earth space grid coding before the bit filling 0.
S421, respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison.
The two geospatial trellis code sets for the union are set to A, B, and the first geospatial trellis code is extracted from A, B, respectively, and identified as a and b, respectively. And (3) comparing the values of a and b.
S422, screening the geospatial grid codes according to the numerical comparison result and the union screening rule of each round, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison.
In the merging, we divide the result of comparing any two geospatial grid code values into the following two major cases, and process them according to the following merging and screening rules.
In case 1, the values of the two geospatial trellis codes are equal, and the two geospatial trellis codes are compared in terms of the size of the trellis stages, and the comparison result can be further subdivided into the following two types.
In case 1-1, the grid levels of two geospatial grid codes are equal, a is stored into a result geospatial grid code set R, and geospatial grid codes a 'and B' are continuously taken out from the front to the back from A and B respectively for next round of numerical comparison.
In case 1-2, the grid levels of the two geospatial grid codes are unequal, and the space grid codes with smaller grid level values in a and b are stored in a result geospatial grid code set R. If a is stored in R, continuing to take B' from B from front to back and restarting the next round of value comparison with a; if b is stored in R, a' and b are taken from front to back from A and the next round of numerical comparison is restarted.
In case 2, the two geospatial trellis codes have unequal values, and the geospatial trellis code with the smaller value in a, b is given as s, and the larger value is given as t. S is first stored in the result geospatial trellis encoded set R. Sequentially deleting or supplementing t from the end of the code to 0 so that the total bit number of t is consistent with t to obtain t'. After t' and s are converted into binary, the bitwise exclusive OR operation is carried out, and the result of the bitwise exclusive OR operation can be further subdivided into the following two types.
In case 2-1, the result of the bitwise exclusive or operation is 0, and the next geospatial trellis code is continuously fetched from the set of geospatial trellis codes from t sources from front to back and the next round of numerical comparison is restarted with s.
In case 2-2, the result of the bitwise exclusive or operation is not 0, and the next geospatial trellis code is continuously fetched from the s-source geospatial trellis code set from front to back and the next round of numerical comparison is restarted with t.
S423, repeatedly comparing the numerical values until any one of the two geospatial grid coding sets is traversed.
S424, after any geospatial grid code set is traversed, storing residual geospatial grid codes which are not traversed in the other geospatial grid code set into a result geospatial grid code set. And obtaining a final result, namely the geospatial grid coding set, namely calculating by adopting a merging space superposition analysis calculation method.
S43, calculating by adopting a clipping space superposition analysis calculation method.
The calculation steps during clipping in the spatial superposition analysis calculation are as follows:
the whole cutting process consists of a plurality of rounds of numerical comparison. And respectively taking out the first earth space grid codes from the two earth space grid code sets for clipping, carrying out numerical comparison, determining the source of the earth space grid codes for carrying out the next numerical comparison according to the result of each round of numerical comparison, and repeating the numerical comparison process until any earth space grid code set is emptied.
In the comparison, if the two geospatial trellis codes subjected to the numerical comparison are different in trellis stages, the geospatial trellis codes with small trellis stage values need to be temporarily supplemented with 0 at the end until the two geospatial trellis code digits agree during the comparison. The temporary bit-filling 0 is deleted after the numerical comparison, and is restored to the earth space grid coding before the bit filling 0.
S431, respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison.
Two geospatial trellis code sets for cropping are set to A, B, and the first geospatial trellis code is taken from A, B, identified as a, b, respectively. And (3) comparing the values of a and b.
S432, screening the geospatial grid codes according to the numerical comparison result of each round and the clipping screening rule, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison.
In clipping, we divide the result of comparing any two geospatial trellis encoded values into the following three major categories of cases, and process them according to the clipping and screening rules as follows.
In case 1, the values of the two geospatial trellis codes are equal. At this time, the grid level sizes of the two geospatial grid codes are compared, and the comparison result can be further subdivided into the following three types.
Case 1-1, the grid level value of a is greater than the grid level value of b. The next round of numerical comparison begins with a continuation of the a taking the next geospatial trellis codes a' and b from front to back.
Cases 1-2, the grid level value of a is equal to the grid level value of b. The next round of numerical comparison begins with the forward and backward retrieval of the next geospatial trellis codes a ', b', respectively, from A, B.
Cases 1-3, where the grid level value of a is less than the grid level value of b. And continuously splitting the a to the grid level of the b to obtain a temporary geospatial grid coding set F. And arranging all the geospatial grid codes with values larger than b in F from small to large, and inserting all the geospatial grid codes into front of the rest geospatial grid codes in the geospatial grid code set A to form a new geospatial grid code set A'. Taking the newly obtained set a ' as a, the next round of numerical comparison starts with continued front-to-back removal of a ' and b ', respectively, from A, B.
For example, the numerical comparison of G111 and G1110 meets cases 1-3, and G111 is split into grid levels of G1110 to obtain a temporary geospatial grid code set F (G1110, G1111, G1112, G1113). G1111, G1112 and G1113 having values larger than G1110 are arranged in small to large order, and are inserted into the front of the rest of the geospatial trellis codes in the geospatial trellis code set A to form a new geospatial trellis code set A ', and the newly obtained set A' is regarded as A. The next round of numerical comparison begins with continued forward and backward removal of a 'and b', respectively, from A, B.
Case 2, a has a value greater than b. At this time, the grid level sizes of the two geospatial grid codes are compared, and the comparison result can be further subdivided into the following two types.
Case 2-1, the grid level value of a is less than or equal to the grid level value of b. The next round of numerical comparison begins with continued front-to-back removal of the next geospatial trellis codes B' and a from B.
Case 2-2, the grid level value of a is greater than the grid level value of b. And deleting a from the end bit by bit until the number of bits consistent with b is obtained to obtain c. C and b are converted into binary, then the bitwise exclusive-or operation is carried out, and the result of the bitwise exclusive-or operation can be further subdivided into the following two types.
In case 2-2-1, the bitwise exclusive OR result is not 0. The next round of numerical comparison begins with continued front-to-back removal of the next geospatial trellis codes B' and a from B.
And in the case 2-2-2, the bit exclusive OR operation result is 0. The next round of numerical comparison begins with a continuation of the a taking the next geospatial trellis codes a' and b from front to back.
Case 3, a has a value less than b. At this time, the grid level sizes of the two geospatial grid codes are compared, and the comparison result can be further subdivided into the following two types.
Case 3-1, the grid level value of a is greater than or equal to the grid level value of b. A is stored into a result geospatial grid code set R, and then the next geospatial grid codes a' and b are sequentially taken out from front to back from the A, and the next round of numerical comparison is started.
Case 3-2, the grid level value of a is less than the grid level value of b. B is deleted bit by bit from the end until the number of bits consistent with b gets c. C and a are converted into binary, and then bitwise exclusive-or operation is carried out, and the result of the bitwise exclusive-or operation can be further subdivided into the following two types.
In case 3-2-1, the bitwise exclusive OR result is not 0. The next round of numerical comparison begins with a continuation of the a taking the next geospatial trellis codes a' and b from front to back.
In case 3-2-2, the bit-wise exclusive OR result is 0. And continuously splitting the a to the grid level of the b to obtain a temporary geospatial grid coding set F. And storing all the geospatial grid codes with the values smaller than b in F into a result geospatial grid code set R, arranging all the geospatial grid codes with the values larger than b from small to large, and fully inserting the geospatial grid codes into the front of the residual geospatial grid codes in the geospatial grid code set A to form a new geospatial grid code set A'. Taking the newly obtained set a ' as a, the next round of numerical comparison starts with continued front-to-back removal of a ' and b ', respectively, from A, B.
For example, the numerical comparison of G111 and G1111 meets the condition 3-2-2, and G111 is split into grid levels of G1111 to obtain a temporary geospatial grid code set F (G1110, G1111, G1112, G1113). G1110 having a value less than G1111 is stored in the resulting geospatial trellis-encoded set R. G1112 and G1113 having values larger than G1111 are arranged in small to large order and are all inserted in front of the remaining geospatial trellis codes in the geospatial trellis code set A to form a new geospatial trellis code set A ', and the newly obtained set A' is regarded as A. The next round of numerical comparison begins with continued forward and backward removal of a 'and b', respectively, from A, B.
S433, repeating the numerical comparison process until any earth space grid coding set is traversed.
S434, after traversing any source geospatial grid code set, if there are residual geospatial grid codes in the geospatial grid code set A at this time, storing all the residual geospatial grid codes in the geospatial grid code set R. And (5) finishing the space superposition analysis calculation process of clipping.
S44, the process of calculating by adopting the space superposition analysis calculation method of intersection negation is as follows:
the calculation steps when the intersection is inverted in the space superposition analysis calculation are as follows:
the whole cross inversion process consists of a plurality of rounds of numerical comparison. And respectively taking out the first earth space grid codes from the two earth space grid code sets for clipping, carrying out numerical comparison, determining the source of the earth space grid codes for carrying out the next numerical comparison according to the result of each round of numerical comparison, and repeating the numerical comparison process until any earth space grid code set is emptied.
In particular, if the two geospatial trellis codes subjected to numerical comparison differ in trellis stages, it is necessary to temporarily supplement 0 at the end of the geospatial trellis code having a small trellis stage value at the time of comparison until the two geospatial trellis code digits agree. The temporary bit-filling 0 is deleted after the numerical comparison, and is restored to the earth space grid coding before the bit filling 0.
S441, respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first round numerical comparison.
Two sets of geospatial trellis codes for cross inversion are set as A, B, and the first geospatial trellis codes are taken from A, B, identified as a and b, respectively. And (3) comparing the values of a and b.
S442, screening the geospatial grid codes according to the numerical comparison result of each round and the cross inversion screening rule, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison.
The comparison result of any two geospatial grid coding values is divided into the following two major cases, and the two major cases are processed according to the following intersection inversion screening rules.
In case 1, the values of the two geospatial trellis codes are equal, and the two geospatial trellis codes are compared in terms of the size of the trellis stages, and the comparison result can be further subdivided into the following two types.
In case 1-1, the grid levels of the two geospatial grid codes are also equal, and the geospatial grid codes a ', B' are continuously taken out from the front to the back from A and B respectively for the next round of numerical comparison.
In case 1-2, the grid levels of two geospatial grid codes are not equal, and the geospatial grid code with smaller grid level value in a and b is set as s, and the larger grid level value in a and b is set as t. And continuously splitting s to the grid level of t to obtain a temporary geospatial grid coding set F. Storing all the geospatial grid codes with the values smaller than t in F into a result geospatial grid code set R, arranging all the geospatial grid codes with the values larger than t from small to large, and inserting all the geospatial grid codes in front of the geospatial grid code set with the values smaller than t to form a new geospatial grid code set. After replacing the original set with the newly obtained set, continuing to take out a 'and b' from the two geospatial grid coding sets from front to back respectively for the next round of numerical comparison;
in case 2, the values of the two geospatial grid codes are not equal, the geospatial grid code with smaller value in a and b is s, the larger value is t, and t is deleted or added with 0 from the end of the code in sequence so that the total bit number of t is consistent with s to obtain t'. After converting t' and s into binary, performing bit-wise exclusive-or operation, wherein the result of the bit-wise exclusive-or operation can be further subdivided into the following two types:
and under the condition 2-1, continuously dividing s to the grid level of t according to the bit exclusive OR operation result of 0 to obtain a temporary geospatial grid coding set F. Arranging all the geospatial grid codes with values greater than t in F from small to large, and inserting all the geospatial grid codes into front of the s-source geospatial grid code set to form a new geospatial grid code set. After replacing the original set with the newly obtained set, the next round of numerical comparison is continued from the two geospatial trellis encoded sets by taking a 'and b' from front to back, respectively.
In case 2-2, the result of the bitwise exclusive or operation is not 0, and the next geospatial trellis code is continuously fetched from the s-source geospatial trellis code set from front to back and the next round of numerical comparison is restarted with t.
S443, repeating the numerical comparison process until any geospatial grid coding set is traversed.
S444, after any earth space grid coding set is traversed, if the other earth space grid coding set has residual earth space grid codes, the residual earth space grid codes are all stored in the resultant earth space grid coding set. And thus completing the space superposition analysis calculation process of the cross inversion.
After the space superposition analysis and calculation of the geospatial grid coding set are completed through the steps, a result geospatial grid coding set is obtained, and at the moment, the result can be further processed.
1) And cleaning up grid codes which do not correspond to the actual space in the result geospatial grid code set.
The result obtained by calculation is that the grid codes which do not correspond to the actual space exist in the earth space grid code set, and preferably, the grid codes can be cleaned.
According to the coding standard 5.5.2, the earth space is expanded in the coding process, and the expansion is from 1 degree (60 minutes) to 64 minutes. During the subdivision process, the database encodes grids between 60 and 64 partitions, which do not correspond to actual spatial locations and should be deleted in the final result. And intercepting hierarchical codes from the space grid code set in a computer, performing second-level codes, judging whether the value is larger than a coding interval corresponding to 60, and deleting the grid codes out of range from the space grid code set.
For example, the hierarchical code of one geospatial trellis code is 333331, which is converted from quaternary to binary to 111111111101, and the code rule appendix D shows that even digits are extracted to obtain latitude code 111111, and that conversion of 111111 from binary to decimal 63, which is the range 63 '-64' corresponding to the hierarchical code, is the extended non-actual spatial position, and the geospatial trellis code is deleted.
2) The resulting geospatial trellis encoded set is converted back to a vector space data format file.
Preferably, when vector space data is required to represent the final computed result, the resulting geospatial grid code set may be converted back to a vector space data format file. The operation of this step is essentially the reverse of step S1.
And (3) crossing the cleaned result geospatial grid coding set by coding anti-Morton, calculating to obtain longitude and latitude coordinate data by combining grid-level values, and re-exporting the longitude and latitude coordinate data into vector space data shape by using a shp2pg or ogr2ogr tool.
The embodiment of the invention also provides a vector space data superposition analysis device, which comprises the following modules:
1) The coding module is used for acquiring the geometric type and the complete longitude and latitude coordinate information of the vector space data and coding the vector space data into an earth space grid coding set according to the coding rule.
The module may read the coordinate information in the shapefile imported into the database by the open source transformation tool shp2pg or ogr2ogr and transform the coordinate information into geospatial grid coding. The inverse process may convert the geospatial grid code into coordinate information, store it in a database, and export it as a shape file by shp2pg or ogr2 ogr. When the coordinate information is converted into the geospatial grid coding, corresponding precision loss can be generated according to the selected grid level, and the corresponding precision of the grid level can be seen in an annex A of the coding rule.
2) And a compression module: methods for merging geospatial trellis codes to compress a set of geospatial trellis codes using a recursive bipartite process in an inversion coding rule.
The module compresses the geospatial grid codes on the premise of not damaging the precision of the spatial information, continuously upwards combines and compresses the geospatial grid codes which can be combined into smaller grid level values, and possibly changes the maximum level and the minimum level of the geospatial grid code objects according to actual data
3) And a sequencing module: for ordering all codes in the compressed geospatial grid code set according to a dictionary order.
4) And the superposition analysis module is used for: and the method is used for carrying out space superposition analysis and calculation on all the sequenced geospatial grid coding sets to obtain a result geospatial grid coding set.
The calculation process of the superposition analysis module does not cause the precision loss of the spatial information.
The embodiment of the invention also provides electronic equipment, which comprises:
a memory for storing a computer program;
and the processor is used for executing the program stored in the memory and realizing the steps of the vector space data superposition analysis method embodiment.
For specific implementation of each step of the method and related explanation, reference may be made to an embodiment of the method, which is not described herein.
The Memory of the electronic device mentioned in this embodiment may include a random access Memory (Random Access Memory, RAM) or may include a Non-Volatile Memory (NVM), such as at least one magnetic disk Memory.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
The embodiment of the invention also provides a computer readable storage medium, and a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the steps of the basic vector space data superposition analysis method embodiment are realized. For specific implementation of each step of the method and related explanation, reference may be made to an embodiment of the method, which is not described herein.
It should be noted that, in the present specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments.
In particular, for apparatus, electronic devices, computer readable storage medium embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant references are made to the partial description of method embodiments.
The above description of the embodiments is only for aiding in the understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.

Claims (10)

1. The vector space data superposition analysis method is characterized by comprising the following steps of:
1) Acquiring the geometric type and complete longitude and latitude coordinate information of vector space data, and coding the vector space data into an earth space grid coding set according to a coding rule;
2) Combining the geospatial trellis codes using a method of inverting a recursive bipartite process in the coding rule to compress a set of geospatial trellis codes;
3) Ordering all codes in the compressed geospatial grid code set according to a dictionary sequence;
4) Performing the operations of steps 1) to 3) above for each vector space data;
5) And performing space superposition analysis and calculation on all the sequenced geospatial grid code sets to obtain a result geospatial grid code set.
2. The method for superposition analysis of vector space data according to claim 1, wherein said obtaining geometrical type and complete longitude and latitude coordinate information of vector space data, according to coding rules, encodes vector space data into a geospatial trellis coded set, comprises:
1) Importing the vector space data file into a database to obtain longitude and latitude information of positioning points in the vector space data;
2) And carrying out subdivision coding on the vector space data at the input grid level according to the coding rule to obtain a geospatial grid coding set.
3. The method of claim 1, wherein the performing spatial superposition analysis calculation on all the sorted geospatial trellis coded sets comprises using any one or a combination of the following:
1) Calculating the two geospatial grid coding sets by adopting a space superposition analysis calculation method of intersection;
2) Calculating two geospatial grid coding sets by adopting a merging space superposition analysis calculation method;
3) Calculating two geospatial grid coding sets by adopting a cut space superposition analysis calculation method;
4) And calculating the two geospatial grid coding sets by adopting a space superposition analysis calculation method of intersection negation.
4. A method of vector space data superposition analysis according to claim 3, wherein said computing said two geospatial trellis encoded sets using a cross-wise spatial superposition analysis computation method comprises:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the intersection screening rule, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) And repeatedly carrying out numerical comparison until any one of the two geospatial grid coding sets is traversed, stopping the comparison, and finally obtaining a result geospatial grid coding set.
5. A method of vector space data superposition analysis according to claim 3, wherein said computing two geospatial trellis encoded sets using a combined spatial superposition analysis calculation method comprises:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the calculation and screening rule, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) Repeatedly comparing the numerical values until any one of the two geospatial grid coding sets is traversed;
4) After traversing any source geospatial grid code set, storing the residual geospatial grid codes which are not traversed in the other source geospatial grid code set into a result geospatial grid code set.
6. A method of vector space data superposition analysis according to claim 3, wherein said computing two geospatial trellis encoded sets using a cropped spatial superposition analysis computation method comprises:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result and the clipping screening rule of each round, storing the result into a geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the source to start the next round of comparison;
3) Repeating the numerical comparison process until any geospatial grid coding set is traversed;
4) After any geospatial grid code set is traversed, if the first geospatial grid code set has residual geospatial grid codes, storing all the residual geospatial grid codes into the geospatial grid code set; if there are more residual geospatial trellis codes in the second set of geospatial trellis codes, deleting all of the residual geospatial trellis codes therein.
7. A method of vector space data superposition analysis according to claim 3, wherein said computing said two geospatial trellis encoded sets using a cross-inversion spatial superposition analysis computation method comprises:
1) Respectively taking out the first geospatial grid codes from the two geospatial grid code sets to carry out first-round numerical comparison;
2) Screening the geospatial grid codes according to the numerical comparison result of each round and the intersection inversion screening rule, storing the result into a result geospatial grid code set, determining the source of the geospatial grid codes for the next round of numerical comparison, and continuously and sequentially taking out the geospatial grid codes from the result to start the next round of comparison;
3) Repeating the numerical comparison process until any geospatial grid coding set is traversed;
4) After any one of the geospatial trellis code sets has been traversed, if there are remaining geospatial trellis codes in another geospatial trellis code set at this time, all of these remaining geospatial trellis codes are stored in the resultant geospatial trellis code set.
8. The vector space data superposition analysis device is characterized by comprising the following modules:
1) The coding module is used for acquiring the geometric type and complete longitude and latitude coordinate information of the vector space data and coding the vector space data into an earth space grid coding set according to a coding rule;
2) And a compression module: a method for merging geospatial trellis codes to compress a set of geospatial trellis codes using a recursive bipartite process in an inversion coding rule;
3) And a sequencing module: all codes in the compressed geospatial grid code set are ordered according to dictionary sequence;
4) And the superposition analysis module is used for: and the method is used for carrying out space superposition analysis and calculation on all the sequenced geospatial grid coding sets to obtain a result geospatial grid coding set.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing a program stored on a memory, implementing the method steps of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN202311544352.9A 2023-11-20 2023-11-20 Vector space data superposition analysis method and device, electronic equipment and storage medium Active CN117271695B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311544352.9A CN117271695B (en) 2023-11-20 2023-11-20 Vector space data superposition analysis method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311544352.9A CN117271695B (en) 2023-11-20 2023-11-20 Vector space data superposition analysis method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN117271695A true CN117271695A (en) 2023-12-22
CN117271695B CN117271695B (en) 2024-02-20

Family

ID=89214638

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311544352.9A Active CN117271695B (en) 2023-11-20 2023-11-20 Vector space data superposition analysis method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117271695B (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6125201A (en) * 1997-06-25 2000-09-26 Andrew Michael Zador Method, apparatus and system for compressing data
WO2002073459A1 (en) * 2001-03-13 2002-09-19 Visteon Holdings France Method for searching an object in a space, vectorial mapping method and system integrating said vectorial mapping method and electronic device carrying out said vectorial mapping method
CN101354788A (en) * 2008-08-20 2009-01-28 大连民族学院 One-dimensional nondestructive geometric compressing method of three-dimensional grid model
CN101599183A (en) * 2008-06-06 2009-12-09 吴立新 A kind of method that realizes division of geospace three-dimensional grids
CN101751449A (en) * 2009-09-16 2010-06-23 中国科学院计算技术研究所 Spatial overlap analysis method and system used in geographic information system
JP2017167889A (en) * 2016-03-17 2017-09-21 株式会社東芝 Data management device, data management system, and data management method
US20170293635A1 (en) * 2016-04-08 2017-10-12 Perry R. Peterson Methods and systems for selecting and analyzing geospatial data on a discrete global grid system
WO2018104207A1 (en) * 2016-12-07 2018-06-14 Utb Envirotec Zrt. Encoding scheme for geographic position data
EP3343394A1 (en) * 2016-12-27 2018-07-04 Fundacion Centro de Tecnologias de Interaccion Visual y comunicaciones Vicomtech Method for and system for creating global thematic maps based on extraction of image descriptors
CN109522382A (en) * 2018-11-14 2019-03-26 国家基础地理信息中心 Spatial data gridding statistical method and device
CN112818074A (en) * 2020-11-12 2021-05-18 中国国土勘测规划院 Complex multi-inner-ring vector graphic space superposition optimization method
CN113515525A (en) * 2021-07-29 2021-10-19 郑州众合景轩信息技术有限公司 Spatial data organization method based on global multi-scale grid
CN115391351A (en) * 2022-09-14 2022-11-25 联通(广东)产业互联网有限公司 Multi-layer vector data superposition method based on Spark big data
CN116257559A (en) * 2023-03-16 2023-06-13 北斗伏羲中科数码合肥有限公司 Method and device for associating person with address based on space grid and electronic equipment
CN116318541A (en) * 2023-02-09 2023-06-23 福州致远汇创信息科技有限公司 Network space multidimensional information subdivision grid coding method, device, equipment and medium
CN116521813A (en) * 2023-05-11 2023-08-01 中国电建集团贵阳勘测设计研究院有限公司 Method and system for encoding vector data with self-adaptive length

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6125201A (en) * 1997-06-25 2000-09-26 Andrew Michael Zador Method, apparatus and system for compressing data
WO2002073459A1 (en) * 2001-03-13 2002-09-19 Visteon Holdings France Method for searching an object in a space, vectorial mapping method and system integrating said vectorial mapping method and electronic device carrying out said vectorial mapping method
CN101599183A (en) * 2008-06-06 2009-12-09 吴立新 A kind of method that realizes division of geospace three-dimensional grids
CN101354788A (en) * 2008-08-20 2009-01-28 大连民族学院 One-dimensional nondestructive geometric compressing method of three-dimensional grid model
CN101751449A (en) * 2009-09-16 2010-06-23 中国科学院计算技术研究所 Spatial overlap analysis method and system used in geographic information system
JP2017167889A (en) * 2016-03-17 2017-09-21 株式会社東芝 Data management device, data management system, and data management method
US20170293635A1 (en) * 2016-04-08 2017-10-12 Perry R. Peterson Methods and systems for selecting and analyzing geospatial data on a discrete global grid system
WO2018104207A1 (en) * 2016-12-07 2018-06-14 Utb Envirotec Zrt. Encoding scheme for geographic position data
EP3343394A1 (en) * 2016-12-27 2018-07-04 Fundacion Centro de Tecnologias de Interaccion Visual y comunicaciones Vicomtech Method for and system for creating global thematic maps based on extraction of image descriptors
CN109522382A (en) * 2018-11-14 2019-03-26 国家基础地理信息中心 Spatial data gridding statistical method and device
CN112818074A (en) * 2020-11-12 2021-05-18 中国国土勘测规划院 Complex multi-inner-ring vector graphic space superposition optimization method
CN113515525A (en) * 2021-07-29 2021-10-19 郑州众合景轩信息技术有限公司 Spatial data organization method based on global multi-scale grid
CN115391351A (en) * 2022-09-14 2022-11-25 联通(广东)产业互联网有限公司 Multi-layer vector data superposition method based on Spark big data
CN116318541A (en) * 2023-02-09 2023-06-23 福州致远汇创信息科技有限公司 Network space multidimensional information subdivision grid coding method, device, equipment and medium
CN116257559A (en) * 2023-03-16 2023-06-13 北斗伏羲中科数码合肥有限公司 Method and device for associating person with address based on space grid and electronic equipment
CN116521813A (en) * 2023-05-11 2023-08-01 中国电建集团贵阳勘测设计研究院有限公司 Method and system for encoding vector data with self-adaptive length

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王莉 等: "地球空间网格编码技术分析", 《测绘通报》, no. 10, pages 131 - 134 *
肖茁建 等: "一种基于预存交点的矢量空间叠加分析算法", 高技术通讯, vol. 28, no. 11, 31 December 2018 (2018-12-31), pages 899 - 906 *

Also Published As

Publication number Publication date
CN117271695B (en) 2024-02-20

Similar Documents

Publication Publication Date Title
CN109992636B (en) Space-time coding method, space-time index and query method and device
CN111260784B (en) Urban three-dimensional space grid compression coding method and device and terminal equipment
WO2012139249A1 (en) Method for encoding a mesh model, encoded mesh model and method for decoding a mesh model
CN101354788B (en) One-dimensional nondestructive geometric compressing method of three-dimensional grid model
CN110633262B (en) Spark-based map intersection area calculation method and system
US20190258634A1 (en) Data stream connection method and apparatus
CN113806601B (en) Peripheral interest point retrieval method and storage medium
Bhatia et al. AMM: Adaptive multilinear meshes
CN117271695B (en) Vector space data superposition analysis method and device, electronic equipment and storage medium
CN108334532B (en) Spark-based Eclat parallelization method, system and device
CN111612859A (en) Three-dimensional point cloud model compression method based on data dimension reduction and implementation system thereof
CN111563080A (en) Spatial data indexing and topological method, device and storage medium
Jia et al. Singularity computation for rational parametric surfaces using moving planes
CN114116925A (en) Spatio-temporal data query method and related device
Fellegara et al. Efficient representation and analysis of triangulated terrains
CN117494509B (en) Block structure self-adaptive grid refinement method based on multiple physical fields
CN111985172B (en) Approximate simplification method of single-output combinational logic circuit
Jiang Set operations between linear octrees
Ponchio et al. Interactive rendering of dynamic geometry
CN117312471B (en) Sea-land attribute judging method and device for massive position points
WO2021139796A1 (en) Method for constructing morton codes, encoder, decoder, and storage medium
CN110021059B (en) High-efficiency Marking Cubes isosurface extraction method and system without redundant computation
WO2023169007A1 (en) Point cloud prediction processing method and apparatus, computer, and storage medium
CN116755627A (en) Spatial data storage method, spatial data storage device, computer equipment and storage medium
Jiangxin et al. Line-Based Structure for Voxel Model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant