Universal vector data format conversion method and system
Patent Information
- Application Number
- CN202411326785.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-14
AI Technical Summary
Existing data conversion algorithms cannot meet the conversion between different data sources, and the mapping tables are cumbersome and inconsistent, resulting in large workloads of manual editing in the later stage, reducing production efficiency and increasing costs.
A general vector data format conversion method is proposed, including data preprocessing, sorting related mapping tables, database conversion and hierarchical classification. Data conversion is reduced by encoding mapping tables, field mapping tables and hierarchical classification tables. The workload of the table is to adapt to the conversion between different data regulations.
To a great extent, the workload of sorting out map tables has been greatly reduced, the transformation design ideas have been optimized, the development efficiency and data reusability have been improved, and the code writing volume and production costs have been reduced.
Smart Images

Figure CN119311748A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of vector data format conversion, and in particular to a universal vector data format conversion method and system. Background Art
[0002] Surveying and mapping geographic information data is a national strategic data resource and a new type of production factor, playing a key role in the construction of Digital China and the development of the digital economy. In order to accelerate the transformation and upgrading of surveying and mapping geographic information and better support high-quality development, the Ministry of Natural Resources and other relevant government departments have issued a series of guiding opinions and measures. One of the important measures is the construction of a real-life three-dimensional China, in which geographic entities are an important data basis for real-life three-dimensional construction. Geographic entities refer to natural or artificial features that exist independently and can be identified in the real world. The production process of geographic entities is mainly obtained through data conversion and subsequent manual modification of existing basic surveying and mapping results; the data format of some existing basic surveying and mapping results is relatively backward and different from the latest data regulations. It is necessary to convert the old data format into new standard data and then process the new standard data before the production of geographic entity data can be carried out. These processes all involve the key process of data conversion.
[0003] The basic surveying and mapping data of each province are different in terms of regulations and data sources, which brings great pressure to data conversion, mainly involving layer conversion, attribute field conversion, and coding comparison conversion. Chen Changwei combined the pilot production of basic geographic entities in Liaoning Province to explore the technical process and content of 1:10000 basic geographic information data to produce basic geographic entity data, summarized the experience in the data production process, and provided reference for the large-scale production of basic geographic entity data; in order to connect the "three surveys" data with the classification system of the "Guidelines for the Classification of Land and Sea Use for National Space Survey, Planning, and Use Control (Trial)", Yan Zhenyu et al. compared and analyzed the classification method of the guidelines with the current classification method of national land survey work from a theoretical level to the second-level category, and proposed a "three surveys" data conversion method for the classification of land and sea use for national space, providing a reference for the conversion of "three surveys" data to the classification system of land and sea use for national space; Han Dan conducted a study on the conversion and production of basic geographic entity data in urban built-up areas based on 1:2000 basic geographic information data, focusing on the conversion ideas of agglomeration entities and transportation entities, and verified the feasibility of the method through examples.
[0004] However, the existing data conversion algorithms still have the following defects:
[0005] 1) Existing data conversion algorithms are all from data source A to data source B, which cannot meet the requirements of data source A to data source C or other data requirements. Conversion between different data sources requires redesigning the conversion ideas;
[0006] 2) The mapping table arrangement process is a key link in the data conversion process. The mapping table arrangement methods of existing data conversion algorithms are cumbersome and the formats are different. Some even require the preparation of hundreds of mapping tables, which is obviously not advisable;
[0007] 3) After the data conversion is completed, the existing data conversion algorithm requires a lot of manual editing work in the later stage, especially for the many-to-one, one-to-many, and many-to-many conversions involving layer names and field attributes, which reduces production efficiency and increases production costs. Summary of the invention
[0008] In view of the deficiencies in the prior art, the present invention provides a universal vector data format conversion method and system.
[0009] The present invention discloses a universal vector data format conversion method, comprising:
[0010] Step S1, pre-conversion data pre-processing: merging the original data in the database before conversion according to the point, line, and surface layer types to obtain a database before conversion containing three layers of point, line, and surface;
[0011] Step S2, preprocessing of the empty database after conversion: performing the same processing method as the preprocessing of the data before conversion on the empty data template of the empty database after conversion, to obtain the empty database after conversion containing three layers of points, lines and surfaces;
[0012] Step S3, sorting out relevant mapping tables: including coding mapping table, field mapping table and hierarchical classification mapping table;
[0013] Step S4, executing database conversion: converting the point, line, and surface layer data in the database before conversion into empty data templates of the point, line, and surface layers in the empty database after conversion, respectively, and converting the ground feature elements and geometric shapes according to the coding mapping table, and filling in the attribute fields of the ground feature elements according to the field mapping table;
[0014] Step S5, pre-processing after database conversion: including many-to-one, one-to-many, and many-to-many feature conversion for code tables and field names, and data processing for different layer types;
[0015] Step S6, execute hierarchical classification of the database: hierarchically classify the geographical features of the converted database of point, line and surface layers according to the hierarchical classification mapping table. After all the hierarchical classifications are completed, the point, line and surface layers storing unrecognizable hierarchical classification elements are copied to the converted database for subsequent inspection and modification.
[0016] As a further improvement of the present invention, in the step S1, it specifically includes:
[0017] Read each layer in the database before conversion in turn; add the temporary layer name field temp in turn and assign the layer name;
[0018] Obtain the absolute paths of point, line, and surface layers in turn and save them in list form;
[0019] The three lists are merged according to the point, line and surface types to obtain the pre-conversion database after preprocessing;
[0020] The database before conversion includes three layers: point, line and surface, and each layer includes all the common attribute field names of the sub-layers before conversion.
[0021] As a further improvement of the present invention, in step S2, the converted empty database contains all public attribute field names of the template layer.
[0022] As a further improvement of the present invention, in step S3, the hierarchical classification mapping table is the land type codes of different land features contained in each layer of points, lines and surfaces.
[0023] As a further improvement of the present invention, in the step S5, for the many-to-one, one-to-many, and many-to-many feature conversions of the code table and field names, the temp field and other attribute fields need to be combined for conversion;
[0024] For conversion of different layer types, data processing is required after all data conversion is completed.
[0025] As a further improvement of the present invention, in step S6, specifically including:
[0026] According to the hierarchical classification mapping table, hierarchically classify the land feature elements of the converted database containing points, lines and surfaces according to the hierarchical classification mapping table, and classify one element in each layer, and delete the original element at the same time;
[0027] After all hierarchical classifications are completed, the point, line, and surface layers storing unrecognizable hierarchical classification elements will be copied to the converted database for subsequent inspection and modification by humans.
[0028] The present invention also discloses a universal vector data format conversion system, which is characterized by comprising:
[0029] The first preprocessing module is used to merge the original data in the database before conversion according to the point, line and surface layer types to obtain the database before conversion containing the three layers of point, line and surface;
[0030] A second preprocessing module is used to perform the same processing method as the first preprocessing module on the empty data template of the converted empty database to obtain a converted empty database containing three layers of points, lines and surfaces;
[0031] The sorting module is used to sort the code mapping table, the field mapping table and the hierarchical classification mapping table; the conversion module is used to perform database conversion, so that the points, lines and surfaces before the conversion are converted into the points, lines and surfaces after the conversion, and the ground features and geometric shapes are converted according to the code mapping table, and the attribute fields of the ground features are filled according to the field mapping table;
[0032] The third preprocessing module is used for many-to-one, one-to-many, and many-to-many feature conversion of code tables and field names, as well as data processing for different layer types;
[0033] The database hierarchical classification module is used to execute hierarchical classification of the database. It hierarchically classifies the geographical features of the database after the point, line and surface layers are converted according to the hierarchical classification mapping table. After all the hierarchical classifications are completed, the point, line and surface layers storing unrecognizable hierarchical classification features are copied to the converted database.
[0034] As a further improvement of the present invention, each layer in the database before conversion contains all common attribute field names of the layer before conversion.
[0035] As a further improvement of the present invention, each layer in the converted empty database contains all public attribute field names of the template layer.
[0036] As a further improvement of the present invention, the hierarchical classification mapping table is a land type code for different land features contained in each layer of points, lines and surfaces.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] The universal vector data format conversion model proposed in the present invention can greatly reduce the workload of sorting out related mapping tables, optimize the conversion design ideas of software developers, and reduce the workload of code writing;
[0039] The present invention can adapt to the conversion between all different vector data results, improve the reusability of existing vector result data, and give full play to the value of existing data.
[0040] The conversion model constructed by the present invention is highly replicable, and the conversion between different data specifications only requires replacing the mapping table, and there is almost no need to reconstruct the existing code, thereby improving development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 It is a flow chart of a general vector data format conversion method disclosed in the present invention;
[0042] Figure 2A schematic diagram of a data merging tool of a universal vector data format conversion system disclosed in the present invention;
[0043] Figure 3 A schematic diagram of a library template tool for a universal vector data format conversion system disclosed in the present invention;
[0044] Figure 4 A schematic diagram of a data conversion tool of a universal vector data format conversion system disclosed in the present invention;
[0045] Figure 5 A schematic diagram of a data layering tool for a universal vector data format conversion system disclosed in the present invention;
[0046] Figure 6 This is a schematic diagram of the 1:10,000 old data of Inner Mongolia before conversion disclosed in the first embodiment of the present invention;
[0047] Figure 7 This is a schematic diagram of the new data of Inner Mongolia at a scale of 1:10,000 after conversion disclosed in the first embodiment of the present invention;
[0048] Figure 8 This is a schematic representation of the new and old data attributes of the Inner Mongolia Autonomous Region before and after the conversion disclosed in the first embodiment of the present invention;
[0049] Fig. 9 This is a schematic diagram of the original old data of 1:50000 of national-level geographic entities before conversion disclosed in the second embodiment of the present invention;
[0050] Fig.10 This is a schematic diagram of the converted national-level geographic entity data disclosed in the second embodiment of the present invention;
[0051] Fig.11 This is a schematic representation of the new and old data attributes of some national-level geographic entities before and after the conversion disclosed in the second embodiment of the present invention;
[0052] Fig.12 This is a schematic diagram of the original 1:10000 old data of Shaanxi Province before conversion disclosed in the third embodiment of the present invention;
[0053] Fig.13 This is a schematic diagram of new data of Shaanxi Province after conversion disclosed in the third embodiment of the present invention;
[0054] Fig.14 This is a schematic diagram of the attributes of the new and old data of Shaanxi Province before and after the conversion disclosed in the third embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0057] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0058] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0059] like Figure 1 As shown, a general vector data format conversion method provided according to the present invention includes: data preprocessing before conversion, empty database preprocessing after conversion, sorting out related mapping tables, executing database conversion, database preprocessing after conversion and executing hierarchical classification of the database.
[0060] Among them, step S1, pre-conversion data pre-processing: merging the original data in the database before conversion according to the point, line, and surface layer types to obtain a database before conversion containing three layers of points, lines, and surfaces; the vector result database before conversion is generally stored in layers, such as annotation layers, point-like features such as houses, linear features such as linear roads and water systems, and surface-like features such as rivers and vegetation. The specific processing method includes:
[0061] Read each layer in the database before conversion in turn; add the temporary layer name field temp in turn and assign the layer name;
[0062] Obtain the absolute paths of point, line, and surface layers in turn and save them in list form;
[0063] The three lists are merged according to the point, line and surface types to obtain the pre-conversion database after preprocessing;
[0064] Before conversion, the database contains three layers: point, line, and surface. Each layer contains all the common attribute field names of the layer before conversion.
[0065] Step S2, preprocessing of the empty database after conversion: the empty data template of the empty database after conversion is processed in the same way as the data preprocessing before conversion to obtain an empty database after conversion containing three layers: point, line and surface; the empty database after conversion contains all the public attribute field names of the template layer.
[0066] Step S3, sorting out relevant mapping tables: Since the same land feature element is encoded differently in different vector result data, and the field names of different layers are also different, in general, the codes are one-to-one corresponding, the field names are also one-to-one corresponding, and the codes of different land features contained in each layer are fixed. Therefore, before converting any two vector data, it is only necessary to manually sort out the following mapping tables: code mapping table, field mapping table, hierarchical classification mapping table, and there is no need to sort out the layer comparison table. The hierarchical classification mapping table refers to the land class codes of different land features contained in each layer.
[0067] Step S4, executing database conversion: converting the point, line, and surface layer data in the database before conversion into empty data templates of the point, line, and surface layers in the empty database after conversion, respectively, and converting the ground feature elements and geometric shapes according to the coding mapping table, and filling in the attribute fields of the ground feature elements according to the field mapping table;
[0068] Step S5: Preprocessing after database conversion:
[0069] For the many-to-one, one-to-many, and many-to-many feature conversions of code tables and field names, special conversions with specific conditions need to be performed in combination with the temp field and other attribute fields;
[0070] For the conversion of different layer types, such as conversion front → conversion back point, conversion front line → conversion back point, etc., special data processing is required after all data conversion is completed;
[0071] Step S6, executing hierarchical classification of the database: hierarchical classification of the features of the converted database of the point, line and surface layers is performed according to the hierarchical classification mapping table. After all the hierarchical classification is completed, the point, line and surface layers storing the unrecognizable hierarchical classification features are copied to the converted database for subsequent inspection and modification; which specifically includes:
[0072] According to the hierarchical classification mapping table, the converted database containing points, lines and surfaces is hierarchically classified into geographical elements according to the hierarchical classification mapping table, and one element is classified in each layer, and the original element is deleted at the same time;
[0073] After all hierarchical classifications are completed, the point, line, and surface layers storing unrecognizable hierarchical classification elements are copied to the converted database for subsequent manual inspection and modification. At this point, the two sets of data are converted.
[0074] like Figure 2-5 As shown, a general vector data format conversion system provided according to the present invention includes:
[0075] A first preprocessing module, used to implement the above step S1;
[0076] A second preprocessing module, used to implement the above step S2;
[0077] A finishing module, used to implement the above step S3;
[0078] A conversion module, used to implement the above step S4;
[0079] A third preprocessing module, used to implement the above step S5;
[0080] The database hierarchical classification module is used to implement the above step S6.
[0081] Furthermore, in this embodiment, a C#+ArcEngine development method is adopted, and a SQLite database is used to manage related configuration tables. In combination with the algorithm model proposed in the present invention, a point-line-surface merging tool (such as Figure 1 As shown in ), library building tools (such as Figure 2 ), conversion tools (such as Figure 3 ), layering tools (such as Figure 4 ). Among them,
[0082] The Merge Point, Line and Area tool can merge the data to be converted into three data types according to the point, line and area layer types, namely Point, Polyline and Polygon;
[0083] The database building tool creates a new data template based on the configuration table of the new data template in SQLite;
[0084] The conversion tool converts the merged point, line, and surface data into new point, line, and surface data according to the code mapping table and field mapping table in SQLite;
[0085] The hierarchical tool generates a new data format based on the hierarchical classification mapping table in SQLite and a new empty data template.
[0086] The present invention selects the national geographic entity conversion project, the Shaanxi Province old and new 10,000 data conversion project, and the Inner Mongolia old and new 10,000 data conversion project to verify the effect of the present invention. As shown in Table 1, using the general data conversion algorithm proposed by the present invention, it only takes less than two minutes to complete the data conversion between any results, greatly improving production efficiency, saving production costs, and better mining the potential value of existing surveying and mapping geographic information data results.
[0087] Table 1
[0088]
[0089] The advantages of the present invention are:
[0090] The universal vector data format conversion model proposed in the present invention can greatly reduce the workload of sorting out related mapping tables, optimize the conversion design ideas of software developers, and reduce the workload of code writing;
[0091] The present invention can adapt to the conversion between all different vector data results, improve the reusability of existing vector result data, and give full play to the value of existing data.
[0092] The conversion model constructed by the present invention is highly replicable, and the conversion between different data specifications only requires replacing the mapping table, and there is almost no need to reconstruct the existing code, thereby improving development efficiency.
[0093] Embodiment 1:
[0094] We select 10,000 plots of Inner Mongolia Autonomous Region to convert old and new data into an example (e.g. Figure 6-8 (shown)
[0095] The old data of Inner Mongolia Autonomous Region at 1:10000 contains 47 feature layers, 88 fields, and m land class codes. The new data contains 39 feature layers, 35 fields, and n land class codes, as shown in Table 2. The land class codes are not listed. Figure 6 The original 1:10000 old data of Inner Mongolia Autonomous Region is required. Figure 7 For the new data of Inner Mongolia Autonomous Region after conversion, Figure 8 To express the intention of the new and old data attributes of some Inner Mongolia Autonomous Region before and after the conversion;
[0096] Table 2 New and old data structure regulations of Inner Mongolia Autonomous Region
[0097]
[0098]
[0099] Embodiment 2:
[0100] Select the country-level geographic entity conversion as an example (such as Figure 9-11 (shown)
[0101] The national standard 1:50000 data stipulates that it contains 34 feature layers, 35 fields, and m land class codes. The national-level geographic entity data stipulates that it contains 39 feature layers, 143 fields, and n land class codes, as shown in Table 3. The land class codes are not listed. Fig. 9 The original old data of the national standard 1:50000 before conversion, Fig.10 is the converted national geographic entity data. Fig.11 Intent is expressed for some of the old and new data attributes before and after the conversion;
[0102] Table 3 New and old data structure regulations for national geographic entities
[0103]
[0104]
[0105] Embodiment 3:
[0106] Take the conversion of old and new data of 10,000 plots in Shaanxi Province as an example (such as Figure 12-14 (shown)
[0107] The old data of Shaanxi Province at 1:10000 contains 26 feature layers, 30 fields, and m land class codes. The new data contains 39 feature layers, 35 fields, and n land class codes, as shown in Table 4. The land class codes are not listed. Fig.12 The original 1:10000 old data of Shaanxi Province is required. Fig.13 For the new data after conversion, Fig.14 This is an indication of the new and old data attributes of some Shaanxi Province before and after the conversion;
[0108] Table 3 New and old data structure of Shaanxi Province 1:10000
[0109]
[0110] After analyzing the above three embodiments, the following conclusions can be drawn:
[0111] The universal vector data format conversion model proposed in the present invention can be applied to the conversion between any two vector data products. It only requires manual creation of coding mapping tables, field mapping tables, and hierarchical classification mapping tables, which can save manpower, material resources, and financial resources to a great extent.
[0112] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A general vector data format conversion method, characterized in that: include: Step S1, pre-conversion data pre-processing: merging the original data in the database before conversion according to the point, line, and surface layer types to obtain a database before conversion containing three layers of point, line, and surface; Step S2, preprocessing of the empty database after conversion: performing the same processing method as the preprocessing of the data before conversion on the empty data template of the empty database after conversion, to obtain the empty database after conversion containing three layers of points, lines and surfaces; Step S3, sorting out relevant mapping tables: including coding mapping table, field mapping table and hierarchical classification mapping table; Step S4, executing database conversion: converting the point, line, and surface layer data in the database before conversion into empty data templates of the point, line, and surface layers in the empty database after conversion, respectively, and converting the ground feature elements and geometric shapes according to the coding mapping table, and filling in the attribute fields of the ground feature elements according to the field mapping table; Step S5, pre-processing after database conversion: including many-to-one, one-to-many, and many-to-many feature conversion for code tables and field names, and data processing for different layer types; Step S6, execute hierarchical classification of the database: hierarchically classify the geographical features of the converted database of point, line and surface layers according to the hierarchical classification mapping table. After all the hierarchical classifications are completed, the point, line and surface layers storing unrecognizable hierarchical classification elements are copied to the converted database for subsequent inspection and modification.
2. The vector data format conversion method according to claim 1, characterized in that: In the step S1, it specifically includes: Read each layer in the database before conversion in turn; add the temporary layer name field temp in turn and assign the layer name; Obtain the absolute paths of point, line, and surface layers in turn and save them in list form; The three lists are merged according to the point, line and surface types to obtain the pre-conversion database after preprocessing; The database before conversion includes three layers: point, line and surface, and each layer includes all the common attribute field names of the sub-layers before conversion.
3. The vector data format conversion method according to claim 1, characterized in that: In step S2, the converted empty database contains all the public attribute field names of the template layer.
4. The vector data format conversion method according to claim 1, characterized in that: In step S3, the hierarchical classification mapping table is the land type code of different land features contained in each layer of points, lines and surfaces.
5. The vector data format conversion method according to claim 1, characterized in that: In the step S5, for the many-to-one, one-to-many, and many-to-many feature conversions of the code table and field names, the temp field and other attribute fields need to be converted; For conversion of different layer types, data processing is required after all data conversion is completed.
6. The vector data format conversion method according to claim 1, characterized in that: In the step S6, it specifically includes: According to the hierarchical classification mapping table, hierarchically classify the land feature elements of the converted database containing points, lines and surfaces according to the hierarchical classification mapping table, and classify one element in each layer, and delete the original element at the same time; After all hierarchical classifications are completed, the point, line, and surface layers storing unrecognizable hierarchical classification elements will be copied to the converted database for subsequent inspection and modification by humans.
7. A universal vector data format conversion system, characterized in that: include: The first preprocessing module is used to merge the original data in the database before conversion according to the point, line and surface layer types to obtain the database before conversion containing the three layers of point, line and surface; A second preprocessing module is used to perform the same processing method as the first preprocessing module on the empty data template of the converted empty database to obtain a converted empty database containing three layers of points, lines and surfaces; Arrangement module, used to arrange the coding mapping table, field mapping table and hierarchical classification mapping table; The conversion module is used to perform database conversion, so that the points, lines and surfaces before conversion are converted into the points, lines and surfaces after conversion respectively, and convert the ground features and geometric shapes according to the coding mapping table, and fill in the attribute fields of the ground features according to the field mapping table; The third preprocessing module is used for many-to-one, one-to-many, and many-to-many feature conversion of code tables and field names, as well as data processing for different layer types; The database hierarchical classification module is used to execute hierarchical classification of the database. It hierarchically classifies the geographical features of the database after the point, line and surface layers are converted according to the hierarchical classification mapping table. After all the hierarchical classifications are completed, the point, line and surface layers storing unrecognizable hierarchical classification features are copied to the converted database.
8. The vector data format conversion system according to claim 7, characterized in that: Each layer in the database before conversion contains all the public attribute field names of the layer before conversion.
9. The vector data format conversion system according to claim 7, characterized in that: Each layer in the converted empty database contains all the public attribute field names of the template layer.
10. The vector data format conversion system according to claim 7, characterized in that: The hierarchical classification mapping table is the land type code of different land features contained in each layer of points, lines and surfaces.