A Geological Map Standard Symbolization Method, Electronic Device and Storage Medium

Through the standard symbolization method of geological maps based on open source GIS engine, the problem of insufficient flexibility and customization in complex geological map symbolization technology is solved, and efficient and flexible data visualization and symbol management are realized, suitable for complex geological map scenarios.

CN119577048BActive Publication Date: 2025-05-23CHINA GEOLOGICAL SURVEY NATURAL RESOURCES COMPREHENSIVE SURVEY COMMAND CENT
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411618303.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-05-23
Estimated Expiration
2044-11-13

AI Technical Summary

Technical Problem

When the existing geological map symbolization technology deals with complex thematic maps, the symbolization system is insufficient in flexibility and customization, the symbolization process is cumbersome, and errors are easily introduced, resulting in inconsistent symbolization.

Method used

The standard symbolization method of geological map based on the open source GIS engine is adopted, and the target vector data is obtained, the font is initially annotated, the preset fields are added, the mapping relationship between the attribute table fields and the font name is established, the font library is encoded, the vector slicing process is performed, and the user's zoom level and historical time period are rendered.

Benefits of technology

The direct correlation between symbol definition and actual geographical data is realized, the flexibility and efficiency of data visualization is enhanced, the standardization, modularity and reusability of symbolic systems are supported, the use of custom symbols is optimized, and it is suitable for complex geological map scenarios, avoiding errors and inconsistencies in symbolic technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577048B_ABST
    Figure CN119577048B_ABST
Patent Text Reader

Abstract

The present invention provides a method for standard symbolization of geological maps, an electronic device, and a storage medium, relating to the technical field of standard symbolization of geological maps. The method includes: obtaining target vector data related to geological data to be rendered; obtaining an initial annotation font list A; adding a preset field to each initial annotation font in A to obtain an intermediate annotation font list B corresponding to A; establishing a first mapping table QT; encoding the intermediate annotation fonts in QT to obtain a target font library C; performing slicing processing on the target fonts in C to obtain a vector slice list set D corresponding to each zoom level; rendering the target vector data according to the user's zoom level and C within a preset historical time period T0. The present invention can avoid problems such as insufficient flexibility and customization of the symbol system, cumbersome symbolization process, and easy introduction of errors that generally exist in the symbolization technology when dealing with complex thematic maps.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of geological map standard symbolization, and particularly to a method for standard symbolization of geological maps, an electronic device, and a storage medium. Background Art

[0002] At present, significant progress has been made in the application of geological map symbolization technology in the GIS field. Especially with the promotion of open-source GIS platforms, the automated rendering and symbolization operations of geological maps have become more flexible and efficient. Existing main technical frameworks such as SLD, SE, Mapbox Style Specification, etc. provide standardized solutions for the definition and management of map styles. However, the above solutions still have significant limitations when dealing with complex thematic maps, such as geological maps. For example, although SLD and SE provide basic symbolization functions, they perform inadequately when dealing with complex thematic symbols. For geological maps that require frequent custom symbols or style adjustments, the process of writing symbolization rules for SLD and SE is usually very cumbersome, requiring a large amount of manual operation and repetitive work. This not only increases the time cost of cartography but also easily introduces human errors, resulting in inconsistent symbolization. Mapbox Style Specification's style definition is too dependent on the structure of JSON objects, and it is still insufficient for the customization requirements of complex geological maps. Especially in scenarios where fine adjustment of symbol styles or customization of special symbols is required, Mapbox's style management ability is limited and difficult to meet the high-precision requirements of geological cartography.

[0003] Existing geological map rendering technologies usually rely on a fixed font storage structure, which is difficult to cope with the diverse requirements of annotation styles. In practical applications, the styles of annotations often need to be adjusted frequently. Existing technologies cannot automatically read and render these styles, resulting in cumbersome operations and easy occurrence of inconsistent styles. Existing rendering technologies lack systematic rule support for the expression of geological special annotation fonts, leading to inconsistent symbol expressions. Especially in complex thematic maps, it is easy to cause inaccurate symbolization, thus affecting the accuracy of geological information expression. When dealing with annotations, existing geological map rendering methods generally use static graphics or predefined symbol sets and lack the ability to perform vector slicing on fonts. This method is inefficient when rendering complex annotations and cannot meet the high-efficiency processing requirements of large-scale map data. Especially in scenarios with high-precision requirements, the rendering speed and quality of existing technologies are both limited. However, problems such as the rendering call and compatibility of special symbols during the rendering process of geological maps are prominent.

[0004] In addition to the limitations of the above technical framework, existing geological mapping software on the market, such as MapGIS, also has certain problems in terms of symbolization flexibility and ease of use. Although these traditional software are powerful, they often require users to perform complex manual operations when it comes to custom symbolization, which increases the difficulty and time cost of mapping. Due to the complexity of the symbolization process, errors are prone to occur, and accumulated small errors may have a serious impact on the mapping results.

