A python language-based automatic administrative boundary fusion mapping method and a meteorological mapping method

By using an automated administrative boundary fusion mapping method based on the Python language, the problems of cross-scale accuracy loss and manual dependence in traditional meteorological mapping are solved. It achieves seamless connection and efficient interpolation across hierarchical boundaries, improves the accuracy and efficiency of meteorological mapping, and ensures the consistency and reproducibility of results.

CN121685759BActive Publication Date: 2026-11-27ZHONGNONG SUNSHINE (JILIN PROVINCE) BIG DATA GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511847690.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-11-27
Estimated Expiration
2045-12-09

AI Technical Summary

Technical Problem

Traditional meteorological mapping methods are prone to loss of accuracy when converting between scales, have large interpolation errors in complex terrain areas, rely on manual operation, have low efficiency and low automation, and commercial software is difficult to adapt to personalized needs. The automation level of multi-scale color patch maps is also insufficient.

Method used

An automated administrative boundary fusion mapping method based on Python is adopted. Through multi-format data loading, topological relationship repair and optimization, multi-level boundary fusion, and intelligent matching analysis, it achieves seamless connection and efficient interpolation of cross-level boundaries, eliminates boundary overlap or breakage, and improves mapping efficiency and result consistency.

Benefits of technology

It achieves seamless integration of cross-level boundary data, improves the accuracy and efficiency of meteorological mapping, ensures the consistency and reproducibility of results, solves the problems of frequent and inefficient manual intervention in traditional methods, and realizes full automation from data cleaning to mapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121685759B_ABST
    Figure CN121685759B_ABST
Patent Text Reader

Abstract

The application discloses a kind of python language-based automated administrative boundary fusion mapping method and meteorological mapping method, belongs to meteorological mapping technical field, specifically relates to meteorological data processing and geographic information system visualization cross technical field.From the construction of multi-scale adaptive boundary fusion mapping, to solve the problem of cross-scale (such as province to village) precision fault and complex terrain interpolation error, realize the seamless aggregation technology of cross-level administrative division boundary (village level→township level→county level→province level), so as to solve the problem of losing precision when cross-scale conversion (for example, from province to village) is carried out in meteorological mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of meteorological mapping technology, specifically involving the interdisciplinary field of meteorological data processing and geographic information system visualization. Background Technology

[0002] Meteorological mapping, as the core carrier of meteorological data visualization, directly supports meteorological research, disaster early warning and response, and agricultural production regulation. Its accuracy and efficiency play a decisive role in the scientific validity and feasibility of related decisions. From a technical perspective, Python, with its rich scientific computing ecosystem, offers advantages such as flexible customization, high automation (reducing manual intervention, improving efficiency, and ensuring accuracy), and adaptability to multiple workflows, making it the preferred tool for meteorological data processing. At the research level, the integration of automated optimization techniques and interpolation algorithms (e.g., using machine learning to assist in algorithm selection and parameter optimization) has become a popular direction in the field of meteorological data processing. However, due to the lack of multi-scale adaptability and a complete Python technology chain, it is difficult to meet actual business needs.

[0003] Traditional meteorological mapping has limitations in terms of both overall structure and workflow: its workflow is based on a single scale design, and it is prone to loss of accuracy when performing cross-scale transformations (e.g., from province to village); in complex terrain areas, interpolation errors are large due to station distribution issues. Furthermore, this method is highly dependent on manual labor; algorithm selection and parameter tuning rely heavily on experience, and the extensive manual operations during multi-scale mapping lead to low efficiency, poor consistency of results, and cumbersome and unreproducible large-scale data processing. Additionally, manual cropping of administrative boundaries on color patches is time-consuming, error-prone, and skill-dependent; scale changes increase the difficulty and risk, and there is a lack of automation mechanisms.

[0004] Significant shortcomings exist in tools, algorithms, and research: Commercial software, limited by preset template parameters, struggles to adapt to personalized mapping needs, resulting in low automation levels for batch multi-scale color patch mapping. Mainstream interpolation algorithms each have their drawbacks (Kriging is parameter-sensitive, inverse distance weighting has low accuracy in sparse regions, and radial basis function methods are computationally expensive). Traditional processes lack scientific evaluation when selecting algorithms, relying on manual parameter tuning, and Python has failed to overcome automation bottlenecks. Current research on automated optimization lacks multi-scale adaptation and a complete Python chain, making practical implementation difficult. Summary of the Invention

