A spatial data file symbolization processing method, device, medium and product
Patent Information
- Application Number
- CN202511899443.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-12-16
AI Technical Summary
[0003]现有的技术方案,需要依赖人工对每一个Shapefile文件(通过ArcGIS)加载后,进行图层属性配置、符号属性配置以及标注属性配置,实际操作过程中,需要先针对当前Shapefile文件建立对应的元素和符号对应关系,进而建立对应的脚本,完成符号样式(颜色、大小、线型、图案)的匹配,再依据图幅显示需求,手动配置不同分级的图层属性和标注样式,当文件数量较多时,存在大量重复性工作,工作量大,工作效率低
本申请提供了一种空间数据文件符号化处理方法、设备、介质及产品,包括获取目标工程的所有.shp格式的空间数据文件和预设的符号化对应表;每一所述空间数据文件包括第一要素类型、文件名称和第一要素对应表,所述第一要素对应表包括若干第一要素,每一所述第一要素对应有第一标识字段和第一字段属性;所述符号化对应表包括第二要素类型、第二标识字段、第二字段属性以及所述第二标识字段对应的预设数据,所述预设数据包括符号样式、标注样式或分级显示范围中的一种或多种;任一目标符号化对应表中的第二标识字段包括所有第一类型的空间数据文件的所有第一标识字段,所述第一类型的空间数据文件是第一要素类型与所述目标符号化对应表的第二要素类型相同的空间数据文件,所述目标符号化对应表是任一所述符号化对应表,通过先预设一个包含类型相同的全部标识字段、字段属性以及对应的预设数据的符号化对应表,再获取最大显示比例尺和最小显示比例尺,基于最大显示比例尺、最小显示比例尺和符号化对应表,创建每一目标空间数据文件对应的一个或多个目标图层模版,并生成一对一的一个或多个文件对,这样,每一个文件对中,都有一个包含第一要素信息和第一标识字段的空间数据文件,和一个包含第二标识字段与预设数据对应关系的图层模版,而由于每一文件对中的文件的第二标识字段包含文件对中文件的第一标识字段,因此,通过数据源替换,能够使第一要素、第一标识字段及其对应的预设数据形成对应关系,这样,每一个空间数据文件中的第一要素都完成了相应的预设数据的对应,即完成了空间数据文件的符号化工作,因此,本方案仅需要预先整理一个包含类型相同的全部标识字段、字段属性以及对应的预设数据的符号化对应表,即可实现创建模图层模版→生成文件对→替换数据源(符号化)的自动化过程,批量完成多个Shapefile的符号化,提高Shapefile的“符号化”工作效率,降低出错率。
Smart Images