[0005] In summary, when dealing with complex thematic maps, such as geological maps, existing symbolization technologies generally have problems such as insufficient flexibility and customization of the symbol system, cumbersome symbolization process, and easy introduction of errors. Summary of the invention

[0006] In view of the above technical problems, the technical solution adopted by the present invention is:

[0007] According to a first aspect of the present application, a method for standard symbolization of geological maps based on an open source GIS engine is provided, the method comprising the following steps:

[0008] S100, obtaining target vector data related to geological data to be rendered; wherein the target vector data includes geological element data and geological attribute data.

[0009] S200, obtaining each initial annotation font to obtain an initial annotation font list A=(A 1 , A 2 , …, A i , …, A n ), i=1, 2,...,n; where, A i The i-th initial annotation font obtained, n is the number of initial annotation fonts obtained; A i =(A i,1 , A i,2 , …, A i,j , …, A i,m ), j = 1, 2, ..., m; A i,j is the jth default attribute corresponding to the ith initial annotation font, and m is the number of default attributes corresponding to each initial annotation font.

[0010] S300, traverse A, add a preset field to each initial annotation font in A, so as to obtain the intermediate annotation font list B corresponding to A = (B 1 , B 2 , …, B i , …, B n ), where B i For A i The intermediate annotation font obtained after adding the preset field; B i =(TS i , Ai,1 , A i,2 , …, A i,j , …, A i,m );TS i For A i Added preset field; the preset field is used to record the preset mark of the corresponding annotation font.

[0011] S400, establishing a mapping relationship between the attribute table fields of the target vector data and the font name and spatial position of each intermediate annotation font in B to obtain a first mapping table QT; wherein QT includes n rows, each row corresponding to an intermediate annotation font.

[0012] S500, encode the intermediate annotation font in QT to obtain a target font library C = (C 1 , C 2 , …, C i , …, C n ), where C i For B i The target font obtained after encoding; C i =(PUA i , TS i , A i,1 , A i,2 , …, A i,j , …, A i,m );PUA i C i The corresponding code point.

[0013] S600, slicing the target font in C to obtain a vector slice list set D corresponding to each zoom level = (D 1 , D 2 , …, D p , …, D q ), p = 1, 2, ..., q; where D p is a list of vector slices obtained by slicing the target font in C at the pth zoom level, and q is the number of zoom levels.

[0014] S700, according to the preset historical time period T 0 The user's zoom level and C are used to render the target vector data; where T 0 The end time is the time point that is a preset time interval before the current time point.

[0015] According to another aspect of the present application, a non-transitory computer-readable storage medium is also provided, in which at least one instruction or at least one program is stored, and the at least one instruction or at least one program is loaded and executed by a processor to implement the above-mentioned standard geological map symbolization method.

[0016] According to another aspect of the present application, an electronic device is provided, including a processor and the above-mentioned non-transitory computer-readable storage medium.

[0017] The present invention has at least the following beneficial effects:

[0018] The standard symbolization method for geological maps of the present invention establishes a mapping relationship between the attribute table field of target vector data and the font name and spatial position of each intermediate annotation font in B; by mapping the font name with the attribute table field, a direct association between the symbol definition and the actual geographic data is achieved, thereby enhancing the flexibility and efficiency of data visualization; at the same time, by separating the symbol definition from the calling method, the standardization, modularization and reusability of the symbol system are achieved, allowing the symbol library to be flexibly updated in different projects; by using the private area code point method, the use of custom symbols is optimized, the readability and maintainability of the code are improved, and it is suitable for complex geological map scenes; thereby avoiding the problems that the symbolization technology generally has in processing complex thematic maps, such as insufficient flexibility and customization of the symbol system, cumbersome symbolization process, and easy introduction of errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0020] Figure 1 A flow chart of a method for standard symbolization of geological maps provided by an embodiment of the present invention;

[0021] Figure 2 A technical roadmap of a method for standardizing geological maps provided by an embodiment of the present invention;

[0022] Figure 3 A schematic diagram of a storage structure and expression rules provided by an embodiment of the present invention;

[0023] Figure 4 A schematic diagram of reasoning about the correspondence between annotation fonts provided in an embodiment of the present invention;

[0024] Figure 5 A schematic diagram of font library reconstruction relationship provided by an embodiment of the present invention;

[0025] Figure 6 A flow chart of annotated font vector slicing provided by an embodiment of the present invention;

[0026] Figure 7 A rendering logic diagram provided by an embodiment of the present invention;

[0027] Figure 8 A schematic diagram of a style adjustment function page provided by an embodiment of the present invention;

[0028] Fig. 9 A schematic diagram of a tile pyramid model provided by an embodiment of the present invention;

[0029] Fig.10 A schematic diagram of coordinate conversion provided by an embodiment of the present invention;