[0005] This invention starts with constructing a multi-scale adaptive boundary fusion mapping system to solve the problems of accuracy discontinuity across scales (such as from province to village) and large interpolation errors in complex terrain. It realizes a seamless aggregation technology of administrative boundaries across levels (village level → township level → county level → province level), thereby solving the problem of easy loss of accuracy when performing cross-scale conversions (such as from province to village) in meteorological mapping.

[0006] The first aspect of this invention provides an automated administrative boundary fusion mapping method based on the Python language, comprising the following steps: S1. Receive multi-level administrative boundary vector data containing Shapefile, GeoJSON and JSON file formats, perform data loading and format unification processing, and obtain standardized data with a unified coordinate system. S2. Perform topological relationship repair and optimization on the standardized data generated in step S1 to achieve intelligent segmentation and redistribution of overlapping areas, thereby obtaining topologically consistent and seamless boundary data without overlap. S3. Perform multi-level administrative boundary fusion processing on the topology optimization data generated in step S2 to obtain seamless multi-level administrative boundary data; S4. Receive the fused boundary data obtained in step S3, perform multi-strategy intelligent matching analysis, and obtain a Shapefile file that can be used for meteorological mapping.

[0007] Furthermore, in step S1, the data loading and format standardization process includes: Multi-format vector data loading: The Fiona database is used as the underlying driving engine, and an adaptive data loader is built in combination with the Geopandas database; the format detection algorithm identifies the multi-source vector data formats of multi-level administrative boundaries, including Shapefile files, GeoJSON files and JSON files; Intelligent coordinate recognition and transformation: The PyProj library is used to realize coordinate system transformation, and various input data are uniformly converted into the WGS84 coordinate system; Data quality check: To address data quality issues, a geometric validity verification algorithm based on Shapely is used to automatically repair invalid geometric objects using the buffer(0) method, thereby obtaining standardized data with a unified coordinate system.

[0008] Furthermore, in step S2, the topology repair and optimization process includes: Gap Detection and Stitching: A gap detection algorithm based on R-tree spatial indexing is used to identify gap regions by constructing a boundary line network and applying line string polygonization technology. For the detected gaps, an adaptive buffer stitching algorithm is used to dynamically adjust the stitching parameters according to the gap size. Overlapping region denoising: Shapely overlay analysis technology is used to detect overlapping regions. A priority conflict resolution mechanism is constructed, and priority weights are assigned to each administrative boundary element. The weights are determined comprehensively based on administrative level, data source reliability, and data timeliness. The ownership of overlapping regions is determined through the priority conflict resolution mechanism. High-priority elements are retained in overlapping regions, while low-priority elements are removed from overlapping regions. The Voronoi region segmentation algorithm is used to construct a Voronoi diagram with the center point of the overlapping region as the seed point. The overlapping regions are intelligently segmented and redistributed to obtain topologically consistent and seamless boundary data without overlap.

[0009] Furthermore, in step S3, the hierarchical administrative boundary fusion processing includes: Topology Preservation: Construct a hierarchical fusion engine based on Geopandas Dissolve, and use the topology preservation algorithm to ensure boundary continuity during the fusion process; Boundary fusion: The dissolve processing method is used for boundary fusion. During the fusion process, memory block technology is used. Each data block is fused sequentially from township to county level and from county to province level. A parallel processing framework is built based on the Multiprocessing library to distribute multiple provincial data blocks to different processing processes. Each process independently completes the step-by-step fusion. Finally, the results are merged and summarized to obtain a seamless multi-level administrative boundary dataset.

[0010] Furthermore, in step S4, the multi-strategy intelligent matching analysis includes: Code matching: Standardize administrative codes by converting text codes into numeric codes; construct the standard administrative code library into a Python dictionary structure, traverse the data source to be matched, and perform batch matching; perform bidirectional verification of the matching results, and resolve conflicts when one-to-many or many-to-one matching occurs; Name fuzzy matching: Based on the Levenstein distance, string similarity is calculated by determining the minimum number of single-character edit operations required to convert one string into another, converting the edit distance into a similarity score between 0 and 1, and determining a match by setting a threshold; Spatial relationship matching: The BallTree algorithm is used to perform nearest neighbor search and spatial inclusion analysis on the coordinate positions of the merged administrative boundaries and external spatial elements to locate the administrative regions to which they belong and determine which administrative region these elements fall within, thereby achieving intelligent optimization of the matching results.

