A lithology symbol density scaling method based on CIM node type identification
Patent Information
- Application Number
- CN202611499854.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
其一,多档位静态符号方案需预先为同一岩性设计多套疏密程度不同的符号文件,通过比例尺阈值在档位间切换,不仅符号制作与维护的人工成本高,且比例尺跨越阈值时存在明显视觉跳变,无法实现连续平滑的疏密过渡;其二,表达式绑定方案需借助GIS平台内置的表达式引擎,为符号图层的指定属性逐一绑定比例尺关联表达式,配置工作量随符号结构复杂度上升急剧增加,新增符号类型时难以自动复用,整体实现与维护成本较高;其三,整体等比缩放方案未区分符号的重复间距属性与本体尺寸属性,在调整疏密度的同时会同步改变字符尺寸、线条宽度、标记几何形状等本体参数,易导致文字标注变形糊连、符号形态失真,损害了地质符号的可读性与规范一致性
1、本发明采用统一的选择性递归遍历算法,结合可配置的节点类型-间距字段分类规则表,无需针对每个符号的每个图层属性单独编写比例尺关联表达式;新增CIM节点类型的疏密度自适应能力时,仅需在分类规则表中增补映射条目,无需修改遍历算法逻辑,降低了岩性符号疏密度自适应功能的开发与维护成本。
Smart Images