[0030] Fig.11 A vector tile structure diagram provided by an embodiment of the present invention;

[0031] Fig.12 A schematic diagram of a dynamic tile request provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0033] It should be noted that, based on the present disclosure, those skilled in the art should understand that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects described herein can be used to implement a device and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this device and / or practice this method.

[0034] The following will refer to Figure 1 The flowchart of the standard symbolization method for geological maps is shown, which introduces a standard symbolization method for geological maps.

[0035] The standard symbolization method of the geological map may include the following steps:

[0036] S100, obtaining target vector data related to geological data to be rendered; wherein the target vector data includes geological element data and geological attribute data.

[0037] In this embodiment, the Geopandas library can be used to read the vector data of geological data, and the relevant geological elements and attributes can be extracted through the data frame DataFrame structure; geological element data mainly refers to the location and morphological information of geological bodies or geological phenomena in geographic space, and this information is usually expressed in vector form. Specifically, geological element data may include: geological boundaries: such as fault lines, rock formation boundaries, etc., which are usually expressed as line elements; geological bodies: such as rock bodies, ore bodies, sedimentary layers, etc., which can be expressed as surface elements; geological points: such as sampling points, drilling locations, etc., which are usually expressed as point elements; these geological element data play a vital role in geological surveys, and they provide key information such as geological structure, stratigraphic distribution, and mineral resource distribution.

[0038] Geological attribute data refers to various attribute information related to geological elements. This information is usually associated with geological element data and is used to describe the characteristics and properties of geological elements. Geological attribute data may include: geological age: such as the age of strata formation; rock type: such as igneous rock, sedimentary rock, metamorphic rock, etc.; mineral composition: such as the type and content of minerals in rocks or ores; physical properties: such as the hardness, density, magnetism, etc. of rocks; chemical properties: such as the chemical composition and content of rocks or ores; these geological attribute data are of great significance for understanding the geological significance of geological elements, evaluating the potential of mineral resources, and predicting geological disasters.

[0039] S200, obtaining each initial annotation font to obtain an initial annotation font list A=(A 1 , A 2 , …, A i , …, A n ), i=1, 2,...,n; where, A i The i-th initial annotation font obtained, n is the number of initial annotation fonts obtained; A i =(A i,1 , A i,2 , …, A i,j , …, A i,m ), j = 1, 2, ..., m; A i,j is the jth default attribute corresponding to the ith initial annotation font, and m is the number of default attributes corresponding to each initial annotation font.

[0040] In this embodiment, the initial annotation font may correspond to several attributes, such as angle, font size, etc.; each initial annotation font and several attributes corresponding to each annotation font may be obtained.

[0041] S300, traverse A, add a preset field to each initial annotation font in A, so as to obtain the intermediate annotation font list B corresponding to A = (B 1 , B2 , …, B i , …, B n ), where B i For A i The intermediate annotation font obtained after adding the preset field; B i =(TS i , A i,1 , A i,2 , …, A i,j , …, A i,m );TS i For A i Added preset field; the preset field is used to record the preset mark of the corresponding annotation font.

[0042] In this embodiment, in order to solve the problem of how to express special characters, Figure 3 As shown, a preset field is added to the annotation font storage organization node, for example: the preset field is a TextString field; the preset field content is expressed in a markup language based on the HTML hypertext markup language, which is used to add structure and style information, based on tags in angle brackets (<>), which tell the browser or other parsers how to display or process the text content.

[0043] The following are commonly used expressions in geological map annotations to indicate different geological information:

[0044] Superscript ( ), indicating a specific age or stage: superscripts are often used to indicate a more detailed geological age or event. Indicating rock type: in stratigraphic nomenclature, superscripts can also indicate specific lithological units.

[0045] Subscript( ), indicating a level of subdivision: Subscripts are often used to indicate further subdivision of a geological unit. Indicating a specific mineralization event: In mineral deposit geology, subscripts may be used to indicate a specific mineralization stage or event.

[0046] Italics, indicating stratigraphic or tectonic units: Italics are often used to indicate stratigraphic units, rock names, or tectonic names. Indicating fossil names: When describing paleontological fossils, italic letters are used to indicate genus and species names.

[0047] Bold, to indicate important or prominent geological features: Bold is often used to emphasize specific geological structures or layers. To indicate important chronological units: In the geological time scale, bold is used to emphasize major geological periods or events.

[0048] Underscore ( ) To indicate an undetermined or hypothetical geological unit: Underscores are sometimes used to indicate geological units that have not yet been determined or features that are conjectural. To indicate a discontinuity or concealed fault: In some cases, underscores can be used to indicate unexposed or discontinuous geological structures.

[0049] Compound symbols, combining subscripts and subscripts: such as G 1 t 2 It indicates a specific layer or stage in a major geological unit, and the expression method is more refined; arrow symbols: →, ←, ↑, ↓ and other arrow symbols can be used to indicate the directionality of geological phenomena.