Figure CN121638200B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of geographic information processing technology, and in particular to a method, device, medium and product for spatial data file symbolization processing. Background Technology
[0002] Shapefile is the most commonly used and universal vector data format in Geographic Information System (GIS). The "symbolization" of Shapefile is to express vector data (points, lines, and polygons) using visualization methods such as color, size, line type, pattern, and annotation, so as to quickly identify spatial distribution and attribute differences.
[0003] Existing technical solutions require manual configuration of layer attributes, symbol attributes, and annotation attributes for each Shapefile (via ArcGIS). In practice, it is necessary to first establish the correspondence between elements and symbols for the current Shapefile, then create corresponding scripts to match symbol styles (color, size, line type, pattern), and then manually configure layer attributes and annotation styles at different levels according to the map display requirements. When there are many files, there is a lot of repetitive work, resulting in a large workload and low efficiency. Summary of the Invention
[0004] The purpose of this application is to provide a method, device, medium, and product for spatial data file symbolization processing, which can improve the efficiency of "symbolization" of Shapefiles and reduce the error rate.
[0005] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for symbolic processing of spatial data files, including: Obtain all .shp format spatial data files and a preset symbolic mapping table for the target project; each spatial data file includes a first feature type, file name, and a first feature mapping table, the first feature mapping table including several first features, each first feature corresponding to a first identifier field and a first field attribute; the symbolic mapping table includes a second feature type, a second identifier field, a second field attribute, and preset data corresponding to the second identifier field, the preset data including one or more of symbol styles, annotation styles, or hierarchical display ranges; the second identifier field in any target symbolic mapping table includes all first identifier fields of all spatial data files of the first type, the first type of spatial data file being a spatial data file whose first feature type is the same as the second feature type of the target symbolic mapping table, and the target symbolic mapping table being any of the symbolic mapping tables.
[0006] Get the maximum and minimum display scale.
[0007] Based on the maximum display scale, the minimum display scale, and the symbolic correspondence table, one or more target layer templates are created corresponding to each target spatial data file, and each target layer template is named based on the file name of the spatial data file; the target spatial data file is any of the spatial data files, and the target layer template includes a template file in .shp format and a mapping template; the template file includes all second identifier fields and corresponding second field attributes in the symbolic correspondence table of any second feature type, and the mapping template includes the mapping relationship between all second identifier fields in the template file and the preset data.
[0008] Based on the target spatial data file and one or more corresponding target layer templates, one or more file pairs are obtained; each file pair includes a target spatial data file and a target layer template.
[0009] Replace the template file in the target layer template of each file pair with the target spatial data file in the corresponding file pair to obtain the updated target layer template.
[0010] The symbolized file is obtained based on all the updated target layer templates.
[0011] Secondly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the spatial data file symbolization processing method described above.
[0012] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the spatial data file symbolization processing method described above.
[0013] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the spatial data file symbolization processing method described above.
[0014] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a spatial data file symbolization processing method, device, medium, and product, including acquiring all .shp format spatial data files of a target project and a preset symbolization correspondence table; each spatial data file includes a first element type, a file name, and a first element correspondence table, the first element correspondence table including a plurality of first elements, each first element corresponding to a first identifier field and a first field attribute; the symbolization correspondence table includes a second element type, a second identifier field, a second field attribute, and preset data corresponding to the second identifier field, the preset data including one or more of symbol styles, annotation styles, or hierarchical display ranges; the second identifier field in any target symbolization correspondence table includes all first identifier fields of all spatial data files of the first type, the first type of spatial data file being a spatial data file whose first element type is the same as the second element type of the target symbolization correspondence table, the target symbolization correspondence table being any of the symbolization correspondence tables, by first presetting a symbolization correspondence table containing all identifier fields, field attributes, and corresponding preset data of the same type, and then acquiring the maximum display scale and minimum display scale. Based on the maximum and minimum display scales and a symbolic correspondence table, this method creates one or more target layer templates corresponding to each target spatial data file, generating one-to-one file pairs. Each file pair contains a spatial data file with first feature information and a first identifier field, and a layer template with a second identifier field corresponding to preset data. Since the second identifier field of each file pair contains the first identifier field of the file in the pair, data source replacement allows the first feature, the first identifier field, and their corresponding preset data to form a correspondence. Thus, the first feature in each spatial data file completes the corresponding preset data correspondence, completing the symbolic work of the spatial data file. Therefore, this solution only requires pre-compiling a symbolic correspondence table containing all identifier fields, field attributes, and corresponding preset data of the same type to automate the process of creating layer templates → generating file pairs → replacing data sources (symbolization). This allows for batch symbolication of multiple Shapefiles, improving the efficiency of Shapefile symbolication and reducing the error rate. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1This is an application environment diagram of a spatial data file symbolization processing method according to an embodiment of this application; Figure 2 A flowchart illustrating a spatial data file symbolization processing method provided in an embodiment of this application; Figure 3 This is a schematic diagram of an initialization parameter configuration interface provided in an embodiment of this application; Figure 4 This is a core processing logic diagram of an SQL query optimization algorithm provided in an embodiment of this application; Figure 5 A diagram showing the running results of an enhanced report generation algorithm provided in an embodiment of this application; Figure 6 An illustration corresponding to a symbolized spatial data file provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application.
[0017] Attached image labels: 102 terminal, 104 server. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0019] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0020] The spatial data file symbolization processing method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on another server. Terminal 102 can send all .shp format spatial data files of the target project to be processed, along with a preset symbolic mapping table, and the maximum and minimum display scales, to server 104. Upon receiving these data, server 104 creates one or more target layer templates corresponding to each target spatial data file based on the maximum and minimum display scales and the symbolic mapping table. Each target layer template is named based on the filename of the spatial data file. One or more file pairs are obtained based on the target spatial data file and its corresponding target layer template. The template file in each file pair is replaced with the target spatial data file in the corresponding file pair, resulting in an updated target layer template. Symbolicated files are obtained based on all updated target layer templates. Server 104 can then send the obtained symbolicated files back to terminal 102. In addition, in some embodiments, the spatial data file symbolization processing method can also be implemented separately by the server 104 or the terminal 102. For example, the terminal 102 can directly obtain all .shp format spatial data files of the target project to be processed and the preset symbolization correspondence table, as well as the maximum display scale and the minimum display scale, and perform spatial data file symbolization processing. Alternatively, the server 104 can obtain all .shp format spatial data files of the target project to be processed and the preset symbolization correspondence table, as well as the maximum display scale and the minimum display scale, from the data storage system and perform spatial data file symbolization processing.
[0021] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, and smart in-vehicle devices. Portable wearable devices can include smartwatches, smart bracelets, and head-mounted devices. The server 104 can be implemented using a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.
[0022] In one exemplary embodiment, such as Figure 2 As shown, a spatial data file symbolization processing method is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes steps 100 to 600. Wherein: Step 100: Obtain all .shp format spatial data files and a preset symbolic mapping table for the target project; each spatial data file includes a first feature type, file name, and a first feature mapping table, the first feature mapping table includes several first features, each first feature corresponds to a first identifier field and a first field attribute; the symbolic mapping table includes a second feature type, a second identifier field, a second field attribute, and preset data corresponding to the second identifier field, the preset data includes one or more of symbol styles, annotation styles, or hierarchical display ranges; the second identifier field in any target symbolic mapping table includes all first identifier fields of all spatial data files of the first type, the spatial data files of the first type are spatial data files whose first feature type is the same as the second feature type of the target symbolic mapping table, and the target symbolic mapping table is any of the symbolic mapping tables.
[0023] Step 200: Obtain the maximum and minimum display scales.
[0024] Step 300: Based on the maximum display scale, the minimum display scale, and the symbolic correspondence table, create one or more target layer templates corresponding to each target spatial data file, and name each target layer template based on the file name of the spatial data file; the target spatial data file is any of the spatial data files, and the target layer template includes a template file in .shp format and a mapping template; the template file includes all second identifier fields and corresponding second field attributes in the symbolic correspondence table of any second feature type, and the mapping template includes the mapping relationship between all second identifier fields in the template file and the preset data.
[0025] Step 400: Based on the target spatial data file and one or more corresponding target layer templates, obtain one or more file pairs; the file pair includes one target spatial data file and one target layer template.
[0026] Step 500: Replace the template file in the target layer template of each file pair with the target spatial data file in the corresponding file pair to obtain the updated target layer template.
[0027] Step 600: Obtain the symbolized file based on all the updated target layer templates.
[0028] As one implementation method, the first element type of the spatial data file is any one of point, line, and polygon, and the second element type of the symbolic correspondence table is any one of point, line, and polygon. For a target project, three preset symbolic correspondence tables are generally required, namely the point symbolic correspondence table, the line symbolic correspondence table, and the polygon symbolic correspondence table, with the corresponding second element types being point, line, and polygon, respectively.
[0029] The target project generally includes several spatial data files with points as the first feature type, several spatial data files with lines as the first feature type, and several spatial data files with surfaces as the first feature type.
[0030] The first element, first identifier field, and first field attribute in the first element correspondence table have a one-to-one relationship. The first identifier field is divided into three types according to its first field attribute: symbol attribute, annotation attribute, and hierarchical attribute. The first identifier field of the symbol attribute indicates that the corresponding first element needs to match the symbol style in the symbol database. The first identifier field of the annotation attribute indicates that the corresponding first element needs to match the annotation style in the annotation database. The first identifier field of the hierarchical attribute is used to indicate the hierarchical display range of the corresponding first element. For example, the first element is displayed in levels 1-3 and not displayed in other levels. The division of levels is generally determined according to project requirements and in combination with the maximum and minimum display scales.
[0031] The point symbolization correspondence table contains the first identifier field of all spatial data files whose first feature type is point and its correspondence with the corresponding preset data. The line symbolization correspondence table contains the first identifier field of all spatial data files whose first feature type is line and its correspondence with the corresponding preset data. The polygon symbolization correspondence table contains the first identifier field of all spatial data files whose first feature type is polygon and its correspondence with the corresponding preset data.
[0032] The first element of the same .shp format spatial data file may be displayed in multiple display levels (i.e., differential display). Therefore, multiple target layer templates are created for the same .shp format spatial data file. Each layer template is used to process symbolization for different display levels. Each target layer template and each target spatial data file form a pair of files. By replacing and updating the data source, the symbolization of a .shp format spatial data file for one display level is completed. After all layer templates are updated, all symbolized files of the target project are obtained.
[0033] By implementing steps 100 to 600 above, a symbolic correspondence table containing all identifier fields, field attributes, and corresponding preset data of the same type is first preset. Then, the maximum and minimum display scales are obtained. Based on the maximum and minimum display scales and the symbolic correspondence table, several target layer templates corresponding to each target spatial data file are created, and several one-to-one file pairs are generated. Thus, each file pair contains a spatial data file containing the first feature information and the first identifier field, and a layer template containing the correspondence between the second identifier field and the preset data. Since the second identifier field of the file in each file pair contains the file in the file pair... The first identifier field is used to establish a correspondence between the first element, the first identifier field, and their corresponding preset data through data source replacement. In this way, the first element in each spatial data file completes the correspondence with the corresponding preset data, thus completing the symbolization of the spatial data file. Therefore, this solution only needs to prepare a symbolic correspondence table containing all identifier fields, field attributes, and corresponding preset data of the same type in advance to automate the process of creating a template layer → generating file pairs → replacing the data source (symbolization), batch completing the symbolization of multiple Shapefiles, improving the efficiency of the "symbolization" of Shapefiles, and reducing the error rate.
[0034] In another exemplary embodiment of this application, before step 100, a process for initializing parameter configuration is further included, specifically including: Input is received through the Toolbox parameter interface, eliminating the need for command-line interaction.
[0035] Parameter 0: Workspace path (workspace_dir, string, optional; defaults to the MXD directory).
[0036] Parameter 1: Reference table file (styles_csv_path, string, optional; used to create a reference table, defaults to the styles.csv file in the workspace path).
[0037] Parameter 2: Processing order configuration file (order_csv_path, string, optional; used to arrange the rendering order, defaults to process_order.csv in the workspace path).
[0038] Parameter 3: Template path (template_dir, string, optional; used to determine the template folder path, the default is a folder named "template" under the workspace path).
[0039] like Figure 3 The image shown is the configuration interface corresponding to this embodiment.
[0040] In another exemplary embodiment of this application, the method for obtaining the preset symbolic mapping table involved in step 100 includes: Based on one or more of national standards, industry standards, and industry technical documents, multiple second element types, second identifier fields, second field attributes, and preset data corresponding to each second identifier field are obtained.
[0041] Multiple symbolic correspondence tables are established based on the second element type, including point symbol correspondence tables, line symbol correspondence tables, and area symbol correspondence tables.
[0042] This embodiment applies to standard engineering projects, where all symbolization requirements conform to national or industry standards and other industry technical documents. The symbolization correspondences in these documents are compiled into a standard database (symbolization correspondence table) for direct application when facing different projects, eliminating the need for repetitive design or compilation and greatly reducing the symbolization workload of standard engineering projects.
[0043] In another exemplary embodiment of this application, the method for obtaining the preset symbolic mapping table involved in step 100 includes: Obtain all .shp format spatial data files of the target project, and based on project requirements, a preset style database, and the spatial data files, obtain multiple second element types, second identifier fields, second field attributes, and preset data corresponding to each second identifier field.
[0044] Based on the second element type, multiple symbolic correspondence tables are established; the symbolic correspondence tables include point symbol correspondence tables, line symbol correspondence tables, and area symbol correspondence tables.
[0045] This embodiment is applicable to non-standard engineering projects. Before performing symbolization, all spatial data files with .shp format are traversed to organize the correspondence between all the identification fields and specific styles of the current engineering project, so as to facilitate automated operation on each spatial data file in the future.
[0046] In another exemplary embodiment of this application, in the symbolization correspondence table, when the second field attribute is a symbol, the preset data is a symbol style; when the second field attribute is a label, the preset data is a label style; when the second field attribute is hierarchical display, the preset data is a hierarchical display range.
[0047] In another exemplary embodiment of this application, step 300, which involves creating one or more target layer templates corresponding to each target spatial data file based on the maximum display scale, the minimum display scale, and the symbolic correspondence table, and naming each target layer template based on the file name of the spatial data file, specifically includes: The total number of display levels is determined based on the maximum display scale and the minimum display scale.
[0048] For any target spatial data file, obtain all the first field attributes of the target spatial data file that are hierarchical first identifier fields, and determine the number k of target layer templates corresponding to the target spatial data file based on all the first field attributes of the target spatial data file and the total number of display levels.
[0049] Based on the symbolic correspondence table, k target layer templates are created.
[0050] Based on the file name of the target spatial data file, k target layer templates are named; the names of the k target layer templates are all different, and all include the file name of the target spatial data file.
[0051] As one implementation method, for example, for a target project, the number of display levels is determined to be ten levels by using the maximum display scale and the minimum display scale.
[0052] For a target spatial data file road.shp, by obtaining all first field attributes of road.shp that are hierarchical first identifier fields, it is determined that all first features of the target spatial data file road.shp only involve the display of levels 1-5. Therefore, 5 target layer templates are created and named road_1.lyr, road_2.lyr, road_3.lyr, road_4.lyr, and road_5.lyr respectively. The name includes two parts: the prefix is the same as the name of the target spatial data file road.shp, which is "road", and the suffix is the content generated based on custom rules.
[0053] In another exemplary embodiment of this application, for the creation of file pairs, for example, by traversing the target project, two Shape files are obtained: road.shp and lake_china.shp.
[0054] Four layer templates were generated: road_highway.lyr (corresponding to road.shp, highway style), road_street.lyr (corresponding to road.shp, street style), lake_china_1w.lyr (corresponding to lake_china.shp, lake display in 1:10,000 scale), and lake_china_10w.lyr (corresponding to lake_china.shp, lake display in 1:100,000 scale).
[0055] Generate four file pairs, namely: File pair 1 includes the road.shp file and the road_highway.lyr layer template.
[0056] File pair 2 includes the road.shp file and the road_street.lyr layer template.
[0057] File pair 3 includes the lake_china.shp file and the lake_china_1w.lyr layer template.
[0058] File pair 4 includes the lake_china.shp file and the lake_china_10w.lyr layer template.
[0059] In another exemplary embodiment of this application, step 500 involves replacing the template file in the target layer template of each file pair with the target spatial data file in the corresponding file pair. Specifically, the operation is as follows: For each file pair, load the layer template file in the file pair, and use ArcPy's replace DataSource method to replace the data source (template file) in the target layer template file with the path of the target spatial data file (Shape file) in the file pair.
[0060] Fault tolerance mechanism: First, attempt a normalized path replacement: `new_layer.replaceDataSource(norm_shp_dir, "SHAPEFILE_WORKSPACE", shp_base_name_only, False)`. If normalized path replacement fails, try the `find And Replace Workspace Path` method. This method supports Unicode encoding and cross-platform path handling.
[0061] In another exemplary embodiment of this application, step 600, which involves obtaining the symbolized file based on all the updated target layer templates, specifically includes: Step 601: Filter and repair the updated target layer template to obtain a filtered and repaired target layer template.
[0062] Step 602: Obtain the preset sorting rules.
[0063] Step 603: Based on the preset sorting rules and the names of all the filtered and repaired target layer templates, obtain the sorting weight of the filtered and repaired target layer templates.
[0064] Step 604: Sort all the filtered and repaired target layer templates based on the sorting weight to obtain the symbolized file.
[0065] As one implementation, step 602 includes: reading the process_order.csv configuration file to obtain the sorting rules.
[0066] Step 603 includes matching the folder name with the name of the target layer template after filtering and repair to obtain the sorting weight.
[0067] Step 604 includes: Step 6041: Sort the repaired target layer templates according to their weight values from smallest to largest.
[0068] Step 6042: Use arcpy.mapping.RemoveLayer and arcpy.mapping.AddLayer to reorganize the order of the repaired target layer templates.
[0069] Step 6043: Save the MXD document using mxd.saveACopy(mxd_save_path, "10.1").
[0070] Step 6044, set relative paths: mxd.relativePaths = True.
[0071] Step 6045: Generate a lookup table containing information such as processing status, number of records, and SQL queries.
[0072] Step 6046: Use pandas to export a statistical report in Excel or CSV format.
[0073] In another exemplary embodiment of this application, step 601, which involves filtering and repairing the updated target layer template, specifically includes: For any of the updated target layer templates, perform the following operations: Step 6011: Check whether the target data source contains a first target field or a second target field; the target data source is all the first identifier fields in the .shp format spatial data file in the updated target layer template; the first target field and the second target field are the fields in the first identifier field whose first field attribute is hierarchical display.
[0074] Step 6012: When the target data source does not have a first target field and does not have a second target field, remove the updated target layer template.
[0075] When the target data source contains a first target field, perform a first operation on any of the first target fields.
[0076] When the target data source contains a second target field, perform a second operation on any of the second target fields.
[0077] The first operation includes: When the target first element is empty, remove the first target field and the target first element; the target first element is the first element corresponding to the first target field in the target data source.
[0078] When the first target element is not empty, the preset data corresponding to the first target field is repaired based on the first target element.
[0079] The second operation includes: When the target second element is empty, remove the second target field and the target second element; the target second element is the second element corresponding to the second target field in the target data source.
[0080] In another exemplary embodiment of this application, the first target field involved in step 6011 includes GB, and the second target field includes CLASS.
[0081] In this embodiment, an SQL query optimization algorithm is used to automatically detect and repair referencing errors in layer definition queries, and to handle query failures after data source changes. Multi-pattern regular expressions are used to parse the SQL statement structure, a query statement reconstruction algorithm is developed, supporting single-value conversion and statement optimization, integrating special processing logic for annotation layers, and automatically cleaning up invalid field conditions. For example... Figure 4 The diagram shows the core processing logic in the SQL query optimization algorithm.
[0082] In another exemplary embodiment of this application, an enhanced report generation algorithm is also included to generate detailed processing reports and quality analysis reports, supporting multiple output formats. Success rates, processing times, quality issues, etc., are statistically analyzed by folder grouping, and key indicators such as processing speed, peak memory usage, and error distribution are calculated to facilitate troubleshooting after errors occur.
[0083] like Figure 5 The image shown is a graph illustrating the results of the enhanced report generation algorithm.
[0084] like Figure 6 The image shown is an illustration corresponding to the symbolized spatial data file.
[0085] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 7 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database is used for spatial data file symbolization processing. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a spatial data file symbolization processing method.
[0086] Those skilled in the art will understand that Figure 7 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0087] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0088] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0089] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0090] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0091] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0092] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0093] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for symbolic processing of spatial data files, characterized in that, The spatial data file symbolization processing method includes: Obtain all .shp format spatial data files and a preset symbolic mapping table for the target project; each spatial data file includes a first feature type, file name, and a first feature mapping table, the first feature mapping table including several first features, each first feature corresponding to a first identifier field and a first field attribute; the symbolic mapping table includes a second feature type, a second identifier field, a second field attribute, and preset data corresponding to the second identifier field, the preset data including one or more of symbol styles, annotation styles, or hierarchical display ranges; the second identifier field in any target symbolic mapping table includes all first identifier fields of all spatial data files of the first type, the first type of spatial data file being a spatial data file whose first feature type is the same as the second feature type of the target symbolic mapping table, and the target symbolic mapping table being any of the symbolic mapping tables; Get the maximum and minimum display scale; Based on the maximum display scale, the minimum display scale, and the symbolic correspondence table, one or more target layer templates are created corresponding to each target spatial data file, and each target layer template is named based on the file name of the spatial data file; the target spatial data file is any of the spatial data files, and the target layer template includes a template file in .shp format and a mapping template; the template file includes all second identifier fields and corresponding second field attributes in the symbolic correspondence table of any second feature type, and the mapping template includes the mapping relationship between all second identifier fields in the template file and the preset data; Based on the target spatial data file and one or more corresponding target layer templates, one or more file pairs are obtained; each file pair includes a target spatial data file and a target layer template. Replace the template file in the target layer template of each file pair with the target spatial data file in the corresponding file pair to obtain the updated target layer template; The symbolized file is obtained based on all the updated target layer templates; Specifically, based on the maximum display scale, the minimum display scale, and the symbolic correspondence table, one or more target layer templates are created corresponding to each target spatial data file, and each target layer template is named based on the file name of the spatial data file, including: The total number of display levels is determined based on the maximum display scale and the minimum display scale. For any target spatial data file, obtain all first identifier fields whose first field attribute is hierarchical in the target spatial data file, and determine the number k of target layer templates corresponding to the target spatial data file based on all first identifier fields whose first field attribute is hierarchical and the total number of display levels; Based on the symbolic correspondence table, create k target layer templates; Based on the file name of the target spatial data file, k target layer templates are named; the names of the k target layer templates are all different, and all include the file name of the target spatial data file.
2. The spatial data file symbolization processing method according to claim 1, characterized in that, The method for obtaining the preset symbolic mapping table includes: Based on one or more of national standards, industry standards, and industry technical documents, multiple second element types, second identifier fields, second field attributes, and preset data corresponding to each second identifier field are obtained. Multiple symbolic correspondence tables are established based on the second element type, including a point symbol correspondence table, a line symbol correspondence table, and a surface symbol correspondence table; or, Obtain all .shp format spatial data files of the target project, and based on project requirements, a preset style database and the spatial data files, obtain multiple second feature types, second identifier fields, second field attributes, and preset data corresponding to each second identifier field; Based on the second element type, multiple symbolic correspondence tables are established; the symbolic correspondence tables include point symbol correspondence tables, line symbol correspondence tables, and area symbol correspondence tables.
3. The spatial data file symbolization processing method according to claim 1, characterized in that, In the symbolization correspondence table, when the second field attribute is "symbol", the preset data is the symbol style; when the second field attribute is "label", the preset data is the label style; when the second field attribute is "hierarchical display", the preset data is the hierarchical display range.
4. The spatial data file symbolization processing method according to claim 1, characterized in that, The symbolized file is obtained based on all the updated target layer templates, specifically including: The updated target layer template is then filtered and repaired to obtain a filtered and repaired target layer template. Get the preset sorting rules; Based on the preset sorting rules and the names of all the filtered and repaired target layer templates, the sorting weight of the filtered and repaired target layer templates is obtained. Based on the sorting weight, all the filtered and repaired target layer templates are sorted to obtain the symbolized file.
5. The spatial data file symbolization processing method according to claim 4, characterized in that, The updated target layer template is then filtered and repaired, specifically including: For any of the updated target layer templates, perform the following operations: Check whether the target data source contains a first target field or a second target field; the target data source is all the first identifier fields in the .shp format spatial data file in the updated target layer template; the first target field and the second target field are the fields in the first identifier field whose first field attribute is hierarchical display; When the target data source does not contain a first target field and does not contain a second target field, the updated target layer template is removed. When the target data source contains a first target field, perform the first operation on any of the first target fields; When the target data source contains a second target field, perform the second operation on any of the second target fields; The first operation includes: When the target first element is empty, remove the first target field and the target first element; the target first element is the first element corresponding to the first target field in the target data source. When the first target element is not empty, the preset data corresponding to the first target field is repaired based on the first target element. The second operation includes: When the target second element is empty, remove the second target field and the target second element; the target second element is the second element corresponding to the second target field in the target data source.
6. The spatial data file symbolization processing method according to claim 5, characterized in that, The first target field includes GB, and the second target field includes CLASS.
7. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the spatial data file symbolization processing method according to any one of claims 1-6.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the spatial data file symbolization processing method according to any one of claims 1-6.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the spatial data file symbolization processing method according to any one of claims 1-6.
Citation Information
Patent Citations
Geological spatial data processing method and device and electronic equipment
CN116185628A
Customized emergency map symbol template webgis-based display method and device
WO2020135586A1