[0011] A second aspect of this invention provides an automated meteorological mapping method based on the Python language. This method is performed on the Python language platform and includes the following steps: Step 1: Read meteorological data in CVS format, set layer control parameters, and load Shapefile data of multi-level administrative boundaries according to the set layers; Step 2: Create a regular network coordinate system and generate gridded meteorological element data based on the optimal interpolation algorithm for the data; Step 3: Create a PlateCarree projected coordinate system, set the coordinate axis format, and configure the coordinate axis labels and tick styles; Step 4: For the Shapefile data of multi-level administrative boundaries, use an automated administrative boundary fusion mapping method based on Python to obtain Shapefile files for meteorological mapping. Based on the Shapefile files for meteorological mapping, add administrative boundaries hierarchically. Step 5: Draw the color patch map, add the necessary map elements, whiten the administrative boundaries, and output the meteorological map in image format.

[0012] Furthermore, the data optimization interpolation algorithm is as follows: Algorithm switching based on spatial scale and terrain complexity indicators: in small-scale regions Automatically enable Kriging interpolation; in large-scale regions Automatically enable RBF radial basis function; introduce elevation correction factor to optimize interpolation results in terrain undulation areas.

[0013] Furthermore, the whitening process for administrative boundaries involves: applying gradient processing to boundary pixels using an anti-aliasing algorithm to construct a color transition zone between the boundary and the color patch area; calculating the color difference between adjacent pixels on the boundary line; and adjusting the pixel brightness and saturation of the transition zone to create a continuous gradient effect between the administrative boundary line and the surrounding meteorological element color patches, thereby eliminating visual discontinuities and jagged edges.

[0014] The beneficial effects of the administrative boundary fusion mapping method described in this invention are as follows: It innovates a cross-level boundary fusion method, eliminates compatibility differences in boundary data of different administrative levels, avoids boundary overlap or breakage problems, and improves the accuracy of meteorological elements and administrative regions overlay display; it overcomes the problems of fragmented traditional mapping processes and frequent manual intervention, and realizes unattended operation from data cleaning to map export, significantly improving mapping efficiency while ensuring the consistency and reproducibility of results.

[0015] The beneficial effects of the automated meteorological mapping method described in this invention are: it solves technical problems such as optimizing spatial interpolation accuracy, adaptive handling of administrative boundaries, and improving the efficiency of automated processes in meteorological mapping, and realizes an automated closed loop of "data input - intelligent processing - high-precision output". Attached Figure Description

[0016] Figure 1This is a flowchart of the administrative boundary fusion mapping method described in this embodiment of the invention; Figure 2 This is a flowchart of the automated meteorological mapping method described in this embodiment of the invention. Detailed Implementation

[0017] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.

[0018] Example 1 This embodiment provides an automated administrative boundary fusion mapping method based on the Python language, such as... Figure 1 As shown, it includes the following steps: Step 1: Receive multi-level administrative boundary vector data containing Shapefile, GeoJSON, and JSON file formats, perform data loading and format unification processing to obtain standardized data with a unified coordinate system.

[0019] Data loading and format standardization processing includes: Multi-format vector data loading: The Fiona database is used as the underlying driving engine, and an adaptive data loader is built in combination with the Geopandas database; the format detection algorithm identifies the multi-source vector data formats of multi-level administrative boundaries, including Shapefile files, GeoJSON files and JSON files; Intelligent coordinate recognition and transformation: The PyProj library is used to realize coordinate system transformation, and various input data are uniformly converted into the WGS84 coordinate system; Data quality check: To address data quality issues, a geometric validity verification algorithm based on Shapely is used to automatically repair invalid geometric objects using the buffer(0) method, thereby obtaining standardized data with a unified coordinate system.