[0050] In the embodiment, the rendering method of geological map annotations and special symbols is optimized, especially the storage organization structure of annotation fonts is adjusted in depth. By adding fields such as angle, font size, font style, character width, character spacing, vertical alignment and text string, the flexibility and accuracy of the GIS rendering engine in the annotation rendering process are improved through these field information.

[0051] Furthermore, the above method can solve the limitations of existing technologies or products in annotation and symbol rendering, especially the difficulty in achieving high-precision and diversified symbolic expressions in complex geological maps. By optimizing the storage structure, the rendering engine can automatically configure the annotation style more intelligently, making the symbolic presentation of geological maps more consistent and professional, thereby meeting higher standards of geological mapping requirements.

[0052] S400, establishing a mapping relationship between the attribute table fields of the target vector data and the font name and spatial position of each intermediate annotation font in B to obtain a first mapping table QT; wherein QT includes n rows, each row corresponding to an intermediate annotation font.

[0053] like Figure 4 As shown, a mapping relationship between the attribute table field STYKLEBNAMB and the font name and its corresponding spatial position is established.

[0054] S500, encode the intermediate annotation font in QT to obtain a target font library C = (C 1 , C 2 , …, C i , …, C n ), where C i For B i The target font obtained after encoding; C i =(PUA i , TS i , A i,1 , A i,2 , …, A i,j , …, A i,m );PUAi C i The corresponding code point.

[0055] like Figure 5 As shown, the encoding of special symbols in the original geological font library cannot be directly and correctly called by the rendering engine. Therefore, the geological font library is reconstructed and re-encoded using the FontStore online editor according to the association rules, and then the correct call is achieved.

[0056] The key points to locate a font in a .ttf font library are Unicode encoding and character names. Font files usually contain a mapping of characters to Unicode encoding; each character corresponds to a unique Unicode code point, which is used to identify characters consistently across different systems and platforms. Each character has a unique code point in the Unicode standard, which is usually represented as U+ followed by a string of hexadecimal numbers, encoded in UTF-8, using 1 to 4 bytes to encode each character. It is a variable-length encoding that is widely used, especially on the Internet and web pages.

[0057] In order to correspond to the field information of the geological data attribute table, the character names and private use area (PUA) code points are rewritten in the font library, the character names are associated with the field information of the geological attribute table, and the characters are rendered with the private use area code points corresponding to the character names.

[0058] By mapping the character names in the .ttf file with the GIS attribute table fields, the symbol definition is directly associated with the actual geographic data, thereby enhancing the flexibility and efficiency of data visualization. At the same time, by separating the symbol definition from the calling method, the standardization, modularization and reusability of the symbol system are achieved, allowing the symbol library to be flexibly updated in different projects. The use of private area code points is optimized, the readability and maintainability of the code are improved, and it is suitable for complex geological map scenes.

[0059] In this embodiment, the symbols of the special geological library are unicode-encoded to facilitate the adjustment of font symbols to obtain a set of self-encoded geological symbol libraries; a unique private area code point (in the range of U+E000 to U+F8FF) is assigned to each character to ensure that these code points do not conflict with standard Unicode characters. Maintain a mapping dictionary to associate character names with their corresponding PUA code points. According to the information in the geological attribute table field, rewrite the character name to be consistent with the attribute field of the geological data; name the characters according to the type or content of the geological attribute for easy identification and retrieval; construct a coding table containing character names and PUA code points. This table is a JSON object for subsequent search and use.

[0060] S600, slicing the target font in C to obtain a vector slice list set D corresponding to each zoom level = (D 1 , D 2 , …, D p , …, D q ), p = 1, 2, ..., q; where D p is a vector slice list obtained by slicing the target font in C at the pth zoom level, and q is the number of zoom levels.

[0061] Further, step S600 may include the following steps:

[0062] S610: For any zoom level, convert each annotation font in C into vector path data.

[0063] S620: Use a preset geometric simplification algorithm to simplify the vector path data corresponding to each annotation font.

[0064] S620: Convert the simplified vector path data into GeoJSON format, and perform gzip compression on the data in GeoJSON format.

[0065] In this embodiment, the annotation font is converted into vector path data using a font processing library (FreeType); each character, that is, the outline and shape of the annotation font is represented as a series of coordinate points and path instructions; during the vectorization process, the details and proportions of the characters are ensured to be consistent; the characters are normalized to ensure consistent display effects at different zoom levels; the vector data is cut into multiple layers according to different map zoom levels; several zoom levels are defined, such as: 1x, 2x, 4x, etc., and corresponding character slices are generated for each level; each layer should contain detailed path data corresponding to the zoom level; the slicing process of the annotation font is as follows Figure 6 shown.

