A method for automatically italicizing geological codes in MapGis
By automatically processing the italic part of the geological code, the problem of manual processing in the prior art is solved, efficient and accurate drawing is achieved, and maintenance and update process is simplified.
Patent Information
- Application Number
- CN202410405502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-07
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-04-07
AI Technical Summary
When using MapGis software to map geological maps, the existing technology manually cuts the strings to divide the geological code into multiple parts and sets italic attributes, which is time-consuming and labor-intensive and error-prone, and cannot meet the needs of efficient and accurate mapping.
Provide a MapGis stratigraphic geological code automatic italic method. Through steps such as data preparation, unique value italic marking, horizontal string processing and rotating string processing, the parts of the geological code that need italics are automatically marked and processed to ensure that all stratigraphic geological codes are italicized according to unified rules.
It improves the efficiency of mapping, reduces the workload of manually adjusting font styles, ensures the accuracy of mapping, and simplifies the maintenance and update process of stratigraphic geological codes.
Smart Images

Figure CN118395941B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of character generation, and in particular to an automatic italic method for MapGis stratum geological codes. Background Art
[0002] At present, most geological maps in my country are drawn using MapGis software. According to the mapping specifications, the geological group name in the stratigraphic code needs to be italicized. For example, the stratigraphic code for the second section of the Nanfen Formation of the Qingbaikou System is Qbn. 2 In MapGis, a string can have one form, so the traditional processing method is to manually cut the string, divide the geological code into 2-3 parts, and then set the attributes of the italic part, which is time-consuming, labor-intensive and error-prone, and cannot meet the usage requirements. Summary of the invention
[0003] In order to solve the above technical problems, the present invention provides a technical solution: a method for automatically italicizing a MapGis stratigraphic geological code, comprising the following steps:
[0004] S1. Data preparation
[0005] The geological code layer is extracted as a separate file. There are no other geological point sub-map symbols in the file. In MapGis K9 and above versions, annotations and point features do not belong to the same category and there is no mixed storage phenomenon.
[0006] S2, unique value italic mark
[0007] Put all geological code strings into a non-repeating set to obtain the unique value of the geological code string. At this time, perform human-computer interaction to mark the part that needs to be italicized, and use "$+" to mark the part that needs to be italicized;
[0008] S3, horizontal string processing
[0009] Each geological code is written twice, and the size of the original code is used during writing. When writing for the first time, the marked string is replaced with an equal number of space symbols and then written. At this time, the coordinates written use the original geological code coordinates. When writing for the second time, the italic part is written and the coordinates are recalculated.
[0010] S4. Rotation string processing
[0011] For the rotated geological code, each geological code is written twice. When writing for the first time, the marked character string is replaced with an equal number of space symbols and then written. At this time, the written coordinates use the original geological code coordinates, and the rotation angle must be consistent with the original code setting. When writing for the second time, the italic part is written, and the writing coordinates of the italic code are calculated.
[0012] S5. Data export
[0013] Just export the regular and italic parts of all geological codes into one file.
[0014] The advantages of the present invention over the prior art are: the present invention can (1) improve mapping efficiency: the automatic italic function can significantly reduce the workload of manually adjusting the font style of the stratum geological code; the automatic italic method can greatly improve mapping efficiency.
[0015] (2) Ensure cartographic accuracy: When manually adjusting the font style, the font style may be inconsistent due to operational errors or negligence. The automatic italic method can ensure that all stratigraphic geological codes are italicized according to unified rules, thereby ensuring the accuracy of cartography.
[0016] (3) Easy to maintain and update: When the stratum geological code changes or needs to be updated, the automatic italic method can be updated by simply re-executing the automatic italic function. Compared with manually adjusting the font style of each stratum geological code, this has lower maintenance costs and faster update speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the process of the present invention.
[0018] Figure 2 It is a schematic diagram of the calculation flow of horizontal string processing in the present invention.
[0019] Figure 3 It is a schematic diagram of the calculation flow of the rotation string processing in the present invention.
[0020] Figure 4 It is a schematic diagram of the process of calculating the radius of the coordinates written in italic parts in the present invention. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in combination with 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.
[0022] Example:
[0023] A method for automatically italicizing a MapGis stratum geological code, characterized by comprising the following steps:
[0024] S1. Data preparation
[0025] The geological code layer is extracted as a separate file. There are no other geological point sub-map symbols in the file. In MapGis K9 and above versions, annotations and point features do not belong to the same category and there is no mixed storage phenomenon.
[0026] S2, unique value italic mark
[0027] Put all geological code strings into a non-repeating set to obtain the unique value of the geological code string. At this time, perform human-computer interaction to mark the part that needs to be italicized, and use "$+" to mark the part that needs to be italicized;
[0028] For example, the geological code string of the second section of the Nanfen Formation of the Qingbaikou system is Qbn 2 , where the part that needs to be italicized is "n", so "n" is marked with "$+", the geological code string Qbn 2 That is, "Qb$+n$+ 2 ". Since the Quaternary strata and rock mass codes do not need to be italicized, such codes are not marked.
[0029] S3, horizontal string processing
[0030] Each geological code is written twice, and the size of the original code is used when writing. When writing for the first time, the marked string is replaced with an equal number of space symbols and then written, for example: Qbn 2 The written string is Qb[space] 2 , at this time, the coordinates written in use the original geological code coordinates; when writing for the second time, write the italic part and recalculate the coordinates;
[0031] Calculating the writing coordinates of the italic code includes the following steps:
[0032] (3.1) First, write the string before the italic code into a virtual string according to the original coordinates;
[0033] (3.2) Find the bounding rectangle of the virtual string and obtain the X and Y coordinates of the lower right corner of the bounding rectangle. These coordinates are the coordinates for writing the italic part.
[0034] S4. Rotation string processing
[0035] For the rotated geological codes, each geological code is written twice; when writing for the first time, the marked string is replaced with an equal number of space symbols and then written, for example: Qbn 2 The written string is Qb[space] 2 , at this time, the written coordinates use the original geological code coordinates, and the rotation angle must be consistent with the original code setting; when writing for the second time, write the italic part and calculate the written coordinates of the italic code;
[0036] Calculating the writing coordinates of the italic code includes the following steps:
[0037] (4.1) First, write the string before the italic code into a virtual string according to the original coordinates;
[0038] (4.1) Find the circumscribed rectangle of the virtual string and obtain the X coordinates of the lower left corner and the lower right corner of the circumscribed rectangle, where the coordinate of the lower left corner is Xmin and the coordinate of the lower right corner is Xmax. According to the value of Xmax-Xmin, obtain the circumscribed radius R of the virtual string;
[0039] (4.2) Rotate the angle θ as needed, record the first written coordinate as A (XA, YA), the italic part written coordinate as B (XB, YB), calculate the italic part written coordinate, the formula is as follows:
[0040] XB=XA+R*cos(θ), YB=YA+R*sin(θ);
[0041] When writing in italic, the rotation angle must be set to θ.
[0042] S5. Data export
[0043] Just export the regular and italic parts of all geological codes into one file.
[0044] The present invention and its implementation methods are described above, and such description is not restrictive. In short, if a person skilled in the art is inspired by it and, without departing from the purpose of the invention, designs structures and embodiments similar to the technical solution without creativity, they should all fall within the protection scope of the present invention.
Claims
1. A method for automatically italicizing the geological code of a MapGis formation, characterized in that: The following steps are involved: S1. Data preparation The geological code layer is extracted into a separate file. There are no other geological point sub-map symbols in the file. In MapGisK9 and above versions, annotations and point features do not belong to the same category and there is no mixed storage phenomenon. S2, unique value italic mark Put all geological code strings into a non-repeating set to obtain the unique value of the geological code string. At this time, perform human-computer interaction to mark the part that needs to be italicized, and use "$+" to mark the part that needs to be italicized; S3, horizontal string processing Each geological code is written twice, and the size of the original code is used during writing. When writing for the first time, the marked string is replaced with an equal number of space symbols and then written. At this time, the coordinates written use the original geological code coordinates. When writing for the second time, the italic part is written and the coordinates are recalculated. Among them, writing the italic part and recalculating the coordinates include the following steps: (3.1) First, write the string before the italic code into a virtual string according to the original coordinates; (3.2) Find the bounding rectangle of the virtual string and obtain the X and Y coordinates of the lower right corner of the bounding rectangle. These coordinates are the coordinates for writing the italic part. S4. Rotation string processing For the rotated geological code, each geological code is written twice. When writing for the first time, the marked character string is replaced with an equal number of space symbols and then written. At this time, the written coordinates use the original geological code coordinates, and the rotation angle must be consistent with the original code setting. When writing for the second time, the italic part is written, and the writing coordinates of the italic code are calculated. The calculation of the writing coordinates of the italic code includes the following steps: (4.1) First, write the string before the italic code into a virtual string according to the original coordinates; (4.1) Find the circumscribed rectangle of the virtual string and obtain the X coordinates of the lower left corner and the lower right corner of the circumscribed rectangle, where the coordinate of the lower left corner is Xmin and the coordinate of the lower right corner is Xmax. According to the value of Xmax-Xmin, obtain the circumscribed radius R of the virtual string; (4.2) Rotate the angle θ as needed, record the first written coordinate as A (XA, YA), the italic part written coordinate as B (XB, YB), calculate the italic part written coordinate, the formula is as follows: XB=XA+R*cos(θ), YB=YA+R*sin(θ); When writing in italics, the rotation angle must be set to θ; S5. Data export Export all geological symbols in both straight and italic form to one file.
Citation Information
Patent Citations
Equipment and method for extracting enclosing rectangles of characters from portable electronic documents
CN102081594A
Image rotating method based on FPGA
CN108154477A