[0020] Step 2: Perform topological relationship repair and optimization on the standardized data generated in Step 1 to achieve intelligent segmentation and redistribution of overlapping areas, thereby obtaining topologically consistent and seamless, non-overlapping boundary data.

[0021] Topology repair and optimization processes include: Gap Detection and Stitching: A gap detection algorithm based on R-tree spatial indexing is used to identify gap regions by constructing a boundary line network and applying line string polygonization technology. For the detected gaps, an adaptive buffer stitching algorithm is used to dynamically adjust the stitching parameters according to the gap size. Overlapping region denoising: Shapely overlay analysis technology is used to detect overlapping regions. A priority conflict resolution mechanism is constructed, and priority weights are assigned to each administrative boundary element. The weights are determined comprehensively based on administrative level, data source reliability, and data timeliness. The ownership of overlapping regions is determined through the priority conflict resolution mechanism. High-priority elements are retained in overlapping regions, while low-priority elements are removed from overlapping regions. The Voronoi region segmentation algorithm is used to construct a Voronoi diagram with the center point of the overlapping region as the seed point. The overlapping regions are intelligently segmented and redistributed to obtain topologically consistent and seamless, non-overlapping boundary data.

[0022] Step 3: Perform multi-level administrative boundary fusion processing on the topology optimization data generated in Step 2 to obtain seamlessly connected multi-level administrative boundary data.

[0023] The process of integrating hierarchical administrative boundaries includes: Topology Preservation: Construct a hierarchical fusion engine based on Geopandas Dissolve, and use the topology preservation algorithm to ensure boundary continuity during the fusion process; Boundary fusion: The dissolve processing method is used for boundary fusion. During the fusion process, memory block technology is used, that is, the township-level administrative boundary data is divided into multiple data blocks according to the provincial administrative division code. Each data block is fused sequentially from township to county level and from county to province level. A parallel processing framework is built based on the Multiprocessing library, which distributes multiple provincial data blocks to different processing processes. Each process independently completes the step-by-step fusion (fusion from lower level B to higher level A), that is, the two-level fusion operation of "township → county level" and "county level → province level". Finally, the results are uniformly summarized by the result merging module to obtain a seamless multi-level administrative boundary dataset.

[0024] Step 4: Receive the fused boundary data obtained in Step 3, perform multi-strategy intelligent matching analysis, and obtain a Shapefile file that can be used for meteorological mapping.

[0025] Multi-strategy intelligent matching analysis includes: Code matching: Administrative code standardization is performed, mapping historical versions of administrative division codes to the latest versions. Text codes (such as "Beijing-Haidian District") are converted into numeric codes (110108), and missing administrative codes are filled in. Higher-level codes are derived from lower-level administrative division codes. An efficient and accurate matching algorithm based on hash tables is used to construct the standard administrative code library into a Python dictionary structure, traversing the data source to be matched and performing batch accurate matching. The matching results are verified bidirectionally. When one-to-many or many-to-one matching occurs, spatial inclusion relationship analysis and area overlap rate calculation are used to resolve conflicts. Name fuzzy matching: The RapidFuzz library is used to calculate string similarity based on Levenstein distance. It calculates the minimum number of single-character editing operations (including insertion, deletion, and replacement of characters) required to convert one string into another, converts the edit distance into a similarity score between 0 and 1, and determines the match by setting a threshold. This achieves fault-tolerant matching and accurate association of administrative region names, and solves problems caused by differences in name spelling, simplified and traditional character conversion, and homophones. Spatial Relationship Matching: The BallTree algorithm is used to perform nearest neighbor search and spatial inclusion analysis on the coordinates of the merged administrative boundaries and external spatial elements (such as weather stations) to quickly locate the possible administrative regions to which these elements belong and determine which specific administrative region they fall within. For difficult elements located near the boundaries, a weighted voting mechanism and confidence assessment system are used to optimize the matching accuracy to over 95% and significantly improve processing speed, achieving intelligent optimization of matching results and solving matching difficulties caused by coordinate deviations or complex boundaries.