[0066] Use conditional judgment to select appropriate character outlines based on the current zoom level; apply geometric simplification algorithms, such as the Ramer-Douglas-Peucker algorithm; simplify vector paths to reduce the number of path points and the amount of data; ensure readability at high zoom levels while improving rendering performance; convert the generated character slice data to GeoJSON format to ensure that the path information, hierarchy, and zoom level of each character are clearly expressed in the GeoJSON object; gzip compress the GeoJSON data to reduce storage requirements and transmission time.

[0067] The slice content of annotation fonts mainly involves the outline and shape of characters, which is usually fine path data. These data require the clarity and readability of the fonts at various zoom levels, and usually also need to deal with the details, proportions and layout of the characters. The annotation font vector tiling technology achieves efficient dynamic rendering by vectorizing complex annotation fonts and cutting them into small slices that adapt to different map zoom levels. The vector information of the annotation font is divided into multiple levels, each corresponding to a different zoom level; these slice data are stored in GeoJSON format and optimized through a geometric simplification algorithm to reduce the amount of data, while using gzip compression technology to further reduce storage requirements.

[0068] During the map rendering process, the system automatically calls the corresponding slice according to the current zoom level and accurately renders it through Canvas; to ensure the display effect, anti-aliasing and smoothing technology will be applied during the rendering process to prevent jagged edges of fonts and ensure the clarity and accuracy of annotation fonts at various zoom levels.

[0069] S700, according to the preset historical time period T 0 The user's zoom level and C are used to render the target vector data; where T 0 The end time is the time point that is a preset time interval before the current time point.

[0070] In this embodiment, when the user operates the geological map, the user will continuously zoom in and out the geological map within a certain period of time to find a view that meets the user's requirements; if the geological map is rendered after determining the zoom level selected by the user, the user needs a certain waiting time. Therefore, the following steps are provided to solve the above problem: 0 Explanation: For example, the current time is 9:00:00, the preset time interval is 10 seconds, T 0 The duration is 30 seconds, then T 0 The time period is between 8:59:20-8:59:50.

[0071] Further, step S700 may include the following steps:

[0072] S710, get T 0 Each historical zoom level operated by the user in the image is used to obtain a historical zoom level list γ = (γ 1 , γ 2 , …, γ u , …, γ v ), u=1, 2,...,v; among them, γ u T 0 The historical zoom level corresponding to the user’s u-th zoom operation, v is T 0 The number of user zoom operations within the page.

[0073] In this embodiment, at T 0 Within, the user will perform several zoom operations to obtain T 0 Each zoom operation is performed to obtain γ; the zoom level can range from 0 to 22.

[0074] S720: Determine a first intermediate zoom level QE according to γ 1 =rounddown((∑ v u=1 γ u ) / v) and the second zoom level QE 2 =roundup((∑ v u=1 γ u ) / v); where rounddown() is the preset rounding down function; roundup() is the preset rounding up function.

[0075] S730, if QE 1 =QE 2 , then QE 1 -1. QE 1 and QE 1 +1 OK for the target zoom level.

[0076] In this embodiment, if QE 1 =QE 2 , indicating (∑ v u=1 γ u ) / v is divisible, so the zoom level required by the user may be QE 1 -1. QE 1 and QE 1 +1, QE 1 -1. QE 1 and QE 1 +1 OK for the target zoom level.

[0077] S740, if QE 1 ≠QE 2 , then QE 1 -1. QE 1 , QE 2 and QE 1 +1 OK for the target zoom level.

[0078] In this embodiment, QE 1 ≠QE 2 , indicating (∑ v u=1 γ u) / v is not divisible, so the zoom level required by the user may be QE 1 -1. QE 1 , QE 2 and QE 1 +1, QE 1 -1. QE 1 , QE 2 and QE 1 +1 OK for the target zoom level.

[0079] S750, before rendering the target vector data, rendering the annotation fonts in the vector slice list corresponding to the target zoom level in D.

[0080] In this embodiment, after the target zoom level is determined through several zoom operations of the user in T0, the annotation fonts in the vector slice list corresponding to the target zoom level in D can be rendered first, that is, the zoom level required by the user is predicted in advance and rendered in advance, thereby reducing the user's waiting time and improving rendering efficiency.

[0081] Furthermore, after step S750, the method may further include the following steps:

[0082] S760, obtaining a target display area of ​​the target vector data at a target zoom level.

[0083] In this embodiment, when the user zooms in and out on the geological map corresponding to the target vector data, the middle area of ​​the display is the target display area; under normal circumstances, the user will place the required area in the middle area of ​​the display.

[0084] S761, dividing the target display area into a number of adjacent initial grids to obtain an initial grid list E corresponding to the target display area = (E 1 , E 2 ,…,E a ,…,E b ), a=1, 2, …, b; where E a is the ath initial grid corresponding to the target display area, and b is the number of initial grids corresponding to the target area.

[0085] In this embodiment, the target display area may be divided into a number of adjacent initial grids, and the initial grids may be rectangular grids of the same size.