Figure CN123012074A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of geographic information systems and computer mapping technology, and in particular to a method for scaling the density of lithological symbols based on CIM node type identification. Background Technology
[0002] Regional geological maps are core professional maps characterizing the distribution of lithology on the Earth's surface, playing a vital supporting role in basic geological surveys, mineral resource exploration, and land spatial planning. With the rapid development of web-based geographic information system (GIS) technology, browser-based vector map rendering engines have become the mainstream method for online visualization of regional geological maps. Currently, the industry generally follows CIM mapping standards, using structured JSON data to describe lithological planar fill symbols. Through the combination and overlay of layers such as CIMHatchFill equally spaced fill lines and repeated placement of CIMVectorMarker vector markers, lithological patterns conforming to the national standard "Legend of Regional Geological Maps" (GB / T 958-2015) are rendered in a tiled manner, ensuring the standardized and regulated expression of geological maps.
[0003] To ensure visual readability across different map scales, lithological symbols typically require dynamic density adjustment with view scaling. However, existing solutions still have significant technical limitations. First, multi-level static symbols require pre-designing multiple sets of symbol files with varying density for the same lithology, switching between levels using scale thresholds. This not only incurs high manual costs for symbol creation and maintenance but also results in noticeable visual jumps when scales cross thresholds, failing to achieve a smooth, continuous density transition. Second, expression-binding solutions rely on the GIS platform's built-in expression engine to bind scale-related expressions to specific attributes of symbol layers one by one. The configuration workload increases dramatically with symbol structural complexity, and automatic reuse is difficult when new symbol types are added, leading to high overall implementation and maintenance costs. Third, the overall proportional scaling solution fails to distinguish between symbol repetition spacing and body size attributes. Adjusting density simultaneously changes body parameters such as character size, line width, and marker geometry, easily causing distorted and blurred text annotations and inaccurate symbol forms, compromising the readability and standardization of geological symbols. Summary of the Invention
[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0005] In view of the aforementioned existing problems, this invention is proposed. Therefore, this invention provides a lithological symbol density scaling method based on CIM node type identification to solve the problems mentioned in the background art.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: a method for scaling the density of lithological symbols based on CIM node type identification, comprising: S1: Construct a lithological symbol ontology JSON data structure conforming to CIM specifications. The symbol ontology JSON data structure contains multiple symbol layer nodes with type identifier fields. S2: Pre-establish a classification rule table that maps node type identifiers to one or more spacing field names; S3: Get the scaling factor corresponding to the current scale or density adjustment parameter of the map view; S4: Perform a recursive traversal of the symbol ontology JSON data structure. When traversing to a certain node, determine whether the type identifier of the node exists in the classification rule table. If it exists, apply the scaling factor to the attribute in the node that matches the spacing field name registered in the classification rule table and has a value of numeric type. If it does not exist, do not modify any attribute of the node, and recursively execute this step on all sub-attributes of the node until the traversal is completed. S5: Convert the symbol JSON data structure obtained after traversal into a renderable CIM symbol object for rendering lithological surface features of the Web map.
[0007] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention adopts a unified selective recursive traversal algorithm, combined with a configurable node type-spacing field classification rule table, eliminating the need to write separate scale association expressions for each layer attribute of each symbol; when adding the density adaptive capability of CIM node types, only mapping entries need to be added to the classification rule table, without modifying the traversal algorithm logic, thus reducing the development and maintenance costs of the lithological symbol density adaptive function.
[0008] 2. This invention clearly distinguishes between spacing fields and symbol ontology fields through a classification rule table. During the recursive traversal, only the spacing attribute of the matching rule is scaled. Symbol ontology parameters such as character size, line width, and marker geometric shape coordinates always maintain their original design values. This fundamentally avoids the problems of text deformation, stroke blurring, and symbol shape distortion caused by the overall proportional scaling scheme, ensuring the standard readability of geological symbols before and after density adjustment.
[0009] 3. This invention achieves density adjustment by continuously scaling the spacing field, replacing the traditional multi-level static symbol switching scheme, and there is no visual jump at the scale threshold; moreover, the algorithm does not rely on the parsing and evaluation of the expression engine, has low computational overhead, and can dynamically and smoothly change with the map view scale or user interaction parameters, meeting the response requirements of real-time rendering of web maps. Attached Figure Description
[0010] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a general flowchart illustrating one embodiment of the present invention; Figure 2 This is a system architecture diagram according to an embodiment of the present invention; Figure 3 This is a flowchart of a selective recursive traversal algorithm according to an embodiment of the present invention; Figure 4 This is a schematic diagram of the node type and spacing field classification rule table structure according to an embodiment of the present invention; Figure 5 This is a comparison diagram showing the symbology fidelity of the method described in one embodiment of the present invention with that of the overall proportional scaling scheme. Detailed Implementation
[0011] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0012] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0013] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0014] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0015] Example 1
[0016] Reference Figures 1 to 5 This is the first embodiment of the present invention, which provides a method for scaling the density of lithological symbols based on CIM node type identification, including: S1: Construct a lithological symbol ontology JSON data structure conforming to CIM specifications. The symbol ontology JSON data structure contains multiple symbol layer nodes with type identifier fields.
[0017] Furthermore, based on the lithological pattern library specified in the national standard "Regional Geological Map Legend" (GB / T 958-2015), the symbol construction module decomposes each lithological pattern into several symbol layers with clear CIM node type identifiers (i.e., type field), and assembles them into a CIMPolygonSymbol type JSON data structure that conforms to CIM specifications, which serves as the symbol ontology of that lithology.
[0018] It should be noted that the symbol ontology JSON data structure includes character marker nodes (CIMCharacterMarker) used to represent lithological component text annotations, as well as nodes (CIMVectorMarker, CIMSolidStroke, and CIMSolidFill, etc.) used to describe the shape, line style, and fill color of the marker ontology.
[0019] Furthermore, such as Figure 2 As shown, the execution architecture of this invention includes a national standard SVG regional geological lithology pattern library, a symbol construction module, a CIM symbol ontology JSON data structure, a node type and field classification rule table, a map view scale change event, a spacing scaling module, and a Web map rendering engine. The symbol construction module assembles lithology patterns into a CIM symbol ontology JSON containing spatial layer nodes. The spacing scaling module responds to the scale change event and performs selective recursive scaling on the matched spacing fields according to the classification rule table. The scaled CIM symbols are then submitted to the Web map rendering engine for display.
[0020] S2: Pre-establish a classification rule table that maps node type identifiers to one or more sets of spacing field names.
[0021] Furthermore, this classification rule table uses the CIM node type identifier as the key and the set of attribute field names that should participate in density scaling under that node type as the value. It clearly distinguishes between spacing fields and symbol ontology fields. In this embodiment, the classification rule table registers at least the following core rules: A node with the type identifier CIMMarkerPlacementInsidePolygon (used to describe the repeating placement rules of point, line, or composite graphic markers inside a polygon feature) has a set of spacing field names including: horizontal step (stepX), vertical step (stepY), horizontal offset (offsetX), and vertical offset (offsetY).
[0022] A node with the type identifier CIMHatchFill (used to describe equally spaced fill lines) has a corresponding set of spacing field names: fill line spacing separation.
[0023] Preferably, the classification rule table supports the dynamic addition of new node type identifiers and corresponding spacing field name sets of mapping entries, and the addition process does not require modification of the algorithm logic of the recursive traversal described in S4, thus possessing strong scalability.
[0024] Furthermore, such as Figure 4 As shown, the classification rule table at least registers stepX, stepY, offsetX, and offsetY for CIMMarkerPlacementInsidePolygon, and separation for CIMHatchFill. Fields representing symbol body size, character size, line width, or geometric coordinates, such as size of CIMVectorMarker, size of CIMCharacterMarker, width of CIMSolidStroke, and rings or paths in geometry, are not registered as fields to be scaled, so that they remain unchanged in subsequent recursive traversals.
[0025] S3: Get the scaling factor corresponding to the current scale or density adjustment parameter of the map view.
[0026] Furthermore, a listener event is registered in the web-based map rendering engine to detect changes in the current map view scale (or equivalent zoom level, density adjustment control values). When a change in scale is detected, or when the user actively adjusts the density parameters through interactive controls, a scaling factor is dynamically calculated. .
[0027] It should be noted that this dynamic calculation mechanism enables the density of the lithological symbols to change continuously and smoothly with map scaling, avoiding the visual jump problem that occurs when the scale of traditional multiple static symbol schemes crosses the threshold.
[0028] S4: Perform a selective recursive traversal on the symbol ontology JSON data structure.
[0029] Specifically, such as Figure 3 As shown, when traversing to a certain node, it is determined whether the type identifier of that node matches the classification rule table. The specific recursive traversal algorithm strictly follows the following logic: (i) Determine whether the currently traversed node obj is an array type. If it is, recursively execute this step for each element in the array. (ii) Determine whether the currently traversed node obj is a non-empty object type. If not (i.e., it is a basic type such as number or string), terminate the current recursion and do not perform any processing. (iii) If obj is a non-empty object type, then read the value of its type field and search in the classification rule table described in S2 whether there is a mapping entry that matches the type value; (iv) If a match is found: retrieve the set of spacing field names corresponding to that entry. For each attribute in obj whose field name is included in this set and whose field value is a numeric type, apply the scaling factor. Perform numerical scaling. The scaling formula can be as follows:
[0030] in, This represents the scaled spacing attribute value. This represents the original spacing attribute value before scaling. This represents the scaling factor obtained in S3.
[0031] It should be noted that this formula enables in-place modification of the spacing field.
[0032] Furthermore, if a search fails, no numerical modifications are made to any of the node's attributes. For example, for nodes whose type identifiers are not registered in the classification rule table (including size representing the marker body size, line width, character size, geometry, etc.), their attribute values are not modified. This ensures that the character size and line thickness of text annotations remain unchanged during scaling, guaranteeing consistency in the size and shape of the symbol body before and after scaling.
[0033] Furthermore, by using the above-mentioned method of scaling only the spacing field for hit nodes and keeping the body field unchanged for missed nodes, a result can be formed as follows: Figure 5 The symbol body fidelity shown is as follows: Compared with the overall proportional scaling that causes characters to be enlarged, deformed or blurred, the present invention only changes the repetition spacing and phase offset, without changing the character, line width and graphic body size, so that the lithological symbols still maintain a recognizable standard legend shape under different density conditions.
[0034] (v) Regardless of the search result, continue to traverse all other sub-properties of obj, recursively executing (i) to (v) for each sub-property value, until all nodes of the entire JSON data structure have been traversed.
[0035] S5: Convert the symbol JSON data structure obtained after traversal into a renderable CIM symbol object for rendering lithological surface features of the Web map.
[0036] Furthermore, the CIM symbol JSON data structure obtained after S4 processing is converted into a renderable symbol object through the CIMSymbol constructor or CIMSymbol.fromJSON() method, and submitted to the Web-based map rendering engine to complete the rendering and display of the lithological planar feature at the current scale or density parameter.
[0037] Preferably, the method described in this embodiment further includes a legend-independent rendering step: The rendering result corresponding to the symbol JSON data structure generated by S5 is rendered in an environment independent of the map view, generating a fixed-size legend example. The display of this legend example is not affected by the current scale or density adjustment parameters of the map view, ensuring that the geological symbols in the legend panel always maintain a standard and compliant display.
[0038] Furthermore, as a preferred embodiment and exemplary description of this practice, the application effects of the above method will be explained in detail below in conjunction with specific lithological symbol scenarios: Example 1: Symbol fidelity and text distortion prevention (using carbonaceous shale symbol RPSE021055 as an example). This carbonaceous shale symbol consists of four equally spaced horizontal bedding lines (node type CIMHatchFill, initial spacing...). The text is composed of a white rectangular border and five overlapping "C" text markers. The text markers consist of a white rectangular border and the "CIMCharacterMarker" character mark, and are repeatedly placed using the outer "CIMVectorMarker" markerPlacement in a "CIMMarkerPlacementInsidePolygon" manner. When the scaling factor is obtained... At that time, the recursive traversal method of S4 in this embodiment is used for processing: the stepX and stepY fields under the markerPlacement node and the separation field under the CIMHatchFill node both match the rule table, and the formula is applied. Scaling is performed to reduce the overall density of the symbols by half (e.g., Meanwhile, the size field under the CIMCharacterMarker node and the width field under the CIMSolidStroke node remain unchanged because they are not registered in the classification rule table and the search fails. Therefore, the font size of the "C" text label and the line width of the stratification lines remain consistent before and after the density adjustment, avoiding the blurring and overlapping problems caused by the synchronous enlargement of text in the existing overall proportional scaling scheme.
[0039] Example 2: Preserving the phase offset ratio of multiple marker layers (taking the limestone symbol RPSE021072 as an example). This limestone symbol consists of two sets of interleaved CIMVectorMarker vertical markers (used to simulate running brick wall texture) superimposed with a CIMHatchFill horizontal line layer. The initial parameters of the vertical markers are: , , and Alternate and When multiple marker layer nodes exist within the same symbol ontology JSON data structure, applying the method in this embodiment ensures that the stepX, stepY, offsetX, and offsetY of both sets of vertical line markers match the rule table and are scaled by the same scaling factor. Synchronous scaling. Because the offset and step size are scaled proportionally, the original phase offset ratio between the marker layers remains unchanged before and after scaling. For example, in the initial state, the ratio might be:
[0040] When scaling factor At that time, the scaled value is , ,at this time:
[0041] Right now This ensures that the staggered arrangement of the brick wall texture remains intact after scaling.
[0042] Example 3: Code-free extension of the classification rule table (taking raster map marker extension as an example). When business requirements necessitate applying this method to lithological symbols containing a raster map marker layer (CIMPictureMarker), since the recursive traversal algorithm logic described in S4 of this embodiment is independent of the specific number or combination of node types, no modification to the code logic of any traversal algorithm is needed. Only one mapping entry needs to be added to the classification rule table described in S2: for nodes identified as CIMPictureMarker, the stepX, stepY, offsetX, and offsetY fields under their markerPlacement child nodes are registered as the set of spacing fields to be scaled. After this addition, lithological symbols containing a raster map marker layer can automatically acquire the ability to adaptively scale density, fully demonstrating the high cohesion and low coupling characteristics of this method.
[0043] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for scaling the density of lithological symbols based on CIM node type identification, characterized in that, include: S1: Construct a lithological symbol ontology JSON data structure conforming to CIM specifications. The symbol ontology JSON data structure contains multiple symbol layer nodes with type identifier fields. S2: Pre-establish a classification rule table that maps node type identifiers to one or more spacing field names; S3: Get the scaling factor corresponding to the current scale or density adjustment parameter of the map view; S4: Perform a recursive traversal of the symbol ontology JSON data structure. When traversing to a certain node, determine whether the type identifier of the node exists in the classification rule table. If it exists, apply the scaling factor to the attribute in the node that matches the spacing field name registered in the classification rule table and has a value of numeric type. If it does not exist, do not modify any attribute of the node, and recursively execute this step on all sub-attributes of the node until the traversal is completed. S5: Convert the symbol JSON data structure obtained after traversal into a renderable CIM symbol object for rendering lithological surface features of the Web map.
2. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The symbol ontology JSON data structure contains character marker nodes for representing textual annotations of lithological components, and the type identifier of the character marker nodes is not registered in the classification rule table, and the character size of the textual annotation remains unchanged during the numerical scaling process.
3. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The classification rule table must register at least the following: A node with the type identifier CIMMarkerPlacementInsidePolygon has a set of spacing field names including horizontal stepX, vertical stepY, horizontal offsetX, and vertical offsetY.
4. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The classification rule table must register at least the following: For nodes with the type identifier CIMHatchFill, the corresponding spacing field name is "fill line spacing separation".
5. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The classification rule table supports adding new mapping entries between node type identifiers and corresponding spacing field names, and the addition does not change the algorithm logic of the recursive traversal.
6. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The scaling factor is dynamically calculated based on changes in the map view scale and is used to achieve continuous changes in the density of lithological symbols.
7. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, For nodes whose type identifier is not registered in the classification rule table, no numerical scaling is applied to any of their attribute values.
8. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, When multiple marker layer nodes exist within the same symbol body JSON data structure, their respective registered spacing and offset fields are synchronously scaled by the same scaling factor to maintain the original phase offset ratio between each marker layer.
9. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, If the classification rule table registers a node with the type identifier CIMPictureMarker, then stepX, stepY, offsetX, and offsetY under its markerPlacement child node are registered as fields to be scaled and applied to the lithological symbols containing the raster map marker layer.
10. The lithological symbol density scaling method based on CIM node type identification as described in claim 1, characterized in that, The method further includes: The generated symbol JSON data structure is rendered in an environment independent of the map view to generate a fixed-size legend example. The display of the legend example is not affected by the current scale or density adjustment parameters of the map view.