[0026] This method focuses on "automating boundary handling" to solve problems that are traditionally handled manually: Multi-format loading: Load SHP / GeoJSON / JSON vector boundaries and extract attributes such as administrative code, level, and name; Topology processing: Automatically stitches up boundary gaps and removes redundancy in overlapping areas, ensuring continuous and intact boundaries; Cross-level aggregation: Supports seamless aggregation from village to township to county to city to provincial boundaries, and ensures no omissions in matching through administrative code verification.

[0027] Example 2 Building upon Example 1, this paper further extends this method by providing an automated administrative boundary fusion mapping method based on the Python language. The flowchart of the method is shown below. Figure 2 As shown, it includes: Step 1: Read meteorological data in CVS format.

[0028] Step 2: Set layer control parameters; Through a parameterized configuration mechanism, users can differentiate the visual attributes (boundary line color, line width, and labeling rules) of administrative boundaries at different levels such as village, township, county, and provincial, establish hierarchical distinction standards, provide preset parameter support for seamless aggregation of cross-level boundaries, and ensure that the boundaries of different levels have clear distinction and relevance in visual presentation.

[0029] Step 3: Load multi-level administrative boundary Shapefile data according to the set layers; Step 4: Create a regular grid coordinate system and generate gridded meteorological element data based on the optimal interpolation algorithm for the data.

[0030] Step 5: Create a PlateCarree projected coordinate system, set the coordinate axis format (latitude and longitude scale), and configure the coordinate axis labels and scale styles.

[0031] Step 6: Add administrative boundaries in layers (province-city-county-township-town), and key areas can be specially marked.

[0032] Step 7: Draw the color patch diagram.

[0033] Step 8: Automatically add components: compass rose, title, copyright information watermark, administrative division name, etc.

[0034] Step 9: Whiten the administrative boundaries, output .jpg / .png image format, and save.

[0035] In step 3, multi-level administrative boundary Shapefile data is loaded. This is one of the data types that the automated administrative boundary fusion mapping method based on Python in Example 1 can process. In step 6, the automated administrative boundary fusion mapping method based on Python is used to obtain a Shapefile file for meteorological mapping from the multi-level administrative boundary Shapefile data. Based on the Shapefile file for meteorological mapping, administrative boundaries are added hierarchically. A layered rendering mechanism of "high-level base and low-level overlay" is adopted, and administrative boundary layers are overlaid sequentially in the order of provincial level → municipal level → county level → township level (or vice versa). This makes the high-level boundaries serve as the spatial framework base and the low-level boundaries serve as detail supplementary layers. At the physical level, precise nesting and seamless aggregation of different level boundaries are achieved, solving the technical pain points of hierarchical confusion and boundary breakage in traditional multi-scale maps.

[0036] In step 4, the dynamic interpolation decision mechanism specifically consists of an adaptive algorithm switching logic based on spatial scale (resolution) and terrain complexity indicators. (1) Small-scale region Automatically enable Kriging interpolation (precision priority). (2) Large-scale regions Automatically enable RBF radial basis functions (velocity priority). (3) In areas with undulating terrain, an elevation correction factor is introduced to optimize the interpolation results.

[0037] In step 9, the administrative boundary whitening process is essentially a boundary visual optimization process integrating anti-aliasing algorithms. To address the jagged distortion problem that easily occurs at the junction of administrative boundaries and meteorological element color spots, an anti-aliasing algorithm is used to perform gradient processing on boundary pixels to construct a color transition zone between the boundary and the color spot area. The algorithm calculates the color difference between adjacent pixels on the boundary line and automatically adjusts the pixel brightness and saturation of the transition zone, so that the administrative boundary line and the color spots of the surrounding meteorological elements present a continuous gradient effect, eliminating visual discontinuities and jagged edges. This processing is linked to the hierarchical attributes of administrative boundaries to ensure that the smoothness and visual distinguishability of boundaries at different levels are balanced, thus ensuring both clear and discernible boundaries and overall visual uniformity of the map.

[0038] It completely solves the problem of jagged distortion of administrative boundaries in traditional color-coded maps, improves the visual aesthetics and professional quality of the maps, and enhances the visual coherence of cross-level boundary nesting, meeting the map usage needs of multiple scenarios such as academic reports and emergency command.