[0086] S762, obtaining the number of geological elements in each initial grid in E, so as to obtain a list of geological element numbers corresponding to E, SE = (SE 1 , S.E. 2 ,…,SE a ,…,SE b), where SE a For E a The number of geological features within.

[0087] In this embodiment, the distribution of geological elements on the geological map may be dense in some areas and sparse in others. Therefore, the number of geological elements in each initial grid may not be the same.

[0088] S763, sorting the number of geological elements in SE from large to small to obtain a sorted geological element number list SE'=(SE' 1 , SE' 2 ,…,SE' a ,…,SE' b );SE' a is the number of the ath geological element obtained after sorting the number of geological elements in SE.

[0089] S764, obtain a preset value M=1.

[0090] S765, for SE' M The target vector data in the corresponding initial grid is rendered; enter S766.

[0091] S766, if M<y, obtain M=M+1 and enter S765; otherwise, jump out of the current processing.

[0092] In this embodiment, through the above steps, after the target zoom level is determined, the area with the largest number of geological elements is rendered first, so that the user can first see the area with more geological elements.

[0093] Further, create a Mapbox account and obtain an API key; build a basic map to define a container for rendering the map, import the Mapbox GL JS library and initialize the Mapbox map;

[0094] Use Mapbox's addSource method to load thematic data into the map.

[0095] In this embodiment, Mapbox is used to load thematic data vector tiles into the map, and the addLayer method is used to add vector and raster data layers, and the style parameters of the layers are configured according to geological requirements; for example: symbolization settings, color bands, etc.

[0096] Vector data uses fill-layer and line-layer styles, and raster data layers use raster-layer styles. Define an independent data source layer (source-layer) for each layer so that vector and raster data can be displayed together on the same map and ensure data clarity and color accuracy.

[0097] Read the mapping relationship between the attribute table and the font library, such as Figure 7 shown.

[0098] Furthermore, the rendering of the target vector data comprises the following steps:

[0099] S770, use the addLayer method to render the target vector data onto the map in a preset style and adjust it through the style function of Mapbox.

[0100] In this embodiment, the addLayer method is used to render the GeoJSON annotation font slice data onto the map in a specific style, and the vector symbol style (symbol layer) is used to ensure the accurate positioning, rotation, scaling and interaction effects of the characters on the map, such as Figure 8 shown.

[0101] S771, construct a tile pyramid model.

[0102] like Fig. 9 As shown, a tile pyramid model is constructed.

[0103] S772, generates PostGIS SQL statements using dynamic vector slicing technology from the tile coordinates passed in by the front end.

[0104] In this embodiment, Fig.10 As shown, the tile coordinates (z, x, y) passed in by the front end are used to generate the SQL statement of PostGIS through dynamic vector slicing technology.

[0105] Ordinary vector tile slicing mainly involves the segmentation of geometric elements such as points, lines, and surfaces on the map. The complexity and data volume of these elements are often large, and the focus is on the correct projection and visualization of geographic spatial data. The construction of vector tile services involves the construction of tile pyramid models, the mapping relationship between tile coordinate systems and spatial coordinate systems, the determination of slicing schemes, the setting of tile sizes and resolutions, and the encoding and decoding of vector data to vector tiles. In order to meet the user's browsing needs for maps of different scales, the corresponding levels are loaded according to user needs. Each level of the map is sliced ​​to form a small square pixel range, called a tile. Each tile has a unique coordinate (z, x, y), where z represents the level of the tile, x represents the column number of the tile, and y represents the row number of the tile.

[0106] The dynamic vector slicing technology is used to trigger the rendering and real-time update of vector data when the front-end initiates a request. The PostGIS SQL statement is generated according to the tile coordinates (z, x, y) passed in by the front-end. The stored vector data is converted and encoded into vector tiles using the PostGIS vector tile generation function. There are two coordinate systems involved in the PostGIS SQL statement, one of which is the spatial coordinate system of the vector data stored in the POI table and corresponds to the table creation statement, and the other is the Web Mercator plane projection coordinate system used for map visualization. In the SQL statement, through a series of function calls, the vector data corresponding to a tile is queried, the geographic coordinates are converted to projection coordinates, the projection coordinates are converted to pixel coordinates, and then the vector data represented by the pixel coordinates is encoded to obtain a vector tile.

[0107] S773, use the vector tile generation function of PostGIS to convert the coordinates of the stored target vector data and encode them into vector tiles.

[0108] like Fig.11 As shown, the stored target vector data is coordinate-converted and encoded into vector tiles using the vector tile generation function of PostGIS.

[0109] S774, add interactive functions to the map.

[0110] In this embodiment, an interactive function is added to the map through the map.on('click', function(e){...}) method.

[0111] S775, render the geological map to the front end.

