A method for incremental updating of geospatial vector data based on information feature codes
By using the method of comparing information feature codes and hash tables in incremental update of geospatial vector data, the problem of inefficient incremental update in large-area and complex factor scenarios is solved, and efficient incremental update is achieved.
Patent Information
- Application Number
- CN202411332874.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The prior art is inefficient in incremental update of geospatial vector data of large-area and complex elements and cannot meet the needs of efficient incremental updates.
The geospatial vector data incremental update method based on information feature code is adopted. By generating and updating the information feature code of the feature, the hash table is used for comparison, which reduces complex calculations and improves efficiency.
The efficiency of incremental updates is improved, the complexity of program development is reduced, and the efficiency of incremental comparison does not decrease with the increase in data volume, and is suitable for large-area and complex update scenarios.
Smart Images

Figure CN119271754B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of geographic space data application technology, and in particular to a method for incrementally updating geographic space vector data based on information feature codes. Background Art
[0002] At present, there are two main methods for incremental update of geographic spatial vector data. One is incremental update based on graphic feature matching, which first matches elements based on geometric features, and then compares the coordinate points and attribute information of the matching elements one by one; the other is incremental update based on the unique identification code of the element (generally a generated GU ID code, which is not related to the characteristics of the element). This method matches the element by searching for the unique identification code of the element, and then compares the coordinate points and attribute information of the element one by one. Although geometric feature matching is avoided, the element features still need to be compared one by one. In addition, since the elements involve interruption, segmentation, merging and other operations in editing, the relationship between the unique identification code and the object is difficult to inherit and maintain, which will generate a large number of false additions and false deletions. With the increase of data scope and data complexity, the above conventional methods increase the number of search and comparison operations sharply, resulting in a significant increase in time consumption. In the update scenario of large-area and complex elements, it is impossible to meet the demand for efficient incremental update. The technical method proposed in the present invention is intended to solve the problem of low efficiency of incremental update in large-area and complex element scenarios. Summary of the invention
[0003] The purpose of the present invention is to solve the shortcomings of the prior art and to propose a method for incremental updating of geographic space vector data based on information feature codes.
[0004] In order to achieve the above object, the present invention adopts the following technical solutions:
[0005] Design a method for incremental updating of geospatial vector data based on information feature codes. The specific steps are as follows:
[0006] S1. Establish a spatial database for storing geographic spatial vector elements;
[0007] S2. Set the new time and deletion time identifiers for geographic space vector elements and establish an incremental storage mechanism. The deletion time is used to identify the deletion status and deletion time of the element, and the new time is used to identify the time when the element was generated;
[0008] S3. Establish the corresponding relationship between the events of adding, deleting and modifying geographic spatial vector elements and the events of adding, deleting and modifying spatial database records. The event of adding an element triggers the insertion of a new record in the spatial database table and adds the added time information; the event of deleting an element triggers the addition of the deletion time in the corresponding record in the database table; the event of modifying an element triggers the insertion of a new record in the database table according to the modified status information, adds the added time information, and adds the deletion time to the original record of the element;
[0009] S4. Set the geographic space vector feature information feature code storage fields Feature and Feature_Salt to store the generated geographic space vector feature information feature code and the information feature code generated after adding salt to the feature feature. Feature_Salt is used for data verification to prevent the collision of information feature codes.
[0010] S5, establishing an information feature code generator;
[0011] S6. Establish an information feature code update trigger. When the vector element itself is added, deleted, or modified, the update of the vector element Feature and Feature_Salt is triggered. The information feature code update trigger calls the information feature code generator to maintain the matching of the information feature code and the feature feature.
[0012] S7. Obtain the data source and perform incremental update into the database.
[0013] Preferably, the generator has the following characteristics: according to the given element, the element feature string m0 is combined: feature type (GeoType) | feature code (Code) | coordinate information string | attribute information string, the attribute information string does not contain the information feature code field, and then the hash function n is used n =H1(m n ) Generate feature code n0, store it in the feature field of the feature, add the feature layer name before the feature feature string m0, and combine them into a new feature feature string m1: LayerName|m0, use the above hash function to generate feature code n1, and store it in the feature_Salt field of the feature.
[0014] Preferably, the coordinate information string is as follows:
[0015] x1|y1|z1|PointType1|x2|y2|z2|PointType2|.....x n |y n |z n |PointType n .
[0016] Preferably, the attribute information string is as follows:
[0017] Field1|Value1|Field2|Value2|......Field n |Value n .
[0018] Preferably, the following process is performed in S7:
[0019] 1. Get the incremental update area range P = {P1, P2...P n};
[0020] 2. Get the incremental update data source set, use P to perform intersection operation with the data source set, get the vector elements that are completely and partially in P, and construct the set UpdateList;
[0021] 3. Traverse UpdateList to obtain the information feature code set UpdateFeatureList and UpdateFeatureList_Salt of the elements in the collection. The three collection index numbers correspond one to one;
[0022] 4. Use P as the spatial parameter to access the target spatial database, obtain the spatial database elements that are completely and partially within P, cache the data and construct the collection DatabaseList;
[0023] 5. Traverse DatabaseList and obtain the information feature code set DatabaseFeatureList and DatabaseFeatureList_Salt of the elements in the collection. The three collection index numbers correspond one to one;
[0024] 6. Construct the DeleteList and NewlyAddedList sets of added and deleted geographic spatial vector elements;
[0025] 7. Construct hash table HT1, and add the records in DatabaseFeatureList to hash table HT1 one by one through hash function H2 (key). During the adding process, if there is already data in the corresponding memory location, it will not be added. At the same time, it indicates that there are duplicate values and needs to be removed. Get the index number n corresponding to DatabaseFeatureList, and add the feature corresponding to index number n in DatabaseList to DeleteList;
[0026] 8. Then add the records in UpdateFeatureList to hash table HT1 one by one through hash function H2 (key). If the data in the corresponding memory location is empty, it means that the same record value does not exist in DatabaseFeatureList, which means that the feature is newly added. Get the index number of UpdateFeatureList, and add the feature of UpdateList corresponding to the index number to NewlyAddedList. If there is data in the corresponding memory location, it means that the same record value exists in DatabaseFeatureList, which means that the feature has not changed, and no operation is performed.
[0027] 9. Construct hash table HT2, and add the records in UpdateFeatureList to hash table HT2 one by one through hash function H2(key). During the adding process, if there is data in the corresponding memory location, it will not be added;
[0028] 10. Then add the records in DatabaseFeatureList to hash table HT2 one by one through hash function H2 (key). If the data in the corresponding memory location is empty, it means that there is no same record value in UpdateFeatureList, which means that the feature is deleted. Get the index number of DatabaseFeatureList, and add the feature of DatabaseList corresponding to the index number to DeleteList. If there is data in the corresponding memory location, it means that there is the same record value in UpdateFeatureList, which means that the feature has not changed, so it will not be added.
[0029] 11. Construct the new and deleted sets DeleteList_Salt and NewlyAddedList_Salt of geographic spatial vector features, replace DeleteList and NewlyAddedList respectively, use DatabaseFeatureList_Salt to replace DatabaseFeatureList, use UpdateFeatureList_Salt to replace UpdateFeatureList, construct hash tables HT3 and HT4, and repeat the above steps 7 to 10 through the hash function H2 (key);
[0030] 12. Intersect the set DeleteList_Salt with the set DeleteList, store the result in DeleteList, and union the set NewlyAddedList_Salt with the set NewlyAddedList, store the result in NewlyAddedList;
[0031] 13. Use NewlyAddedList as the feature addition collection and DeleteList as the feature deletion collection, and update the established spatial database according to the rules agreed upon in 2 to 3.
[0032] The invention proposes a method for incremental updating of geographic space vector data based on information feature code, which has the following beneficial effects: in the field of incremental updating of geographic space vector data, incremental comparison is generally carried out in two-dimensional space, which requires complex spatial search and matching, and then traverses its spatial or attribute features one by one. The algorithm has high time and space complexity and low operation efficiency. With the increase of the number of geographic space vector elements and the complexity of the elements themselves, its efficiency will drop sharply. The invention converts the complex calculation of two-dimensional space into simple calculation of one-dimensional space, reduces the complexity of program development and improves the execution efficiency; when comparing in one-dimensional space, a hash table is used to store the feature information feature code, and the feature storage location is obtained by the feature feature code calculation. The efficiency of feature search and matching will not decrease with the increase of data volume. At the same time, the information feature code uses a fixed length to describe the spatial and attribute characteristics of the feature, which is used to judge the change of the feature, and its comparison efficiency is independent of the complexity of the geographic space vector element. Generating feature information feature code requires traversing feature features. The invention pre-places this link in the feature change trigger, and evenly distributes the efficiency loss to each feature addition, deletion and modification link. Therefore, the present invention improves the efficiency of incremental updates and plays a good supporting role in basic surveying and mapping and large-area update scenarios of urban surveys. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of generating vector element information feature codes of the present invention.
[0034] Figure 2 This is the overall flow chart of the incremental update storage of the present invention.
[0035] Figure 3 The process of calculating increments through a hash table and a hash function H2(key) of the present invention Figure 1 .
[0036] Figure 4 The process of calculating increments through a hash table and a hash function H2(key) of the present invention Figure 2 . DETAILED DESCRIPTION
[0037] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0038] Reference Figure 1-4 , a method for incremental updating of geographic spatial vector data based on information feature codes, taking the production and update of 1:500 geographic spatial vector data as an example, using Eps geographic information workstation (hereinafter referred to as Eps) as the vector feature editing platform, and using the SunWaySDE spatial data engine supporting Eps to establish a spatial database, the specific steps are as follows:
[0039] S1. Create a corresponding data template in Eps, define the code, layer, type and attribute of the relevant features, add Feature and Feature_Salt attribute fields to each feature code, define them as system fields, and their attribute values cannot be modified directly;
[0040] S2. Use SunWaySDE to build a spatial database and add UpdateTime and DeleteTime fields to its spatial table;
[0041] S3. Use Visual Studio 2022 and C++ to develop an information feature code generator. The incoming object is the CGeoBase object in Eps (a CGeoBase object represents a vector feature). After obtaining the CGeoBase object, obtain its point list information Point3DList, and obtain its corresponding field description and attribute value information through the GetExtendAttr() interface. Then concatenate the feature information string m0. When taking the coordinate value, retain 5 decimal places, and the hash function n n =H1(m n ) Using the SHA-256 algorithm, generate the corresponding information feature code n0 for m0 based on the SHA-256 algorithm, add the layer name where the feature is located in front of m0, and generate the corresponding information feature code n1 based on the SHA-256 algorithm again, and use the SetExtendAttr() interface to store the information feature codes n0 and n1 in the Feature and Feature_Salt attribute fields of CGeoBase respectively;
[0042] S4. Overload the modification function and storage interface (stored in local data file) SaveDateBase() of the collection object in Eps, so that the corresponding function and interface call the above-mentioned information feature code generator to generate the information feature code of the element before modifying the memory or data file and store it in the Feature and Feature_Salt attribute fields of CGeoBase;
[0043] S5. Develop an incremental comparison module in Eps to obtain the element addition and deletion sets by comparing the element information feature codes. The specific steps are as follows:
[0044] A. Select the update area graphic in the drawing area to obtain the update area point list. Select the data source, usually the local edb file (Eps data file) as the update data source, and the spatial database as the update target. According to the update area point list, obtain the CGeoBase objects that intersect with the range and completely fall within the range from the local edb file and SunWaySDE spatial database respectively, extract the two information feature codes of CGeoBase, and form 4 information feature code sets;
[0045] B. Create a HashSet object HashSet1. HashSet is a set based on a hash table, and the hash function H2(key) has been implemented internally.
[0046] C. Use the Add() method to add the information feature code set of the database elements to HashSet1 one by one. If Add() returns false, it means that the element already exists in HashSet1. If Add() returns true, it means that the element does not exist in HashSet1, and the element value has been added to HashSet1. The elements that return false are determined to be duplicate elements, and the corresponding features are added to the deletion set DeleteList.
[0047] D. Use the Add() method to add the information feature code set of the local edb to HashSet1 one by one. If Add() returns false, the same feature is matched, indicating that the feature has not been modified. If Add() returns true, it means that the feature does not exist in HashSet1, and the feature is determined to be a new feature. The corresponding feature is added to the newly added set NewlyAddedList;
[0048] E. Create a new HashSet object HashSet2;
[0049] F. Use the Add() method to add the local EDB information feature code set to HashSet2 one by one. If Add() returns false, the same element is matched, indicating that there are duplicate elements in EDB. No record is made and redundant duplicate elements are discarded. If Add() returns true, it means that there is no such element in HashSet2, and the element value has been added to HashSet2.
[0050] G. Then use the Add() method to add the information feature code set of the database elements to HashSet2 one by one. If Add() returns false, the same element is matched, indicating that the element has not been modified. If Add() returns true, it means that the element does not exist in HashSet2, and the element is determined to be a deleted element, and the corresponding feature is added to the deletion set DeleteList;
[0051] H. Get the information feature code set generated by adding salt to the local edb and database elements, create a new HashSet and repeat the above steps 2 to 7 to get the sets NewlyAddedList_Salt and DeleteList_Salt. Finally, take the union of NewlyAddedList_Salt and NewlyAddedList, store the result in NewlyAddedList, take the intersection of DeleteList and DeleteList_Salt, and store the result in DeleteList.
[0052] S6. Modify the spatial database through the SunWaySDE interface according to the NewlyAddedList and DeleteList collections. New features are added through Insert to insert new records, and the UpdateTime field of the new features in the database is assigned a value based on the data update time. When deleting features, use the Update method to assign a value to the DeleteTime field of the feature record to mark the deletion.
[0053] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for incremental updating of geographic spatial vector data based on information feature codes, characterized in that: The specific steps are as follows: S1. Establish a spatial database for storing geographic spatial vector elements; S2. Set the new time and deletion time identifiers for geographic space vector elements and establish an incremental storage mechanism. The deletion time is used to identify the deletion status and deletion time of the element, and the new time is used to identify the time when the element was generated; S3. Establish the corresponding relationship between the addition, deletion and modification events of geographic spatial vector elements and the addition, deletion and modification of spatial database records. The element addition event triggers the insertion of a new record in the spatial database table and adds the added time information; the element deletion event triggers the addition of the deletion time in the corresponding record in the database table; The element modification event triggers the insertion of a new record in the database table according to the modified status information, adds the new time information, and adds the deletion time to the original element record; S4. Set the geographic space vector feature information feature code storage fields Feature and Feature_Salt to store the generated geographic space vector feature information feature code and the information feature code generated after adding salt to the feature feature. Feature_Salt is used for data verification to prevent the collision of information feature codes. S5. Establish an information feature code generator, which has the following characteristics: according to the given elements, combine the feature character string m0: feature type | feature code | coordinate information string | attribute information string, the attribute information string does not contain the information feature code field, and then use the hash function n n =H1(m n ) Generate feature code n0, store it in the Feature field of the feature, add the feature layer name before the feature feature string m0, and combine them into a new feature feature string m1: LayerName|m0, use the above hash function to generate feature code n1, and store it in the Feature_Salt field of the feature; S6. Establish an information feature code update trigger. When the vector element itself is added, deleted, or modified, the update of the vector element Feature and Feature_Salt is triggered. The information feature code update trigger calls the information feature code generator to maintain the matching of the information feature code and the feature feature. S7. Obtain the data source and perform incremental update into the database.
2. The method for incremental updating of geographic space vector data based on information feature codes according to claim 1 is characterized in that: The coordinate information string is as follows: x1|y1|z1|PointType1|x2|y2|z2|PointType2|……x n |y n |z n |PointType n 。 3. The method for incremental updating of geographic space vector data based on information feature codes according to claim 1 is characterized in that: The attribute information string is as follows: Field1|Value1|Field2|Value2|……Field n |Value n 。 4. The method for incremental updating of geographic space vector data based on information feature codes according to claim 1, characterized in that: The following process is executed in S7: (1) Obtain the incremental update area range P = {P1, P2...P n }; (2) Obtain the incremental update data source set, use P to perform an intersection operation with the data source set, obtain the vector elements that are completely and partially within P, and construct the set UpdateList; (3) Traverse UpdateList to obtain the information feature code set UpdateFeatureList and UpdateFeatureList_Salt of the elements in the collection. The three collection index numbers correspond one to one; (4) Use P as a spatial parameter to access the target spatial database, obtain the spatial database elements that are completely and partially within P, cache the data and construct the set DatabaseList; (5) Traverse DatabaseList and obtain the information feature code set DatabaseFeatureList and DatabaseFeatureList_Salt of the elements in the collection. The three collection index numbers correspond one to one; (6) Construct the DeleteList and NewlyAddedList sets of added and deleted geographic spatial vector elements; (7) Construct a hash table HT1, and add the records in DatabaseFeatureList to the hash table HT1 one by one through the hash function H2(key). During the adding process, if there is already data in the corresponding memory location, it will not be added. At the same time, it indicates that there are duplicate values and it is necessary to remove the duplicate values. Obtain the index number n corresponding to DatabaseFeatureList, and add the element corresponding to the index number n in DatabaseList to DeleteList; (8) Then, the records in UpdateFeatureList are added to hash table HT1 one by one through hash function H2(key). If the data in the corresponding memory location is empty, it indicates that there is no identical record value in DatabaseFeatureList, which means that the feature is newly added. The index number of UpdateFeatureList is obtained, and the feature of UpdateList corresponding to the index number is added to NewlyAddedList. If there is data in the corresponding memory location, it indicates that there is an identical record value in DatabaseFeatureList, which means that the feature has not changed, and no operation is performed. (9) Construct hash table HT2, and add the records in UpdateFeatureList to hash table HT2 one by one through hash function H2(key). During the adding process, if there is data in the corresponding memory location, it will not be added; (10) Then, the records in DatabaseFeatureList are added to hash table HT2 one by one through hash function H2(key). If the data in the corresponding memory location is empty, it indicates that there is no identical record value in UpdateFeatureList, which means that the feature is deleted. The index number of DatabaseFeatureList is obtained, and the feature of DatabaseList corresponding to the index number is added to DeleteList. If there is data in the corresponding memory location, it indicates that there is an identical record value in UpdateFeatureList, which means that the feature has not changed, and it is not added. (11) Construct the new and deleted sets DeleteList_Salt and NewlyAddedList_Salt of geographic spatial vector elements, replace DeleteList and NewlyAddedList respectively, use DatabaseFeatureList_Salt to replace DatabaseFeatureList, use UpdateFeatureList_Salt to replace UpdateFeatureList, construct hash tables HT3 and HT4, and repeat the above steps (7) to (10) through the hash function H2(key); (12) Intersect the set DeleteList_Salt with the set DeleteList and store the result in DeleteList; union the set NewlyAddedList_Salt with the set NewlyAddedList and store the result in NewlyAddedList; (13) NewlyAddedList is used as the element addition set, and DeleteList is used as the element deletion set. According to the rules agreed in steps S2 to S3, the established spatial database is updated.
Citation Information
Patent Citations
Element object spatial information fingerprint-based spatial data change capture method
CN105930478A
A vector dynamic updating method based on a spatio-temporal data model
CN109189999A