[0039] Example 3 This embodiment further defines Embodiment 2. It aims to address issues such as the lack of multi-scale adaptation in current meteorological mapping, subjective algorithm selection, inefficient parameter optimization, insufficient process automation, and weak personalized adaptation. It constructs an automated interpolation optimization technology system based on Python to achieve accurate visualization and efficient generation of multi-scale meteorological elements, providing support for meteorological operations.

[0040] The method in Example 2 solves technical problems such as optimizing spatial interpolation accuracy in meteorological mapping, adaptive handling of administrative boundaries, and improving the efficiency of automated processes. The following is a detailed explanation of the processes in the roadmap in sequence: After the process starts, the project initialization is completed first. The system automatically performs environment self-check (including dependency library loading and storage path verification) and basic parameter preset. Then it enters the data processing stage. The system prioritizes reading CSV data containing latitude, longitude and core meteorological elements (other fields do not interfere with the drawing, focusing on key dimensions). Users can configure the layer display order, transparency and preset whether key areas are specially marked. Simultaneously, SHP / GeoJSON / JSON format administrative boundary data is loaded.

[0041] Based on core parameters, a regular grid coordinate system is constructed. According to the data, the system selects the best interpolation from multiple algorithms such as inverse distance weighting, kriging, and radial basis as needed (e.g., kriging is selected to maintain accuracy at small scales and radial basis is selected to improve efficiency at large scales). Combined with geographic data, the latitude and longitude boundary range is locked. The system uses the PlateCarree projection coordinate system by default to standardize latitude and longitude scales and labels, and layered and superimposes multi-scale boundaries of province, city, county and township (supports independent style control).

[0042] The system automatically matches dynamic color schemes based on meteorological element types (precipitation / temperature, etc.), draws color patches by filling contour lines and generates intelligent legends, and overlays user-defined outer and second layers. It automatically adds components such as north arrows and copyright watermarks, and whitens the boundaries. Ranking tables or pie charts can be added as needed to provide more in-depth statistics. The final output is a high-resolution result of 200dpi+, supporting multiple formats such as PNG / PDF / JPG, and named according to adaptive rules, realizing an automated closed loop of "data input - intelligent processing - high-precision output".

Claims

1. An automated administrative boundary fusion mapping method based on Python language, wherein the method is performed on the Python language platform, characterized in that, The method includes the following steps: S1. Receive multi-level administrative boundary vector data containing Shapefile, GeoJSON and JSON file formats, perform data loading and format unification processing, and obtain standardized data with a unified coordinate system. S2. Perform topological relationship repair and optimization on the standardized data generated in step S1 to achieve intelligent segmentation and redistribution of overlapping areas, thereby obtaining topologically consistent and seamless boundary data without overlap. Topology repair and optimization processes include: Gap Detection and Stitching: A gap detection algorithm based on R-tree spatial indexing is used to identify gap regions by constructing a boundary line network and applying line string polygonization technology. For the detected gaps, an adaptive buffer stitching algorithm is used to dynamically adjust the stitching parameters according to the gap size. Overlapping region denoising: Shapely overlay analysis technology is used to detect overlapping regions. A priority conflict resolution mechanism is constructed, and priority weights are assigned to each administrative boundary element. The weights are determined comprehensively based on administrative level, data source reliability, and data timeliness. The ownership of overlapping regions is determined through the priority conflict resolution mechanism. High-priority elements are retained in overlapping regions, while low-priority elements are removed from overlapping regions. The Voronoi region segmentation algorithm is used to construct a Voronoi diagram with the center point of the overlapping region as the seed point. The overlapping regions are intelligently segmented and redistributed to obtain topologically consistent and seamless, non-overlapping boundary data. S3. Perform multi-level administrative boundary fusion processing on the topology optimization data generated in step S2 to obtain seamless multi-level administrative boundary data; S4. Receive the fused boundary data obtained in step S3, perform multi-strategy intelligent matching analysis, and obtain a Shapefile file that can be used for meteorological mapping. Code matching: Standardize administrative codes by converting text codes into numeric codes; construct the standard administrative code library into a Python dictionary structure, traverse the data source to be matched, and perform batch matching; perform bidirectional verification of the matching results, and resolve conflicts when one-to-many or many-to-one matching occurs; Name fuzzy matching: Based on the Levenstein distance, string similarity is calculated by determining the minimum number of single-character edit operations required to convert one string into another, converting the edit distance into a similarity score between 0 and 1, and determining a match by setting a threshold; Spatial relationship matching: The BallTree algorithm is used to perform nearest neighbor search and spatial inclusion analysis on the coordinate positions of the merged administrative boundaries and external spatial elements to locate the administrative regions to which they belong and determine which administrative region these elements fall within, thereby achieving intelligent optimization of the matching results.