[0112] In this embodiment, Fig.12 As shown in the figure, the geological map is rendered to the front end by loading vector tiles through Mapbox; the annotation font vector tiles and geological layer vector tiles are loaded using the addLayer method and efficiently rendered to the front end.

[0113] In geological map rendering applications, existing technologies or products often face the problem of insufficient flexibility and precision in symbol rendering. Traditional rendering methods rely on predefined symbol sets and static vector graphics, which makes it difficult to meet users' needs for symbol management, dynamic updates, and personalized customization when processing maps or complex geological data containing a large number of special symbols. In addition, the existing technology renders customized symbols, and the symbol mapping and management are complex, and the maintenance cost of symbols continues to rise. These limitations significantly reduce the visualization quality and operational efficiency of the data, especially in application scenarios that require frequent updates and dynamic adjustments of symbols, and traditional technologies are difficult to provide sufficient flexibility and precision.

[0114] This patent realizes the efficient rendering and flexible management of symbols through Canvas technology. The pixel-level control ability of Canvas makes the drawing and display of symbols more precise, supports real-time dynamic vector slicing, thus realizing the personalized customization and dynamic adjustment of symbols. By using private use area code points, developers can avoid the limitations of standard Unicode code points and freely define and use a large number of custom symbols. This method not only optimizes the compatibility and scalability of the symbol system, but also simplifies the management and maintenance process of symbols. In addition, the client-side rendering mode of Canvas greatly improves the performance of the system, making the symbol rendering more efficient and smooth when dealing with large-scale GIS data.

[0115] Compared with traditional technologies, this patent provides a more flexible, precise and efficient symbol rendering solution, which is particularly suitable for complex geological map rendering scenarios. By combining the dynamic rendering ability of Canvas and the custom symbol system of PUA code points, this patent significantly improves the flexibility of symbol management and the effect of data visualization.

[0116] In this embodiment, by optimizing the storage structure of annotation fonts, automatically reading and rendering annotation styles, the style consistency is improved, and the manual operations and error rates are reduced. Introducing a unified annotation character expression rule ensures the accurate and consistent expression of complex symbols, such as superscripts and subscripts, and reduces the problem of inaccurate symbolization. By performing vector slicing on annotation fonts, the rendering speed and quality are improved, especially when dealing with large-scale and high-precision map data. Reconstructing the geological font library to support Unicode encoding realizes the flexible invocation and cross-platform compatibility of symbols, and improves the scalability and adaptability of the symbol system. Compared with the prior art, it significantly improves the mapping efficiency between symbols and geographical data, simplifies the development and maintenance processes, optimizes the map rendering performance, and ensures the consistent display of symbols on multiple platforms, meeting the complex requirements of modern geological map symbolization.

[0117] In addition, although the steps of the methods in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be performed in that specific order, or that all the shown steps must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0118] The embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one segment of program related to a method for implementing a method in the method embodiment. The at least one instruction or the at least one segment of program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0119] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0120] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0121] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0122] Program code for performing the operations of the present application may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0123] An embodiment of the present invention further provides an electronic device, comprising a processor and the aforementioned non-transitory computer-readable storage medium.

[0124] The electronic device is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0125] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one memory mentioned above, and a bus connecting different system components (including the memory and the processor).

[0126] The memory stores program codes, which can be executed by the processor, so that the processor executes the steps in various embodiments described in this specification.

[0127] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).

[0128] The memory may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.

[0129] The bus may represent one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.

[0130] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0131] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.

[0132] An embodiment of the present invention further provides a computer program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute the steps of the method according to various exemplary embodiments of the present invention described above in this specification.

[0133] Although some specific embodiments of the present invention have been described in detail by way of example, it should be understood by those skilled in the art that the above examples are only for illustration, not for limiting the scope of the present invention. It should also be understood by those skilled in the art that various modifications may be made to the embodiments without departing from the scope and spirit of the present invention.

Claims

1. A method for standard symbolization of geological maps, characterized in that: The method comprises the following steps: S100, obtaining target vector data related to the geological data to be rendered; wherein the target vector data includes geological element data and geological attribute data; S200, obtaining each initial annotation font to obtain an initial annotation font list A=(A1, A2, ..., A i , …, A n ), i=1, 2,...,n; among them, A i The i-th initial annotation font obtained, n is the number of initial annotation fonts obtained; A i =(A i,1 , A i,2 , …, A i,j , …, A i,m )、j=1,2,…,m;A i,j is the jth default attribute corresponding to the ith initial annotation font, and m is the number of default attributes corresponding to each initial annotation font; S300, traverse A, add a preset field to each initial annotation font in A, so as to obtain the intermediate annotation font list B corresponding to A = (B1, B2, ..., B i , …, B n ); where B i For A i The intermediate annotation font obtained after adding the preset field; B i =(TS i , A i,1 , A i,2 , …, A i,j , …, A i,m );TS i For A i Added preset field; the preset field is used to record the preset mark of the corresponding annotation font; S400, establishing a mapping relationship between the attribute table field of the target vector data and the font name and spatial position of each intermediate annotation font in B to obtain a first mapping table QT; wherein QT includes n rows, each row corresponding to an intermediate annotation font; S500, encode the intermediate annotation font in QT to obtain a target font library C = (C1, C2, ..., C i , …, C n ); where C i For B i The target font obtained after encoding; C i =(PUA i , TS i , A i,1 , A i,2 , …, A i,j , …, A i,m );PUA i C i The corresponding code point; S600, slicing the target font in C to obtain a vector slice list set D corresponding to each zoom level = (D1, D2, ..., D p , …, D q ), p = 1, 2, …, q; where D p is a vector slice list obtained by slicing the target font in C at the pth zoom level, and q is the number of zoom levels; S700, rendering the target vector data according to the user's zoom level and C in a preset historical time period T0; wherein the end time of T0 is a time point that is a preset time interval before the current time point.

