Irrigation area map generation method, device, equipment, medium and product
By acquiring and cropping geographic data, and combining intelligent symbolization and annotation processing, a single map of irrigation districts is automatically generated, solving the problems of low automation and difficulty in standardization in the single map generation method, and improving mapping efficiency and quality.
Patent Information
- Application Number
- CN202511483498.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2045-10-17
AI Technical Summary
Existing methods for generating single maps of irrigation districts have low levels of automation, are difficult to standardize, and cannot meet the requirements for dynamic updates and multi-scale representation.
By acquiring public basic geographic data from across the country and proprietary data from the target irrigation area, the boundary of the comprehensive geographic scope is determined using envelope rectangles, the area is cropped and the data is clipped, and combined with intelligent symbolization and annotation processing, a single map of the irrigation area is automatically generated.
It enables the automated generation of a single map of an irrigation district, avoiding the problem of inconsistent standards caused by manual operation, improving mapping efficiency and quality, and is suitable for the batch generation of standardized map sets for large and medium-sized irrigation districts.
Smart Images

Figure CN120953432B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of map compilation, and in particular to a method, apparatus, equipment, medium and product for generating a single map of an irrigation district. Background Technology
[0002] The irrigation district map, serving as a spatial carrier of irrigation district engineering facilities, carries spatiotemporal information on key elements such as irrigation canal networks, water conservancy projects, and arable land resources. It is the baseline map for the design and maintenance of irrigation district continuation and water-saving renovation projects, as well as the construction of digital twin irrigation districts. It is also an important component of the "National Water Conservancy Map" rural water conservancy and hydropower business application system. The development of the standardized irrigation district map is of significant practical importance for further planning and promoting the modernization, informatization, and digitalization of irrigation districts, and for enhancing the construction and management capabilities of large and medium-sized irrigation districts.
[0003] In the field of water conservancy engineering mapping, especially in the area of smart irrigation district mapping, the compilation of thematic maps mainly relies on operators manually using geographic information platform software and vector graphics software. During the data processing stage, operators need to manually process and integrate multi-source spatiotemporal data at different scales, frequently converting coordinate systems and integrating formats. During the map drawing stage, they need to repeatedly set the style of map elements based on experience or standards. During the layout adjustment stage, they need to repeatedly adjust decorative elements such as legends, scale bars, and north arrows, considering the map sheet and overall layout, to ensure the integrity of map elements and that they do not overlap. This method of map compilation, relying on operators manually operating software, is time-consuming, costly, difficult to standardize, and cannot guarantee the quality of map publications.
[0004] Although the development and popularization of computer technology has enabled the automation of processes such as raster clipping, data management and simple topology checks to a certain extent through scripting language packages, simplifying manual operations for operators, the implementation of this technical solution not only lacks a dedicated toolchain for irrigation district scenarios, but is also limited by the licensing mechanism of commercial GIS software, resulting in significant cost barriers and data compatibility risks.
[0005] In summary, existing mapping methods are insufficient to meet the requirements of dynamic updates, multi-scale representation, and standardized output for a single map of an irrigation district. Therefore, there is an urgent need for a new method to generate a single map of an irrigation district to address the issues of low automation and difficulty in standardization in existing methods. Summary of the Invention
[0006] The purpose of this application is to provide a method, apparatus, equipment, medium, and product for generating a single map of an irrigation district, which can solve the problems of low automation and difficulty in standardization in existing methods for generating single maps of irrigation districts.
[0007] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for generating a map of an irrigation district, comprising: acquiring various public basic geographic data from across the country and various types of layers of the target irrigation district; the layers store proprietary data of the target irrigation district.
[0008] The comprehensive geographical boundary of the target irrigation area is obtained based on the envelope rectangles of the layers of each type in the target irrigation area.
[0009] The cut-off area of the target irrigation area is obtained based on the comprehensive geographical boundary of the target irrigation area.
[0010] Based on the cropping region, the public basic geographic data of various regions across the country are cropped to obtain the public basic geographic data corresponding to the target irrigation area.
[0011] The standard symbols and annotations corresponding to each public basic geographic data of the target irrigation area, the standard symbols and annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area, the north arrow, the legend, and the scale are marked on the map corresponding to the target irrigation area to obtain a map of the target irrigation area.
[0012] Secondly, this application provides a device for generating a map of an irrigation district, comprising: an acquisition module for acquiring various public basic geographic data from across the country and various types of layers of the target irrigation district; wherein the layers store proprietary data of the target irrigation district.
[0013] The comprehensive geographic boundary determination module is used to obtain the comprehensive geographic boundary of the target irrigation area based on the envelope rectangle of each type of layer of the target irrigation area.
[0014] The trimming area determination module is used to obtain the trimming area of the target irrigation area based on the comprehensive geographical boundary of the target irrigation area.
[0015] The cropping module is used to crop various public basic geographic data across the country based on the cropping area to obtain the various public basic geographic data corresponding to the target irrigation area.
[0016] The irrigation district map construction module is used to mark the standard symbols and annotations corresponding to the public basic geographic data of the target irrigation district, the standard symbols and annotations corresponding to the proprietary data stored on the layers of the target irrigation district, the north arrow, the legend, and the scale on the map corresponding to the target irrigation district, so as to obtain an irrigation district map of the target irrigation district.
[0017] Thirdly, 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 above-described method for generating a map of an irrigation district.
[0018] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for generating a map of an irrigation district.
[0019] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for generating a map of an irrigation district.
[0020] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a method, device, equipment, medium and product for generating a single map of an irrigation district. The development of artificial intelligence technology and the deep integration of map compilation technology provide a brand-new solution for the large-scale production of thematic maps of irrigation districts. This application processes data automatically, and the entire process does not require manual intervention, avoiding the problem of difficulty in standardization caused by manual operation, and solving the problems of low automation and difficulty in standardization. Attached Figure Description
[0021] 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.
[0022] Figure 1 This is a flowchart illustrating a method for generating a single map of an irrigation district, as provided in an embodiment of this application.
[0023] Figure 2 This is a schematic diagram of the functional modules of an irrigation district map generation device provided in an embodiment of this application.
[0024] Figure 3 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0025] 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.
[0026] 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.
[0027] This application provides a method for generating a single map of an irrigation district. In one exemplary embodiment, such as... Figure 1 As shown, it includes the following steps 101 to 105.
[0028] Step 101: Obtain public basic geographic data from all over the country and various types of layers for the target irrigation area; the layers store the proprietary data of the target irrigation area.
[0029] Step 102: Obtain the comprehensive geographical boundary of the target irrigation area based on the envelope rectangles of the layers of each type in the target irrigation area.
[0030] Step 103: Based on the comprehensive geographical boundary of the target irrigation area, obtain the cut-off area of the target irrigation area.
[0031] Step 104: Based on the cropping area, crop the public basic geographic data of various regions across the country to obtain the public basic geographic data corresponding to the target irrigation area.
[0032] Step 105: Mark the standard symbols and annotations corresponding to each public basic geographic data of the target irrigation area, the standard symbols and annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area, the north arrow, the legend, and the scale on the map corresponding to the target irrigation area to obtain a map of the target irrigation area.
[0033] In practical applications, all irrigation districts can be mapped onto a single PDF file.
[0034] In practical applications, the public basic geographic data across the country includes vector data and raster data. Vector data comprises features such as rivers, administrative divisions, and township seats at different times across the country, while raster data includes features such as Digital Elevation Models (DEMs) and nationwide remote sensing imagery. Specific data consists of the vector data required for the thematic maps of irrigation districts, including but not limited to point features such as headworks, sluice gates, and pumping stations; linear features of the water conveyance system such as main canals, branch canals, and tributary canals; linear features of pipelines such as main pipes, branch pipes, and tributary pipes; and areal features of water systems such as reservoirs, dikes, riverbanks, lakes, and ponds. According to the "Requirements for Creating a Single Map of Irrigation Districts Nationwide" issued by the General Office of the Ministry of Water Resources, the specific data for irrigation districts is stored in a .gbd format geographic database, with the irrigation district as the basic unit, based on layer type classification.
[0035] In practical applications, before obtaining the comprehensive geographic boundary of the target irrigation area based on the envelope rectangle of each type of layer of the target irrigation area, the method further includes: S102: constructing a vector geographic information database and a raster geographic information database to realize the construction of a digital base map of the irrigation area through spatial registration and attribute association of multi-source heterogeneous data.
[0036] The vector geographic information database stores vector data of points, lines, and polygons read, constructed, and output during the cartographic process. This includes data on rivers, administrative divisions, township locations, and specific irrigation districts across the country at different times. It employs a Binary Large Object (BLOB) storage method and utilizes a MySQL database for efficient management. Database attribute fields include metadata, spatial features, and permissions. Metadata fields include data source, acquisition time, and original coordinate system; spatial features define the spatial extent of the layer file, i.e., its boundaries; and permissions indicate the degree of data accessibility.
[0037] The raster geographic information database is used to store all raster data read, constructed, and output in the national remote sensing imagery and digital elevation models, as well as subsequent mapping processes. The raster geographic information database achieves efficient management of raster data by establishing a multi-level pyramid structure and using a block-based storage method based on PostGIS. The raster database attribute fields include: metadata items, spatial feature items, and permission items. The metadata items include data source, resolution, acquisition time, and original coordinate system; the spatial feature items are the spatial extent of the layer file, i.e., the four boundary coordinates; and the permission items are data permission identifiers, indicating the degree of data accessibility.
[0038] S103: Quality inspection and repair of raw basic geographic information data and data preprocessing.
[0039] Using irrigation districts as the basic unit, the system automatically reads and parses proprietary data on irrigation district layers in batches according to standardized layer names, and performs preprocessing operations such as topology checks and automatic repairs on the proprietary data on the irrigation district layers. Then, all metadata, including vector layers, data sources, acquisition times, and original coordinate systems, extracted from the file geodatabase and after topology checks and automatic repairs, are stored in the vector geographic information database.
[0040] For vector data in public basic geographic data, based on the Geospatial Data Abstraction Library (GDAL), the interface of the QGIS topology inspector tool module is called to perform topology checks and automatic repairs on rivers, administrative divisions, and township seats across the country at different time periods. These checks include self-intersection, duplicate nodes, and dangling nodes, ensuring that all features meet the requirements of the Open Geospatial Consortium (OGC) Simple Feature Specification. In particular, topology rule verification (full coverage, no blanks, no overlaps, and closed boundaries) is performed on administrative division data. The Douglas-Peucker algorithm is used to optimize the geometry, and buffer technology is employed to repair topological gaps, achieving efficient rendering of vector data. The processed data is then stored in a vector geographic information database.
[0041] The raster data in the public basic geographic data is processed. Then, the processed raster data is stored in the raster geographic information data, and information such as the data source, resolution, acquisition time, original coordinate system, and data permission identifier of the stored raster data is associated with it.
[0042] In another exemplary embodiment of this application, the comprehensive geographical boundary of the target irrigation area is obtained based on the envelope rectangles of the layers of each type in the target irrigation area. Specifically, this includes obtaining the envelope rectangles of the layers of each type in the target irrigation area based on spatial overlay analysis. Specifically, the QGIS spatial overlay analysis interface is called to obtain the four boundaries of each layer, and the proprietary data of the target irrigation area is spatially merged to obtain the envelope rectangles of each layer in the target irrigation area.
[0043] The comprehensive geographical boundary of the target irrigation area is obtained by determining the intersection of the envelope rectangles of the layers of each type.
[0044] In another exemplary embodiment of this application, the cropping area of the target irrigation area is obtained based on the comprehensive geographical boundary of the target irrigation area. Specifically, if the aspect ratio of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is greater than 1, it is determined whether the aspect ratio of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is greater than a preset horizontal target ratio, and a first determination result is obtained.
[0045] If the first judgment result is yes, then the center point of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the center of the clipping area, the width of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the width of the clipping area, and the adjusted height is taken as the height of the clipping area, so as to obtain the clipping area of the target irrigation area; the adjusted height is calculated based on the preset horizontal target ratio and the width of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area.
[0046] If the first judgment result is negative, then the center point of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the center of the clipping area, the height of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the height of the clipping area, and the adjusted width is taken as the width of the clipping area, thus obtaining the clipping area of the target irrigation area; the adjusted width is calculated based on the preset horizontal target ratio and the height of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area.
[0047] If the aspect ratio of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is less than or equal to 1, then it is determined whether the aspect ratio of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is greater than or equal to the preset vertical target ratio, and a second determination result is obtained.
[0048] If the second judgment result is yes, then the center point of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the center of the clipping area, the width of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the width of the clipping area, and the adjusted height is taken as the height of the clipping area, so as to obtain the clipping area of the target irrigation area; the adjusted height is calculated according to the preset vertical target ratio and the width of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area.
[0049] If the second judgment result is negative, then the center point of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the center of the clipping area, the height of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area is taken as the height of the clipping area, and the adjusted width is taken as the width of the clipping area, thus obtaining the clipping area of the target irrigation area; the adjusted width is calculated based on the preset vertical target ratio and the height of the rectangle corresponding to the comprehensive geographical boundary of the target irrigation area.
[0050] In practical applications, taking a map sheet ratio constraint of 297mm×420mm as an example, the cropping area of the target irrigation area is obtained based on the comprehensive geographical boundary of the target irrigation area. Based on this cropping area, various public basic geographic data from across the country are cropped to obtain the corresponding public basic geographic data for the target irrigation area. The details are as follows: Based on the vector and raster data preprocessed by S103, the spatial morphological characteristics of the irrigation area are intelligently analyzed, the aspect ratio is automatically calculated, and the optimal cropping range is dynamically generated. Combined with the size constraints of printing and publishing, an adaptive ratio adaptation algorithm is used to collaboratively process the vector and raster data from various public basic geographic data across the country. The processed standardized data is stored in a spatiotemporal database according to irrigation area units, forming the spatiotemporal data base for irrigation area thematic map making.
[0051] First, define the target proportion. Set the horizontal target proportion to... The vertical target ratio is .in, To specify the width of the map sheet, The height of the map sheet is specified, which is 297mm and 420mm in this example.
[0052] Secondly, determine the direction of the rectangle representing the comprehensive geographical boundary of the irrigation district. Calculate the aspect ratio of the rectangle representing the current comprehensive geographical boundary of the irrigation district. .in, and These represent the width and height of the rectangle defining the current irrigation district's comprehensive geographical boundary. A dynamic adjustment strategy is implemented based on the rectangle's direction. > According to the proportion of horizontal targets Adjust, otherwise according to the vertical target ratio. Adjustments. Specifically, in > In the case of, if This indicates that the current irrigation district's overall geographical area is "too flat," and the width needs to be kept constant while the height needs to be adjusted. ,by The height of the clipping area is determined by using the center point of the rectangle representing the boundary of the overall geographical area as the center point of the clipping area. Set the width of the cropped area; otherwise, keep the height constant and adjust the width. ,by To determine the width of the cropping area, the center point of the cropping area is set at the center point of the rectangle representing the overall geographical boundary. The height of the cropping area. In the case of, if This indicates that the current irrigation district's overall geographical area is "too wide," and the width needs to be kept constant while the height needs to be adjusted. by The height of the clipping area is determined by using the center point of the rectangle representing the boundary of the overall geographical area as the center point of the clipping area. Set the width of the cropping area; otherwise, keep the height constant and adjust the width. by To determine the width of the cropping area, the center point of the cropping area is set at the center point of the rectangle representing the overall geographical boundary. The height of the cropped area.
[0053] Finally, based on the cropping area of the target irrigation district, the public basic geographic data of various parts of the country after preprocessing in S103 are cropped, and the cropped data is stored in the spatiotemporal database for each irrigation district.
[0054] In another exemplary embodiment of this application, standard symbols and annotations corresponding to each public basic geographic data corresponding to the target irrigation area, standard symbols and annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area, a north arrow, a legend, and a scale are marked on the map corresponding to the target irrigation area to obtain a map of the target irrigation area. Specifically, this includes: filtering the standard symbols corresponding to each public basic geographic data corresponding to the target irrigation area and the standard symbols corresponding to each proprietary data stored on each type of layer of the target irrigation area from the symbol mapping rule library.
[0055] The standard symbols corresponding to each public basic geographic data of the target irrigation area and the standard symbols corresponding to each proprietary data stored on each type of layer of the target irrigation area are marked on the map corresponding to the target irrigation area to obtain the first map.
[0056] With the goal of non-overlapping annotations, the annotations corresponding to each public basic geographic data of the target irrigation area and the annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area are marked on the first map to obtain the second map.
[0057] With the goal of ensuring that the north arrow, legend, scale bar, and annotations do not overlap, the north arrow, legend, and scale bar are marked on the second map to obtain a map of the target irrigation area.
[0058] The symbol mapping rule base includes a symbol mapping rule base corresponding to proprietary data and a symbol mapping rule base corresponding to public basic geographic data. The symbol mapping rule base corresponding to public basic geographic data includes a symbol mapping rule base corresponding to vector data and a symbol mapping rule base corresponding to raster data.
[0059] The intelligent symbolization of vector layers consists of automated symbol configuration for feature ontology and intelligent cartographic representation of annotations. Specifically, the automated symbol configuration for feature ontology constructs a multi-level symbol mapping rule library based on the attributes of water conservancy elements, achieving automatic conversion from geometric features to standard symbols. The map symbolization of water conservancy elements must strictly adhere to the standardization requirements of the "Specification for Mapping and Representation of Water Conservancy Spatial Elements" (SL 730-2015), employing differentiated symbol representation methods for different types of elements. The "Specification for Mapping and Representation of Water Conservancy Spatial Elements" specifies corresponding graphic methods, symbol styles, and expression rules for point elements (sluice gates, pumping stations, etc.), linear elements (water conveyance systems, drainage ditch systems, etc.), and area elements (reservoirs, irrigation area boundaries, etc.). The automated symbol configuration for feature ontology constructs a hierarchical symbol mapping rule library based on the "Specification for Mapping and Representation of Water Conservancy Spatial Elements" and attributes such as the engineering level of water conservancy elements, achieving automatic conversion from geometric elements to standard symbols. In practical applications, the construction process of the symbol mapping rule base corresponding to proprietary data specifically includes: S301: Based on the attributes of water conservancy elements, construct a point, line, and surface hierarchical storage model, adopt a relational database to dynamically store symbol rules, and intelligently convert the clipped elements and the proprietary data of the target irrigation area into standard symbols to achieve standardized cartographic expression, supporting real-time updates and maintenance.
[0060] For point features (such as structures like canal heads, sluice gates, and pumping stations), parameters such as layer group name, layer name, symbol size, symbolization method, drawing order, font, Unicode encoding, color, offset, and annotation priority are set. Table 1 shows the point feature symbol mapping rule library in this embodiment.
[0061] Table 1. Point Feature Symbol Mapping Rule Base
[0062]
[0063] As shown in Table 1, the canal head uses Unicode characters 57 and 58 to form a composite symbol, configured as a 4.939mm red main symbol and a 3.951mm white auxiliary symbol, with a vertical offset of 0.55mm. Drawing them in sequence achieves a 3D effect. Simultaneously, the system supports rendering dotted symbols using SVG vector graphics. For example, the sluice gate is symbolically represented by SVG vector graphics according to the symbol mapping rules in Table 1.
[0064] For linear features (such as water conveyance canals including main canals, branch canals, and tributary canals, and pipelines including main pipes, branch pipes, and tributary pipes), parameters such as layer group name, layer name, width, symbolization method, drawing order, color, mixed lines, cartographic lines, offset, and annotation priority are set. Table 2 shows the linear feature symbol mapping rule library in this embodiment.
[0065] Table 2. Linear Feature Symbol Mapping Rule Base
[0066]
[0067] As shown in Table 2, the sluice gate line type is represented by a simple red line symbol of 0.353mm, the main canal by a blue drafting line symbol of 1.058mm, and the embankment by a superposition of a 1.411mm red mixed line (90°) and a 0.300mm red drafting line. Professional engineering drawing effects can be achieved by precisely controlling the line type parameters and the drawing order.
[0068] For isal features (such as administrative boundaries, water systems such as reservoirs, dikes, beaches, lakes and ponds), set layer group names, layer names, widths, fill colors and outline colors, and construct a symbol mapping rule library for isal features.
[0069] The aforementioned dynamically configurable symbol mapping mechanism can achieve automated symbolic representation that is intelligently adapted to multiple scenarios by flexibly adjusting the symbol mapping rule base parameters of point, line, and polygon elements. This mechanism supports online dynamic updates of the symbol mapping rule base, and different symbolization schemes can be set according to the characteristic requirements of different application scenarios (such as planning and design, engineering management, emergency dispatch, etc.) to complete the intelligent conversion from basic geographic elements to professional symbolic representations.
[0070] The process of constructing the symbol mapping rule base corresponding to raster data is as follows: Intelligent symbolization of raster layers mainly refers to the automatic symbolization representation of digital elevation models in public basic data. First, raster terrain analysis is performed based on GDAL to draw raster data of the mountain shadows corresponding to the digital elevation model, which is stored in the raster database as a layer. Then, the original digital elevation model layer is placed above the mountain shadow layer, the rendering type of the DEM is set to single-band pseudo-color, and the opacity of the DEM layer is reduced to obtain the symbolized terrain base map, which serves as the base map for a map of the irrigation area.
[0071] The symbol mapping rule base corresponding to vector data stores symbols obtained through well-known means, which will not be elaborated here.
[0072] In another exemplary embodiment of this application, with the goal of non-overlapping annotations, the annotations corresponding to each public basic geographic data corresponding to the target irrigation area and the annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area are marked on the first map to obtain a second map. Specifically, this includes: marking the annotations corresponding to each public basic geographic data corresponding to the target irrigation area and the annotations corresponding to each proprietary data stored on each type of layer of the target irrigation area on the first map, and determining the overlapping annotations in the marked first map.
[0073] If two overlapping annotations have the same priority, then the lower-priority annotation in the two overlapping annotations is rotated or translated to obtain a second map.
[0074] If two overlapping annotations have different priorities, the annotation with lower priority is moved or hidden to obtain a second map.
[0075] In another exemplary embodiment of this application, determining the overlapping annotations in the marked first map specifically includes: processing the marked first map using a quadtree spatial indexing method to obtain the overlapping annotations.
[0076] Intelligent annotation mapping ensures the scientific and aesthetic layout of annotations by analyzing the spatial relationships between them and constructing a dynamic avoidance mechanism. Large and medium-sized irrigation districts have complex canal networks, including main canals, branch canals, and other multi-level water conveyance channels and various water conservancy facilities. Displaying all elements indiscriminately would lead to map information overload. Therefore, a dynamic hierarchical representation and avoidance mechanism is established. Based on weight factors such as geographic element hierarchy, canal level, and project importance, the display priority of elements is intelligently adjusted. In practical applications, with the goal of non-overlapping annotations, the annotations corresponding to the public basic geographic data of the target irrigation district, as well as the annotations corresponding to the proprietary data stored on various types of layers of the target irrigation district, are marked on the first map to obtain the second map. Specifically, this includes: S302: First, a quadtree index is constructed as the core spatial index. The spatial relationships between the annotations corresponding to each element are analyzed to quickly find all annotations that may overlap.
[0077] Secondly, based on the overlapping annotations found, and using the standard point, line, and polygon feature symbol mapping rule library built on S301, a multi-level annotation priority conflict detection model is established to implement a differentiated annotation processing strategy, with each annotation having a preset priority and level.
[0078] The multi-level annotation priority conflict detection model refers to setting the highest priority for public basic geographic data such as irrigation area boundaries, administrative divisions, township seats, and rivers, and using a conflict resolution mechanism combining forced retention and dynamic displacement to handle overlapping annotations. The conflict resolution mechanism combining forced retention and dynamic displacement works as follows: when an overlap between a public basic geographic data annotation and other priority feature annotations is detected, the overlapping area is first identified using the annotation bounding rectangle intersection detection method, and the public basic geographic data annotation is forcibly retained. Simultaneously, other priority feature annotations are intelligently shifted based on the centroid of the public basic geographic data. For conflicts that cannot be resolved by displacement, other priority feature annotations are automatically hidden, ensuring the complete display of core feature annotations while effectively maintaining the overall clarity and readability of the map. When two high-priority annotations are detected to overlap, the lower-priority annotation is rotated or translated.
[0079] For annotations (medium priority) of major water conservancy facilities such as headworks, pumping stations, gates, main canals, and branch canals, a collision detection mechanism based on quadtree indexing is adopted, allowing conflicting annotations to rotate and move within a 15° angular range and a 3mm planar range. For each potentially conflicting annotation pair, precise geometric intersection detection is performed, calculating the overlapping area and relative positional relationship between the annotation bounding boxes. When an unacceptable conflict is detected (overlapping area exceeds a threshold), the system uses an iterative optimization algorithm (such as gradient descent) within a 15° angular rotation range and a 3mm planar displacement range to find the optimal adjustment scheme for each annotation in the pair. Small-angle rotations (2°-5° fine-tuning) are prioritized, followed by planar displacements (in 0.5mm steps), until the minimum visual conflict standard is met or the maximum adjustment threshold is reached. Simultaneously, it ensures that the adjusted annotations maintain a clear association with the features and aesthetic appeal on the drawing.
[0080] For internal conflicts among annotations (low priority) of secondary water conservancy facility elements such as Class III dikes, Class IV dikes, main canals, and branch canals, the lower-level annotations are automatically hidden. When the annotation of a secondary water conservancy facility element conflicts with annotations of other elements, the annotation of the secondary water conservancy facility element is directly hidden.
[0081] By employing the above annotation processing methods, a balanced map load can be achieved while ensuring key information is highlighted. This approach not only fully presents the irrigation district's water distribution system but also avoids visual clutter caused by information overload. The relative importance of different elements depends on the application scenario of the irrigation district thematic map and the content that needs to be emphasized. By modifying the annotation priority in the point, line, and polygon element symbol mapping rule base, the map can be automatically adapted to the application scenario.
[0082] By using automated symbol configuration for feature ontology and intelligent cartographic representation of annotations, geographic features can be accurately drawn on the map according to rules. Based on this, intelligent dynamic avoidance technology can be employed to optimize the layout of map embellishment features. Through spatial relationship analysis, the arrangement of core elements such as the north arrow, scale bar, and legend is automatically coordinated to avoid embellishment features obscuring or covering the main features of the second map. In practical applications, with the goal of preventing the north arrow, legend, scale bar, and annotations from overlapping, the north arrow, legend, and scale bar are marked on the second map. Specifically, this involves: first, using a relational database to store the placement rules for embellishment features, with fields including embellishment type, initial position, movement method, step size, and maximum obscuring ratio. Table 3 shows the placement rules for embellishment features in this embodiment.
[0083] Table 3. Linear Feature Symbol Mapping Rule Base
[0084]
[0085] As shown in Table 3, the positioning of the compass adopts a dynamic avoidance strategy. Specifically, the upper right corner of the map is selected as the default position. Through collision detection, when the outer rectangle of the compass is found to overlap or conflict with the standard symbols or annotations on the second map, the compass is intelligently moved to the left according to a preset step size until the best position that conforms to the cartographic specifications and ensures clear identification is found.
[0086] The scale is set to the bottom left corner of the map as the default position. Through collision detection, if a visual conflict is detected with the standard symbols or annotations on the second map, the scale will intelligently shift to the left according to the preset step size. If a suitable position cannot be found, the scale will intelligently shift to the right until the best position that both conforms to the cartographic specifications and ensures clear identification is found.
[0087] The legend selects the lower left corner of the map as the default position. Through collision detection, when a visual conflict is detected with the standard symbols or annotations on the second map, it will intelligently shift to the right according to the preset step size until it finds the best position that both conforms to the cartographic specifications and ensures clear identification.
[0088] It should be noted that, for the sake of simplification, the above process uses terms such as "top right" and "bottom left" to describe the initial position. In the rule base, these positions are precisely controlled by map coordinates, and all coordinates after movement are restricted to be within the map area.
[0089] In practical applications, the process of constructing a quadtree index as the core spatial index, analyzing the spatial relationships between annotations corresponding to each element, and quickly finding all possible overlapping annotations is as follows: Step 1: Define the bounding box of the annotation.
[0090] Annotations are typically represented as text strings and their corresponding geographic locations (points, lines, polygons). To perform fast spatial relationship calculations, the minimum bounding rectangle (MBR) of each annotation is first calculated. This rectangle represents the spatial extent that the annotation occupies on the screen or map.
[0091] For dot annotations: calculate the four corner points of the text based on anchor points, font, size, offset, etc.
[0092] For line annotations: they are usually placed along the line, and their MBR is a rectangle that covers the entire text string.
[0093] For face annotations: they may be placed inside the face or along the boundary, and the MBR of the text is calculated in the same way.
[0094] Step 2: Construct a quadtree.
[0095] Initialize the root node: The root node corresponds to the entire map range (global latitude and longitude range or projected coordinate range).
[0096] Insert annotation MBR: Starting from the root node, recursively insert the annotation MBR into the quadtree.
[0097] A node can hold a maximum number of annotations (e.g., 4). This capacity is a preset threshold.
[0098] When the number of annotations in a node exceeds a threshold, the node will split into four child nodes of equal size (usually in the northwest, northeast, southwest, and southeast quadrants).
[0099] The MBR annotation originally in this node will be reassigned to a more suitable child node based on its center point or its overlap with child nodes.
[0100] If an annotation's MBR spans the boundaries of child nodes, it is typically retained in the parent node rather than being pushed down to the child nodes. This is to avoid having to search for the same large feature across multiple nodes during a query.
[0101] Recursive construction: This process is performed recursively until all annotations have been inserted and no nodes need to be split anymore. This ultimately forms a hierarchical tree structure.
[0102] Step 3: Query annotation pairs that may overlap.
[0103] When it is necessary to check which other annotations a target annotation may overlap with, traverse the quadtree starting from the root node.
[0104] For the currently traversed node, check whether the MBR of the target annotation intersects with the range of the node.
[0105] If they do not intersect, then ignore the node and all its child nodes.
[0106] If they intersect, continue checking all annotation MBRs stored within that node.
[0107] Collect candidate annotations: Gather all annotations associated with the node containing the target annotation MBR (and its parent node, as there may be annotations that cross boundaries) to form a candidate list. The size of this list is much smaller than the total number of annotations globally.
[0108] Loop processing: Perform steps 1 through 3 for each annotation in the dataset to quickly find all possible overlapping annotation pairs.
[0109] In practical applications, all irrigation districts are mapped into a single PDF file. This process involves generating standardized PDF files from the water conservancy maps corresponding to each irrigation district, sorting the standardized PDF files by irrigation district name in descending order, and merging the standardized PDF files to output a map atlas that conforms to professional cartographic standards.
[0110] Addressing the technical bottlenecks of existing map-making technologies in producing irrigation district thematic maps, such as low automation, low efficiency, difficulty in standardization, and inability to process maps in batches, this application integrates artificial intelligence technology with traditional cartographic processes. It automatically performs data preprocessing, element configuration, and layout generation, achieving an intelligent upgrade of the entire irrigation district thematic map production process. Compared to traditional manual cartography, this application significantly improves the efficiency of irrigation district thematic map production. It is applicable to thematic map production in fields such as water conservancy engineering planning and agricultural irrigation management, especially for the batch generation needs of standardized atlases for large and medium-sized irrigation districts. It is particularly suitable for the batch production and dynamic updating of thematic maps in large and medium-sized irrigation district follow-up construction and water-saving renovation projects, digital twin construction, and other projects, providing efficient and reliable technical support for the construction of the "National Water Conservancy One Map" system.
[0111] This application uses QGIS's Python interface for automated mapping, which solves problems such as ArcGIS's copyright restrictions. Based on this method, a map of the irrigation area is automatically generated without transferring water conservancy data to other software, thus avoiding dependence on other software and ensuring the security of water conservancy data.
[0112] Based on the same inventive concept, this application also provides an irrigation district single-map generation device for implementing the above-mentioned irrigation district single-map generation method. The solution provided by this device is similar to the solution described in the above-described method. Therefore, the specific limitations of one or more irrigation district single-map generation device embodiments provided below can be found in the limitations of the irrigation district single-map generation method above, and will not be repeated here.
[0113] In one exemplary embodiment, such as Figure 2 As shown, a device for generating a map of an irrigation district is provided, comprising: an acquisition module for acquiring public basic geographic data from across the country and various types of layers of the target irrigation district; the layers store proprietary data of the target irrigation district.
[0114] The comprehensive geographic boundary determination module is used to obtain the comprehensive geographic boundary of the target irrigation area based on the envelope rectangle of each type of layer of the target irrigation area.
[0115] The trimming area determination module is used to obtain the trimming area of the target irrigation area based on the comprehensive geographical boundary of the target irrigation area.
[0116] The cropping module is used to crop various public basic geographic data across the country based on the cropping area to obtain the various public basic geographic data corresponding to the target irrigation area.
[0117] The irrigation district map construction module is used to mark the standard symbols and annotations corresponding to the public basic geographic data of the target irrigation district, the standard symbols and annotations corresponding to the proprietary data stored on the layers of the target irrigation district, the north arrow, the legend, and the scale on the map corresponding to the target irrigation district, so as to obtain an irrigation district map of the target irrigation district.
[0118] 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 3 As shown, the 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 operating system and computer programs stored in the non-volatile storage media. The database stores data for generating irrigation area maps. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for generating irrigation area maps.
[0119] Those skilled in the art will understand that Figure 3The structure shown is merely a block diagram of a portion of the structure related to the present application and does 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 those shown in the figure, or combine certain components, or have different component arrangements.
[0120] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method embodiments.
[0121] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the above-described method embodiments.
[0122] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the above-described method embodiments.
[0123] 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.
[0124] 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).
[0125] 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.
[0126] 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.
[0127] 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. An irrigation one map generation method, characterized by, The method comprises the following steps: obtaining various public basic geographic data of all over the country and various types of layers of the target irrigation area; the layers store special data of the target irrigation area; obtaining the comprehensive geographic range boundary of the target irrigation area according to the envelope rectangle of the various types of layers of the target irrigation area; specifically comprising: obtaining the envelope rectangle of the various types of layers of the target irrigation area based on spatial overlay analysis method; determining the intersection of the envelope rectangle of the various types of layers of the target irrigation area to obtain the comprehensive geographic range boundary of the target irrigation area; obtaining the clipping area of the target irrigation area according to the comprehensive geographic range boundary of the target irrigation area; clipping the various public basic geographic data of all over the country according to the clipping area to obtain the corresponding various public basic geographic data of the target irrigation area; annotating the corresponding standard symbols and notes of the corresponding various public basic geographic data of the target irrigation area, the corresponding standard symbols and notes of the special data stored on the various types of layers of the target irrigation area, the compass, the legend and the scale on the corresponding map of the target irrigation area to obtain the irrigation area map of the target irrigation area.
2. The method according to claim 1, wherein, obtaining the clipping area of the target irrigation area according to the comprehensive geographic range boundary of the target irrigation area, specifically comprising: if the aspect ratio of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area is greater than 1, determining whether the aspect ratio of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area is greater than a preset horizontal target proportion to obtain a first determination result; if the first determination result is yes, taking the center point of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the center of the clipping area, taking the width of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the width of the clipping area, and taking the adjusted height as the height of the clipping area to obtain the clipping area of the target irrigation area; the adjusted height is calculated according to the preset horizontal target proportion and the width of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area; if the first determination result is no, taking the center point of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the center of the clipping area, taking the height of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the height of the clipping area, and taking the adjusted width as the width of the clipping area to obtain the clipping area of the target irrigation area; the adjusted width is calculated according to the preset horizontal target proportion and the height of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area; if the aspect ratio of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area is less than or equal to 1, determining whether the aspect ratio of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area is greater than or equal to a preset vertical target proportion to obtain a second determination result; if the second determination result is yes, taking the center point of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the center of the clipping area, taking the width of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area as the width of the clipping area, and taking the adjusted height as the height of the clipping area to obtain the clipping area of the target irrigation area; the adjusted height is calculated according to the preset vertical target proportion and the width of the rectangle corresponding to the comprehensive geographic range boundary of the target irrigation area; If the second determination result is no, a center point of a corresponding rectangle of a comprehensive geographical range boundary of the target irrigation area is taken as a center of the clipping region, a height of the corresponding rectangle of the comprehensive geographical range boundary of the target irrigation area is taken as a height of the clipping region, and an adjusted width is taken as a width of the clipping region, to obtain a clipping region of the target irrigation area; the adjusted width is calculated according to a preset longitudinal target ratio and the height of the corresponding rectangle of the comprehensive geographical range boundary of the target irrigation area.
3. The method according to claim 1, wherein, The standard symbols and notes corresponding to each public basic geographic data of the target irrigation area, the standard symbols and notes corresponding to each special data stored on each type of layer of the target irrigation area, a compass, a legend and a scale are marked on a map corresponding to the target irrigation area to obtain an irrigation area one-map of the target irrigation area, and specifically include: The standard symbols corresponding to each public basic geographic data of the target irrigation area and the standard symbols corresponding to each special data stored on each type of layer of the target irrigation area are screened in the symbol mapping rule library; The standard symbols corresponding to each public basic geographic data of the target irrigation area and the standard symbols corresponding to each special data stored on each type of layer of the target irrigation area are marked on a map corresponding to the target irrigation area to obtain a first map; The notes corresponding to each public basic geographic data of the target irrigation area and the notes corresponding to each special data stored on each type of layer of the target irrigation area are marked on the first map as a target to obtain a second map; The compass, the legend and the scale are marked on the second map as a target to obtain the irrigation area one-map of the target irrigation area.
4. The method according to claim 3, wherein, The notes corresponding to each public basic geographic data of the target irrigation area and the notes corresponding to each special data stored on each type of layer of the target irrigation area are marked on the first map as a target to obtain a second map, and specifically include: The notes corresponding to each public basic geographic data of the target irrigation area and the notes corresponding to each special data stored on each type of layer of the target irrigation area are marked on the first map, and each overlapped note in the marked first map is determined; If the priorities of the two overlapped notes are the same, a low-level note in the two overlapped notes is rotated or translated to obtain the second map; If the priorities of the two overlapped notes are different, a low-priority note is moved or hidden to obtain the second map.
5. The method according to claim 4, wherein, Each overlapped note in the marked first map is determined, and specifically includes: The marked first map is processed by using a quadtree spatial index method to obtain each overlapped note.
6. An apparatus for generating a one map of an irrigation district, characterized by The irrigation area one-map generation device includes: An acquisition module is configured to acquire each public basic geographic data of each region in the country and each type of layer of a target irrigation area; the layer stores special data of the target irrigation area; The comprehensive geographic range boundary determination module is configured to obtain a comprehensive geographic range boundary of the target irrigation area according to envelope rectangles of each type of layer of the target irrigation area; specifically, the envelope rectangles of each type of layer of the target irrigation area are obtained based on a spatial overlay analysis method; and the comprehensive geographic range boundary of the target irrigation area is obtained by determining the intersection of the envelope rectangles of each type of layer of the target irrigation area. The clipping area determination module is configured to obtain a clipping area of the target irrigation area according to the comprehensive geographic range boundary of the target irrigation area. The clipping module is configured to clip each public basic geographic data of the whole country according to the clipping area, to obtain each public basic geographic data corresponding to the target irrigation area. The irrigation area one-map construction module is configured to mark standard symbols and notes corresponding to each public basic geographic data of the target irrigation area, standard symbols and notes corresponding to each special data stored on each type of layer of the target irrigation area, a compass, a legend, and a scale on a map corresponding to the target irrigation area, to obtain an irrigation area one-map of the target irrigation area.
7. A computer device comprising: The memory, the processor, and the computer program stored in the memory and executable on the processor are characterized in that the processor executes the computer program to implement the irrigation area one-map generation method of any one of claims 1-5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the irrigation area one-map generation method of any one of claims 1-5.
9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the irrigation area one-map generation method of any one of claims 1-5.
Citation Information
Patent Citations
Map annotation mask calculation method and system, electronic equipment and storage medium
CN115578488A
Automatic finishing configuration method for geographic information annotation of thematic map
CN120086921A