2. The automated administrative boundary fusion mapping method based on Python language according to claim 1, characterized in that, Step S1 includes data loading and format standardization processing, which includes: Multi-format vector data loading: The Fiona database is used as the underlying driving engine, and an adaptive data loader is built in combination with the Geopandas database; the format detection algorithm identifies the multi-source vector data formats of multi-level administrative boundaries, including Shapefile files, GeoJSON files and JSON files; Intelligent coordinate recognition and transformation: The PyProj library is used to realize coordinate system transformation, and various input data are uniformly converted into the WGS84 coordinate system; Data quality check: To address data quality issues, a geometric validity verification algorithm based on Shapely is used to automatically repair invalid geometric objects using the buffer(0) method, thereby obtaining standardized data with a unified coordinate system.

3. The automated administrative boundary fusion mapping method based on Python language according to claim 2, characterized in that, In step S3, the hierarchical administrative boundary fusion processing includes: Topology Preservation: Construct a hierarchical fusion engine based on Geopandas Dissolve, and use the topology preservation algorithm to ensure boundary continuity during the fusion process; Boundary fusion: The dissolve processing method is used for boundary fusion. During the fusion process, memory block technology is used. Each data block is fused sequentially from township to county level and from county to province level. A parallel processing framework is built based on the Multiprocessing library to distribute multiple provincial data blocks to different processing processes. Each process independently completes the step-by-step fusion. Finally, the results are merged and summarized to obtain a seamless multi-level administrative boundary dataset.

4. An automated meteorological mapping method based on the Python language, wherein the method is performed on the Python language platform, characterized in that, The method employs the automated administrative boundary fusion mapping method based on Python language as described in any one of claims 1-3, and the method includes the following steps: Step 1: Read meteorological data in CVS format, set layer control parameters, and load Shapefile data of multi-level administrative boundaries according to the set layers; Step 2: Create a regular network coordinate system and generate gridded meteorological element data based on the optimal interpolation algorithm for the data; Step 3: Create a PlateCarree projected coordinate system, set the coordinate axis format, and configure the coordinate axis labels and tick styles; Step 4: For the Shapefile data of multi-level administrative boundaries, use an automated administrative boundary fusion mapping method based on Python to obtain Shapefile files for meteorological mapping. Based on the Shapefile files for meteorological mapping, add administrative boundaries hierarchically. Step 5: Draw the color patch map, add the necessary map elements, whiten the administrative boundaries, and output the meteorological map in image format.

5. The automated meteorological mapping method based on Python language according to claim 4, characterized in that, When reading meteorological data in CVS format, the core parameters to be read are: longitude field, latitude field, and corresponding data element field.

6. The automated meteorological mapping method based on Python language according to claim 5, characterized in that, The data optimization interpolation algorithm is as follows: Algorithm switching based on spatial scale and terrain complexity indicators: in small-scale regions Automatically enable Kriging interpolation; in large-scale regions Automatically enable RBF radial basis function; introduce elevation correction factor to optimize interpolation results in terrain undulation areas.

7. The automated meteorological mapping method based on Python language according to claim 6, characterized in that, The whitening process for administrative boundaries involves: applying gradient processing to boundary pixels using an anti-aliasing algorithm to construct a color transition zone between the boundary and the color patch area; calculating the color difference between adjacent pixels on the boundary line; and adjusting the pixel brightness and saturation of the transition zone to create a continuous gradient effect between the administrative boundary line and the surrounding meteorological element color patches, thereby eliminating visual discontinuities and jagged edges.

8. A computer-readable storage medium for storing computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the method according to any one of claims 4-7.

Citation Information

Patent Citations

  • Method for drawing administrative map of HTML5 rich client side

    CN105227646A

  • Fast fusion operation method for multi-source spatial data

    CN107423753A