2. The method for standardizing geological maps according to claim 1, characterized in that: Step S700 includes the following steps: S710, obtaining each historical zoom level operated by the user within T0, to obtain a historical zoom level list γ = (γ1, γ2, ..., γ u , …, γ v ), u=1, 2,...,v; among them, γ u is the historical zoom level corresponding to the user's u-th zoom operation in T0, and v is the number of zoom operations performed by the user in T0; S720, according to γ, determine the first intermediate zoom level QE1=rounddown((∑ v u=1 γ u ) / v) and the second zoom level QE2=roundup((∑ v u=1 γ u ) / v); where rounddown() is the preset downward rounding function; roundup() is the preset upward rounding function; S730, if QE1=QE2, then QE1-1, QE1 and QE1+1 are determined as target zoom levels; S740, if QE1≠QE2, determine QE1-1, QE1, QE2 and QE1+1 as the target zoom levels; S750, before rendering the target vector data, rendering the annotation fonts in the vector slice list corresponding to the target zoom level in D.

3. The method for standard symbolization of geological maps according to claim 2, characterized in that: After step S750, the method further includes the following steps: S760, obtaining a target display area of ​​the target vector data at a target zoom level; S761, dividing the target display area into a number of adjacent initial grids to obtain an initial grid list E=(E1, E2, . . . , E a ,…,E b ), a=1, 2, …, b; where E a is the ath initial grid corresponding to the target display area, and b is the number of initial grids corresponding to the target area; S762, obtaining the number of geological elements in each initial grid in E, so as to obtain a list of geological element numbers corresponding to E, SE = (SE1, SE2, ..., SE a ,…,SE b ); where SE a For E a the number of geological elements within; S763, sorting the number of geological elements in SE from large to small to obtain a sorted list of geological elements SE' = (SE'1, SE'2, ..., SE' a ,…,SE' b );SE' a is the number of the ath geological element obtained after sorting the number of geological elements in SE; S764, obtaining a preset value M=1; S765, to SE' M Render the target vector data in the corresponding initial grid; enter S766; S766, if M<y, obtain M=M+1 and enter S765; otherwise, jump out of the current processing; where y is the row number of the tile.

4. The method for standard symbolization of geological maps according to claim 1, characterized in that: Step S600 includes the following steps: S610, for any zoom level, convert each annotation font in C into vector path data; S620, using a preset geometric simplification algorithm to simplify the vector path data corresponding to each annotation font; S630: Convert the simplified vector path data into GeoJSON format, and perform gzip compression on the data in GeoJSON format.

5. The method for standard symbolization of geological maps according to claim 1, characterized in that: The rendering of the target vector data comprises the following steps: S770, use the addLayer method to render the target vector data onto the map in a preset style, and adjust it using the style function of Mapbox; S771, construct tile pyramid model; S772, generates a PostGIS SQL statement using the tile coordinates passed in by the front end through dynamic vector slicing technology; S773, using the vector tile generation function of PostGIS to convert the stored target vector data into coordinates and encode them into vector tiles; S774, add interactive functions to the map; S775, render the geological map to the front end.

6. The method for standard symbolization of geological maps according to claim 1, characterized in that: PUA i It is a private area code point.

7. The method for standard symbolization of geological maps according to claim 1, characterized in that: The initial annotation font is obtained through the preset ttf font library.

8. A non-transitory computer-readable storage medium, wherein at least one instruction or at least one program is stored in the storage medium, characterized in that: The at least one instruction or the at least one program is loaded and executed by the processor to implement the standard symbolization method for geological maps as described in any one of claims 1-7.

9. An electronic device, characterized in that: Includes a processor and the non-transitory computer-readable storage medium of claim 8.

Citation Information

Patent Citations

  • Geological map database establishing device and geological map database establishing device method based on geological database

    CN105760536A

  • Ocean thematic drawing automatic compilation method based on task flow

    CN106204684A