Metallurgical industry map symbol generation method and device, electronic equipment and medium

Calculate the width and height of the SVG icon through WKT encoding and maximum external rectangle method, and determine the scale factor in combination with pixel size, solving the problem of low CAD data conversion efficiency in the metallurgical industry, achieving efficient and accurate GIS map symbol generation, satisfying the map The accuracy and efficiency requirements of mapping.

CN119248859APending Publication Date: 2025-01-03WUHAN SURVEYING GEOTECHN RES INST OF MCC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411234057.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

In the metallurgical industry, the efficiency and accuracy of converting CAD data into GIS map data is low, and it is difficult to fully comply with the map mapping standards, affecting the accuracy and readability of the map.

Method used

The geometric objects in the DXF data are converted into WKT data through WKT encoding, and the width and height of the SVG icon are calculated using the maximum external rectangle method, and the scale factor is determined based on the pixel size under the preset scale bar, and the map symbols are imported into the GIS system.

Benefits of technology

It realizes the precise conversion of CAD data to GIS map data, and automatically generates map symbols that meet the map mapping standards of the metallurgical industry, significantly reducing manual operation time, improving work efficiency and response speed of map production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248859A_ABST
    Figure CN119248859A_ABST
Patent Text Reader

Abstract

The invention relates to a map symbol generation method and device for the metallurgical industry, electronic equipment and a medium, and belongs to the technical field of data processing.The method comprises the steps that geometric objects in DXF data are coded through WKT coding, and WKT data are obtained; the DXF data is obtained by converting CAD symbols associated with the metallurgical industry; determining the width and the height of the SVG icon based on a maximum bounding rectangle method and the WKT data; determining a scale factor based on the pixel size of the SVG icon under a preset scale; and based on the scale factor and the width and height of the SVG icon, importing the SVG icon into a GIS system to generate a map symbol. According to the map symbol generation method for the metallurgical industry, the time and complexity of manual operation in a traditional method are remarkably reduced, the map making period is greatly shortened, the working efficiency is improved, and map making can more rapidly respond to the production and management requirements of the metallurgical industry.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a method, device, electronic equipment and medium for generating map symbols for the metallurgical industry. Background Art

[0002] In the metallurgical industry, mapping is an indispensable part of daily production and management. With the widespread application of Geographic Information System (GIS), the need to convert traditional Computer Aided Design (CAD) data into GIS map data is becoming increasingly urgent. However, due to the differences between CAD and GIS in data structure, symbol representation, etc., data conversion and symbol generation become a complex and tedious task.

[0003] Traditional CAD data conversion methods usually rely on manual operations or simple script processing, which is inefficient and prone to errors. In addition, due to the strict requirements of the metallurgical industry mapping standards for map symbols, manually generated symbols are often difficult to fully comply with the standards, affecting the accuracy and readability of the map. Summary of the invention

[0004] In view of this, it is necessary to provide a method, device, electronic equipment and medium for generating map symbols in the metallurgical industry to solve the problems of low efficiency and accuracy of existing CAD data conversion methods.

[0005] In order to solve the above problems, the present invention provides a method for generating map symbols for the metallurgical industry, comprising: Encode the geometric objects in the DXF data by WKT encoding to obtain WKT data; the DXF data is obtained by converting CAD symbols associated with the metallurgical industry; Determine the width and height of the SVG icon based on the maximum enclosing rectangle method and the WKT data; Determining a scale factor based on a pixel size of the SVG icon at a preset scale; Based on the scale factor, the width and the height of the SVG icon, the SVG icon is imported into a GIS system to generate a map symbol.

[0006] In a possible implementation, determining the width and height of the SVG icon based on the maximum bounding rectangle method and the WKT data includes: Determining the main axis direction of the shape based on a point set corresponding to the shape in the WKT data; Rotating the vertices of the shape based on a rotation matrix to obtain a rotated shape; the rotation matrix is ​​determined based on the direction of the main axis; Determine a circumscribed rectangle of the inverse matrix based on the rotated shape and the inverse matrix of the rotation matrix; Based on the inverse matrix circumscribed rectangle, the width and height of the SVG icon are determined.

[0007] In a possible implementation manner, determining the main axis direction of the shape based on a point set corresponding to the shape in the WKT data includes: Based on the point set, determining a covariance matrix; Performing eigenvalue decomposition on the covariance matrix to obtain eigenvectors; Based on the eigenvectors, the directions of the principal axes of the shape are determined.

[0008] In a possible implementation, determining the inverse matrix circumscribed rectangle based on the rotated shape and the inverse matrix of the rotation matrix includes: Determining an axisymmetric bounding box based on the boundary points of the rotated shape; The axisymmetric bounding box is inversely rotated based on the inverse matrix of the rotation matrix to determine the inverse matrix circumscribed rectangle.

[0009] In a possible implementation, determining the width and height of the SVG icon based on the circumscribed rectangle of the inverse matrix includes: Determine the coordinates of the upper left corner vertex and the lower right corner vertex of the inverse matrix circumscribed rectangle; Based on the upper left corner vertex coordinates and the lower right corner vertex coordinates, the width and height of the SVG icon are determined.

[0010] In a possible implementation, determining the scale factor based on the pixel size of the SVG icon at a preset scale includes: Determining the actual size of the CAD symbol at the preset scale; The scaling factor is determined based on a ratio of the pixel size to the actual size.

[0011] In a possible implementation, the step of importing the SVG icon into a GIS system based on the scale factor and the width and height of the SVG icon to generate a map symbol includes: Convert the width and height of the SVG icon based on the scale factor to obtain converted width and height; Based on the converted width and height, the SVG icon is imported into a GIS system to generate a map symbol.

[0012] The present invention also provides a map symbol generating device for the metallurgical industry, comprising: An encoding module, used for encoding geometric objects in DXF data by WKT encoding to obtain WKT data; the DXF data is obtained by converting CAD symbols associated with the metallurgical industry; A first determination module, configured to determine the width and height of the SVG icon based on a maximum bounding rectangle method and the WKT data; A second determination module, configured to determine a scale factor based on a pixel size of the SVG icon at a preset scale; A generating module is used to import the SVG icon into a GIS system based on the scale factor, the width and the height of the SVG icon, and generate a map symbol.

[0013] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the map symbol generation method for the metallurgical industry described in any of the above implementations.

[0014] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for generating map symbols for the metallurgical industry described in any of the above implementations is implemented.

[0015] The beneficial effects of the present invention are as follows: the map symbol generation method, device, electronic device and medium for the metallurgical industry provided by the present invention convert the CAD symbols associated with the metallurgical industry to obtain DXF data, extract geometric objects from the DXF data, obtain WKT data through WKT encoding, thereby calculating the width and height of the SVG icon according to the maximum enclosing rectangle method, and determining the scale factor according to the pixel size of the SVG icon under a preset scale, the scale factor is used for appropriate scaling of the VG icon, thereby importing the generated SVG icon into the GIS system to generate map symbols, and by combining the methods of converting DWG data to DXF data, DXF data to WKT data, and WKT data to SVG icons, and calculating the width and height of the SVG icon based on the WKT maximum enclosing rectangle, and using the pixel size to calculate the scale factor, the accurate conversion of CAD data to GIS map data is realized, thereby automatically generating map symbols that meet the map making standards of the metallurgical industry, significantly reducing the time and tediousness of manual operations in traditional methods, which greatly shortens the map making cycle, improves work efficiency, and enables map making to more quickly respond to the production and management needs of the metallurgical industry. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use 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 work.

[0017] Figure 1 One of the method flow charts of an embodiment of the method for generating map symbols for the metallurgical industry provided by the present invention; Figure 2 A second method flow chart of an embodiment of the method for generating map symbols for the metallurgical industry provided by the present invention; Figure 3 A schematic diagram of a map symbol library for the metallurgical industry provided by the present invention; Figure 4 A schematic structural diagram of an embodiment of a map symbol generating device for the metallurgical industry provided by the present invention; Figure 5 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings 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.

[0019] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0020] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" or "second" may explicitly or implicitly include at least one of the features.

[0021] Figure 1 One of the method flow charts of an embodiment of the method for generating map symbols for the metallurgical industry provided by the present invention is as follows Figure 1 As shown in the figure, the map symbol generation method for the metallurgical industry includes: S101, encoding geometric objects in DXF data by WKT encoding to obtain WKT data; the DXF data is obtained by converting CAD symbols associated with the metallurgical industry; S102, determining the width and height of the SVG icon based on the maximum circumscribed rectangle method and the WKT data; S103, determining a scale factor based on a pixel size of the SVG icon at a preset scale; S104: Based on the scale factor, the width and the height of the SVG icon, the SVG icon is imported into a GIS system to generate a map symbol.

[0022] It should be noted that CAD symbols are map symbols associated with the metallurgical industry, stored in DWG format, and contain various elements on the map. Import the acquired CAD data into a dedicated data conversion tool or software, such as the ogr2ogr tool, to convert CAD data into DXF data. During the conversion process, the data conversion tool will retain the geometric information and attribute information in the CAD data. Therefore, geometric information and related attribute information can be extracted from the DXF data, and this information can be encoded according to the WKT (Well-Known Text) specification to form a text format description to obtain WKT data.

[0023] Therefore, the geometric information and attributes in WKT can be used to automatically draw the corresponding (Scalable Vector Graphics, SVG) icons. In order to ensure that the SVG icons can be displayed correctly in the GIS system, the scale factor needs to be calculated, which involves comparing the pixel size of the SVG icon with the actual geographic space size to obtain the appropriate scaling ratio.

[0024] The generated SVG icons are imported into the GIS system and used as map symbols. These symbols will be displayed on the map according to the cartographic standards of the metallurgical industry, providing intuitive and accurate visual support for industry applications.

[0025] Compared with the prior art, the map symbol generation method for the metallurgical industry provided in the embodiment of the present invention converts the CAD symbols associated with the metallurgical industry to obtain DXF data, extracts geometric objects from the DXF data, obtains WKT data through WKT encoding, thereby calculating the width and height of the SVG icon according to the maximum enclosing rectangle method, and determining the scale factor according to the pixel size of the SVG icon under a preset scale. The scale factor is used for appropriate scaling of the VG icon, thereby importing the generated SVG icon into the GIS system to generate map symbols, and by combining the methods of converting DWG data to DXF data, DXF data to WKT data, and WKT data to SVG icons, and calculating the width and height of the SVG icon based on the WKT maximum enclosing rectangle, and using the pixel size to calculate the scale factor, accurate conversion of CAD data to GIS map data is achieved, thereby automatically generating map symbols that meet the map making standards of the metallurgical industry, significantly reducing the time and tediousness of manual operations in traditional methods, which greatly shortens the map making cycle, improves work efficiency, and enables map production to more quickly respond to the production and management needs of the metallurgical industry.

[0026] In some embodiments of the present invention, determining the width and height of the SVG icon based on the maximum bounding rectangle method and the WKT data includes: Determining the main axis direction of the shape based on a point set corresponding to the shape in the WKT data; Rotating the vertices of the shape based on a rotation matrix to obtain a rotated shape; the rotation matrix is ​​determined based on the direction of the main axis; Determine a circumscribed rectangle of the inverse matrix based on the rotated shape and the inverse matrix of the rotation matrix; Based on the inverse matrix circumscribed rectangle, the width and height of the SVG icon are determined.

[0027] In some embodiments of the present invention, determining the main axis direction of the shape based on a point set corresponding to the shape in the WKT data includes: Based on the point set, determining a covariance matrix; Performing eigenvalue decomposition on the covariance matrix to obtain eigenvectors; Based on the eigenvectors, the directions of the principal axes of the shape are determined.

[0028] In some embodiments of the present invention, determining the inverse matrix circumscribed rectangle based on the rotated shape and the inverse matrix of the rotation matrix includes: Determining an axisymmetric bounding box based on the boundary points of the rotated shape; The axisymmetric bounding box is inversely rotated based on the inverse matrix of the rotation matrix to determine the inverse matrix circumscribed rectangle.

[0029] In some embodiments of the present invention, determining the width and height of the SVG icon based on the inverse matrix circumscribed rectangle includes: Determine the coordinates of the upper left corner vertex and the lower right corner vertex of the inverse matrix circumscribed rectangle; Based on the upper left corner vertex coordinates and the lower right corner vertex coordinates, the width and height of the SVG icon are determined.

[0030] When using WKT data to calculate the width and height of an SVG icon, you can use the maximum enclosing rectangle calculation algorithm to obtain the image width and height.

[0031] The geometric objects that can be represented by WKT data include points, lines, polygons, etc. The main axis direction of the shape can be calculated based on the point set corresponding to the shape in the WKT data, and the shape is the corresponding shape of the geometric object.

[0032] Exemplarily, the main axis direction of the shape may be calculated by calculating the covariance matrix of the shape.

[0033] Assume that a set of points corresponding to a certain shape is P = { p 1, p 2, …, p n}, where each point ( ) have x and y coordinates.

[0034] The covariance matrix cov(x,y) of a point is defined as follows, where E is the expectation operator, μ is the overall mean:

[0035] The formula of the covariance matrix cov(P) of the point set P is as follows:

[0036] Perform eigenvalue decomposition on the cov(P) covariance matrix and find two eigenvectors, which represent the main axis directions of the shape.

[0037] After determining the main axis direction, the rotation matrix can be further determined.

[0038] For example, when the two eigenvectors are and , then they form the new coordinate system of the shape.

[0039] Rotation Matrix R The expression is as follows:

[0040] in, and They are vectors of x and y Quantity, and They are vectors of x and y Quantity.

[0041] Through the rotation matrix R You can transform the shape from the original coordinate system to the new coordinate system by using the rotation matrix R Applied to all vertices of the shape, the resulting shape is rotated.

[0042] For each point in the shape , calculate its coordinates in the new coordinate system:

[0043] The minimum bounding box of the rotated shape can be determined using the axis-aligned bounding box calculation method, that is, the minimum and maximum values ​​of the rotated point set in the x' and y' coordinates are determined to determine the boundaries of the axis-aligned bounding box (AABB).

[0044] The calculated AABB is reversed and rotated back to the original shape direction to obtain the inverse matrix bounding rectangle, which can be obtained by applying the inverse matrix R of the rotation matrix -1 To achieve this, the formula is as follows:

[0045]

[0046] Therefore, the width and height of the SVG icon can be determined based on the four vertices of the inverse matrix circumscribed rectangle. The coordinates of the upper left corner vertex of the circumscribed rectangle are (xmin, ymin), and the coordinates of the lower right corner vertex are (xmax, ymax). The width (W) of the circumscribed rectangle is the distance between its right and left borders, and the height (H) is the distance between its upper and lower borders. The formula is as follows:

[0047]

[0048] The method for generating map symbols for the metallurgical industry provided by the embodiment of the present invention can generate corresponding SVG vector graphics according to the geometric shapes described by WKT by using SVG drawing tools or writing corresponding drawing codes, and can draw accurate graphic elements according to the coordinate information and attribute information in WKT, and set the color, fill style, border and other attributes of the SVG icon according to the attribute information in WKT to ensure that the icon meets the map drawing standards of the metallurgical industry. By analyzing the maximum enclosing rectangle bbox information in the WKT data, the width and height are obtained as the width and height of the SVG icon, and finally converted to an SVG icon for map drawing.

[0049] In some embodiments of the present invention, determining the scale factor based on the pixel size of the SVG icon at a preset scale includes: Determining the actual size of the CAD symbol at the preset scale; The scaling factor is determined based on a ratio of the pixel size to the actual size.

[0050] CAD symbols are in line with the requirements of metallurgical standards. For example, the street lamp symbol A has a bottom width of 0.8 at a scale of 1:1000. At a scale of 1:500, the symbol will be doubled to a bottom width of 0.4, and at a scale of 1:2000, the symbol will be doubled to a bottom width of 1.6. There is no description of coordinate system and unit in CAD, so the proportional relationship cannot be directly determined.

[0051] Taking street lamps as an example in GIS software, the map coordinate system is EPSG:3857, and the unit is m. Through the measurement tool, it is known that based on the scale of 1:500, the bottom width of the street lamp is about 0.4m.

[0052] Use the pixel measurement tool to measure the pixel width and height of the symbol at the specified map scale to determine the relationship between the scales. Since the symbol is too small to be measured at a scale of 1:500, the bottom pixel width of the street light symbol is about 215px at a map scale of 1:10, so the bottom pixel width at a scale of 1:500 is about 4.3px.

[0053] At a CAD symbol scale of 1:500, the bottom width of the streetlight symbol is 0.4; on the map, at a scale of 1:500, the bottom pixel width is about 4.3px, so the scale factor is: 4.3 / 0.4 = 10.75. That is, after determining the width and height w and h, the pixel width and height pw and ph of the SVG icon are calculated respectively:

[0054] The method for generating map symbols for the metallurgical industry provided by the embodiment of the present invention can accurately calculate the width, height and scaling factor of the SVG icon, ensuring accurate display of the map symbols in the GIS map. At the same time, since the map drawing standards for the metallurgical industry are followed, the generated map symbols can accurately express various elements on the map, thereby improving the accuracy and readability of the map.

[0055] In some embodiments of the present invention, the step of importing the SVG icon into a GIS system to generate a map symbol based on the scale factor, the width and the height of the SVG icon includes: Converting the width and height of the SVG icon based on the scale factor to obtain converted width and height; Based on the converted width and height, the SVG icon is imported into a GIS system to generate a map symbol.

[0056] After confirming the scale factor relationship of a symbol, you can automatically perform batch conversion scale processing on all other symbols. Assuming that a certain scale factor is S, the calculation formulas for the pixel width and height pw and ph of the SVG icon are as follows:

[0057] Use this formula to automatically process SVG icons.

[0058] The generated SVG icons can be imported into the GIS system through the icon library import function or programming interface provided by the GIS system.

[0059] Symbol configuration: configure the imported SVG icons in the GIS system and set their display style, level and other properties on the map. This can be adjusted according to the metallurgical industry map making standards to meet specific visual needs.

[0060] The method for generating map symbols for the metallurgical industry provided in the embodiment of the present invention uses the configured SVG icons to create maps of the metallurgical industry in the GIS system and publish them for users to use. These maps can be applied to production monitoring, resource management, decision support and other aspects, providing intuitive and accurate visual support for the operation and management of the metallurgical industry.

[0061] Figure 2 The second method flow chart of an embodiment of the method for generating map symbols for the metallurgical industry provided by the present invention is as follows: Figure 2 As shown in the figure, the map symbol generation method of the metallurgical industry includes: S201. Collect CAD data.

[0062] First, collect CAD data related to the metallurgical industry. These data are usually stored in DWG format and contain various elements and attribute information on the map.

[0063] S202: Data import.

[0064] Import the collected CAD data into dedicated data conversion tools or software in preparation for subsequent format conversion and information extraction.

[0065] S203, CAD to DXF format conversion. The CAD format data is converted into DXF format through a dedicated data conversion tool to facilitate further analysis and extraction of geometric information.

[0066] In data conversion tools or software, such as using the ogr2ogr tool, convert CAD to DXF and set the corresponding conversion parameters, where the conversion parameters are as follows "ogr2ogr -f DXF / data / output.dxf / data / input.dwg"; during the conversion process, the tool will retain the geometric information and attribute information in the CAD data.

[0067] S204, DXF to WKT format conversion and information extraction. Extract geometric information and related attributes from DXF files, encode this information according to the WKT (Well-Known Text) specification, and form a description in text format.

[0068] The DXF file converted in S203 is read, and a dedicated parsing tool or corresponding parsing code is used to read the DXF file and parse the geometric objects and attribute information therein.

[0069] According to the parsed geometric objects and attribute information, encode them according to the syntax rules of WKT to generate a text description in WKT format. This step involves converting geometric objects into WKT representations such as points, lines, polygons, etc., and retaining related attribute information. For example, use the ogr2ogr tool to convert DXF to WKT format, and set the parameters to "ogr2ogr -fCSV -lco GEOMETRY=AS_WKT / data / wkt / output.csv / data / input.dxf".

[0070] S205, WKT calculates icon width and height. The conversion from WKT to SVG uses the geometric information and attributes in WKT to automatically draw the corresponding (Scalable Vector Graphics, SVG) icon. This process involves calculating the width and height of the SVG icon to meet actual visual requirements.

[0071] Use the WKT format data converted by S204 to calculate the width and height of the icon, and use the maximum enclosing rectangle calculation algorithm to obtain the image width and height. The algorithm steps are as follows: S205.1. Calculate the principal axis of the shape.

[0072] This calculation is done to determine the main axis direction of the shape by calculating the covariance matrix of the shape. Assume that there is a set of points P = { p 1, p 2, …, p n}, where each point ( p i ) have x and y coordinates.

[0073] The covariance matrix cov(x,y) of a point is defined as follows, where E is the expectation operator, μ is the overall mean:

[0074] The formula for the covariance matrix cov(P) of a set of points P is as follows:

[0075] Perform eigenvalue decomposition on this cov(P) covariance matrix and find two eigenvectors, which usually represent the main axis directions of the shape.

[0076] S205.2. Calculate the rotation matrix.

[0077] After determining the direction of the principal axes, the rotation matrix can be calculated.

[0078] Assume that the two eigenvectors calculated in S205.1 are and , which form the new coordinate system of the shape.

[0079] You need to calculate a rotation matrix from the original coordinate system to the new coordinate system R , the calculation formula is as follows:

[0080] in, and is a vector of x and y Quantity, and is a vector of x and y Quantity.

[0081] S205.3. Apply the rotation matrix.

[0082] Apply the rotation matrix to all vertices of the shape. For each point pi in the shape, calculate its coordinates in the new coordinate system:

[0083] S205.4. Calculate the AABB of the rotated shape.

[0084] The minimum bounding box of the rotated shape is determined using the axis-aligned bounding rectangle calculation method. This involves finding the minimum and maximum x' and y' coordinates of the rotated point set to determine the boundaries of the AABB.

[0085] First, you need to determine the boundary points of a given shape or point set. These points are usually the points on the outermost edge of the shape, or the points corresponding to the minimum and maximum values ​​of the point set on the x-axis and y-axis. Traverse all points to find the minimum (xmin`) and maximum (xmax`) of the x-coordinate, as well as the minimum (ymin`) and maximum (ymax`) of the y-coordinate. The formula is as follows:

[0086]

[0087]

[0088]

[0089] S205.5. Reverse the rotation of the circumscribed rectangle.

[0090] Rotate the calculated AABB back to the original shape orientation. This can be done by applying the inverse matrix R of the rotation matrix in S205.2 -1 To achieve this, the formula is as follows:

[0091]

[0092] S205.6. Calculate the width and height based on the four vertices of the circumscribed rectangle.

[0093] According to the calculation results of S205.5, the coordinates of the upper left corner vertex of the circumscribed rectangle are (xmin, ymin), and the coordinates of the lower right corner vertex are (xmax, ymax); the width (W) of the circumscribed rectangle is the distance between its right and left boundaries, and the height (H) is the distance between its upper and lower boundaries. The formula is as follows:

[0094]

[0095] S206. WKT to SVG icon conversion.

[0096] Use SVG drawing tools or write corresponding drawing codes to generate corresponding SVG vector graphics based on the geometric shapes described by WKT.

[0097] This step can draw accurate graphic elements based on the coordinate information and attribute information in WKT, and set the color, fill style, border and other attributes of the SVG icon based on the attribute information in WKT to ensure that the icon meets the map making standards of the metallurgical industry.

[0098] Use S205 to analyze the maximum bounding rectangle bbox information in WKT, and get the width (W) and height (H) as the width and height of the SVG icon, and finally convert it into an SVG icon for map making.

[0099] S207, scaling factor calculation. In order to ensure that the SVG icon can be displayed correctly in the GIS system, the scaling factor needs to be calculated. This involves comparing the pixel size of the SVG icon with the actual geographic space size to obtain a suitable scaling factor.

[0100] Compare the pixel size of the SVG icon with the actual geographic space it should occupy in the GIS map to determine the necessity of calculating the scaling factor. The following example illustrates how to calculate the scaling factor.

[0101] S207.1. CAD symbols must meet the requirements of metallurgical standards. For example, the street lamp symbol A has a bottom width of 0.8 at a scale of 1:1000. At a scale of 1:500, the symbol will be doubled to a bottom width of 0.4, and at a scale of 1:2000, the symbol will be doubled to a bottom width of 1.6. There is no description of coordinate system and unit in CAD, so the proportional relationship cannot be directly determined.

[0102] S207.2. Measure the actual distance in GIS software.

[0103] Taking street lamps as an example in GIS software, the map coordinate system is EPSG:3857, and the unit is m. Through the measurement tool, it is known that based on the scale of 1:500, the bottom width of the street lamp is about 0.4m.

[0104] S207.3. Pixel measurement.

[0105] Use the pixel measurement tool to measure the pixel width and height of the symbol at the specified map scale to determine the relationship between the scales. Since the symbol is too small to be measured at a scale of 1:500, the bottom pixel width of the street light symbol is about 215px at a map scale of 1:10, so the bottom pixel width at a scale of 1:500 is about 4.3px.

[0106] S207.4. Determination of scaling factor.

[0107] At a CAD symbol scale of 1:500, the bottom width of the streetlight symbol is 0.4; on the map, at a scale of 1:500, the bottom pixel width is about 4.3px, so the scale factor is: 4.3 / 0.4 = 10.75. That is, after determining the width and height w and h, the pixel width and height pw and ph of the svg are calculated respectively:

[0108] After manually confirming the scale factor relationship of a symbol in this way, you can automatically perform batch conversion scale processing on all other symbols. Assuming that a certain scale factor is S, the calculation formulas for the pixel width and height pw and ph of the SVG icon are as follows:

[0109] Use this formula to automatically process SVG icons.

[0110] S208. Application of SVG icons in GIS system. The generated SVG icons are imported into the GIS system and used as map symbols. These symbols will be displayed on the map according to the mapping standards of the metallurgical industry, providing intuitive and accurate visual support for industry applications.

[0111] Icon import, import the generated SVG icons into the GIS system, which can be achieved through the icon library import function or programming interface provided by the GIS system.

[0112] Symbol configuration: configure the imported SVG icons in the GIS system and set their display style, level and other properties on the map. This can be adjusted according to the metallurgical industry map making standards to meet specific visual needs.

[0113] Map production and publishing: Use the configured SVG icons to produce maps of the metallurgical industry in the GIS system and publish them for users to use. These maps can be applied to production monitoring, resource management, decision support and other aspects, providing intuitive and accurate visual support for the operation and management of the metallurgical industry.

[0114] For example, Figure 3 As shown, Figure 3 A schematic diagram of the map symbol library for the metallurgical industry provided by the present invention.

[0115] That is, the present invention proposes a method for generating map symbols for the metallurgical industry. By combining the technical processes of converting DWG to DXF, DXF to WKT, and WKT to SVG, as well as a method of calculating the width and height of SVG icons based on the WKT maximum circumscribed rectangle bbox and calculating the scale factor using pixels and actual distance, the present invention realizes the accurate conversion of CAD data to GIS map data and the automatic generation of map symbols that meet the map making standards of the metallurgical industry.

[0116] The method for generating map symbols for the metallurgical industry provided by the embodiment of the present invention can automatically convert CAD data into GIS map data, and automatically generate map symbols that meet the requirements according to the map making standards of the metallurgical industry, which has important practical significance and application value. Through this method, the efficiency and quality of map making can be greatly improved, human errors can be reduced, and more accurate and reliable map support can be provided for the production and management of the metallurgical industry.

[0117] In addition, the method for generating map symbols for the metallurgical industry provided in the embodiment of the present invention aims to solve the problems of low efficiency, low accuracy and difficulty in meeting the map making standards of the metallurgical industry when converting traditional CAD data to GIS map data. Through the method of the present invention, CAD data can be automatically converted into GIS map data, and map symbols that meet the map making standards of the metallurgical industry can be automatically generated, thereby meeting the accuracy and efficiency requirements of the metallurgical industry for map making.

[0118] The beneficial effects of the present invention are as follows: (1) The efficiency of map making is improved. By automatically converting CAD data into GIS map data and automatically generating map symbols that meet the map making standards of the metallurgical industry, the present invention significantly reduces the time and tediousness of manual operations in traditional methods. This greatly shortens the map making cycle, improves work efficiency, and enables map making to more quickly respond to the production and management needs of the metallurgical industry.

[0119] (2) The accuracy of map symbols is improved. The method of the present invention can accurately calculate the width, height and scaling factor of SVG icons, ensuring accurate display of map symbols in GIS maps. At the same time, since the map drawing standards of the metallurgical industry are followed, the generated map symbols can accurately express various elements on the map, improving the accuracy and readability of the map.

[0120] (3) The operation process is simplified. The present invention integrates the steps of CAD data conversion and symbol generation into an automated process. Users only need to perform simple operations to complete the map making work. This integrated method not only simplifies the operation process and reduces the difficulty of operation, but also reduces the errors and inconsistencies caused by human operation.

[0121] (4) The applicability is enhanced. The method of the present invention is not only applicable to the metallurgical industry, but can also be extended to other fields that require CAD to GIS data conversion and symbol generation. Therefore, it has a wide range of application prospects and can meet the needs of different industries for map making.

[0122] Therefore, the present invention realizes the conversion of CAD data to GIS map data through an automated and precise method, and generates map symbols that meet the map making standards of the metallurgical industry, thereby improving the efficiency and accuracy of map making, simplifying the operating procedures, and enhancing applicability, bringing significant benefits to map making work in the metallurgical industry and other fields.

[0123] In order to better implement the map symbol generation method for the metallurgical industry in the embodiment of the present invention, based on the map symbol generation method for the metallurgical industry, the embodiment of the present invention also provides a map symbol generation device for the metallurgical industry. Figure 4 A schematic diagram of the structure of an embodiment of a map symbol generating device for the metallurgical industry provided by the present invention is shown as follows: Figure 4 As shown, the map symbol generating device 400 for the metallurgical industry includes: The encoding module 410 is used to encode the geometric objects in the DXF data by WKT encoding to obtain WKT data; the DXF data is obtained by converting the CAD symbols associated with the metallurgical industry; A first determination module 420, configured to determine the width and height of the SVG icon based on a maximum bounding rectangle method and the WKT data; A second determination module 430 is used to determine a scale factor based on a pixel size of the SVG icon at a preset scale; The generating module 440 is used to import the SVG icon into the GIS system based on the scale factor, the width and the height of the SVG icon, and generate a map symbol.

[0124] The map symbol generating device 400 for the metallurgical industry provided in the above embodiment can implement the technical solution described in the above embodiment of the map symbol generating method for the metallurgical industry. The specific implementation principles of the above modules or units can refer to the corresponding contents in the embodiment of the map symbol generating method for the metallurgical industry, which will not be repeated here.

[0125] like Figure 5 As shown, the present invention also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0126] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, which is used to run the program code or process data stored in the memory 502, such as the map symbol generation method for the metallurgical industry in the present invention.

[0127] In some embodiments, the processor 501 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 501 may be local or remote. In some embodiments, the processor 501 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0128] In some embodiments, the memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500.

[0129] Furthermore, the memory 502 may include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store application software installed in the electronic device 500 and various data.

[0130] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an organic light-emitting diode (OLED) touch device, etc. The display 503 is used to display information on the electronic device 500 and to display a visual user interface. The components 501-503 of the electronic device 500 communicate with each other via a system bus.

[0131] In one embodiment, when the processor 501 executes the map symbol generation program for the metallurgical industry in the memory 502, the following steps may be implemented: Encode the geometric objects in the DXF data by WKT encoding to obtain WKT data; the DXF data is obtained by converting CAD symbols associated with the metallurgical industry; Determine the width and height of the SVG icon based on the maximum enclosing rectangle method and the WKT data; Determining a scale factor based on a pixel size of the SVG icon at a preset scale; Based on the scale factor, the width and the height of the SVG icon, the SVG icon is imported into a GIS system to generate a map symbol.

[0132] It should be understood that: when the processor 501 executes the map symbol generation program for the metallurgical industry in the memory 502, in addition to the above functions, other functions may also be implemented. For details, please refer to the description of the corresponding method embodiment above.

[0133] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 500 mentioned, and the electronic device 500 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 500 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0134] Correspondingly, an embodiment of the present invention also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, it can implement the steps or functions of the map symbol generation method for the metallurgical industry provided by the above-mentioned method embodiments.

[0135] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0136] The above is a detailed introduction to the map symbol generation method, device, electronic device and medium for the metallurgical industry provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for generating map symbols for the metallurgical industry, characterized in that: include: Encode the geometric objects in the DXF data through WKT encoding to obtain WKT data; The DXF data is obtained by converting CAD symbols associated with the metallurgical industry; Determine the width and height of the SVG icon based on the maximum enclosing rectangle method and the WKT data; Determining a scale factor based on a pixel size of the SVG icon at a preset scale; Based on the scale factor, the width and the height of the SVG icon, the SVG icon is imported into a GIS system to generate a map symbol.

2. The method for generating map symbols for the metallurgical industry according to claim 1, characterized in that: The determining the width and height of the SVG icon based on the maximum bounding rectangle method and the WKT data includes: Determining the main axis direction of the shape based on a point set corresponding to the shape in the WKT data; Rotating the vertices of the shape based on a rotation matrix to obtain a rotated shape; the rotation matrix is ​​determined based on the direction of the main axis; Determine a circumscribed rectangle of the inverse matrix based on the rotated shape and the inverse matrix of the rotation matrix; Based on the inverse matrix circumscribed rectangle, the width and height of the SVG icon are determined.

3. The method for generating map symbols for the metallurgical industry according to claim 2, characterized in that: The determining the main axis direction of the shape based on the point set corresponding to the shape in the WKT data includes: Based on the point set, determining a covariance matrix; Performing eigenvalue decomposition on the covariance matrix to obtain an eigenvector; Based on the eigenvectors, the directions of the principal axes of the shape are determined.

4. The method for generating map symbols for the metallurgical industry according to claim 2, characterized in that: The step of determining the inverse matrix circumscribed rectangle based on the rotated shape and the inverse matrix of the rotation matrix comprises: Determining an axisymmetric bounding box based on the boundary points of the rotated shape; The axisymmetric bounding box is inversely rotated based on the inverse matrix of the rotation matrix to determine the inverse matrix circumscribed rectangle.

5. The method for generating map symbols for the metallurgical industry according to claim 2, characterized in that: The determining the width and height of the SVG icon based on the inverse matrix circumscribed rectangle includes: Determine the coordinates of the upper left corner vertex and the lower right corner vertex of the inverse matrix circumscribed rectangle; Based on the upper left corner vertex coordinates and the lower right corner vertex coordinates, the width and height of the SVG icon are determined.

6. The method for generating map symbols for the metallurgical industry according to claim 1, characterized in that: The determining of the scale factor based on the pixel size of the SVG icon at a preset scale includes: Determining the actual size of the CAD symbol at the preset scale; The scaling factor is determined based on a ratio of the pixel size to the actual size.

7. The method for generating map symbols for the metallurgical industry according to claim 1, characterized in that: The step of importing the SVG icon into a GIS system based on the scale factor and the width and height of the SVG icon to generate a map symbol includes: Converting the width and height of the SVG icon based on the scale factor to obtain converted width and height; Based on the converted width and height, the SVG icon is imported into a GIS system to generate a map symbol.

8. A map symbol generating device for the metallurgical industry, characterized in that: include: The encoding module is used to encode the geometric objects in the DXF data through WKT encoding to obtain WKT data; The DXF data is obtained by converting CAD symbols associated with the metallurgical industry; A first determination module, configured to determine the width and height of the SVG icon based on a maximum bounding rectangle method and the WKT data; A second determination module, configured to determine a scale factor based on a pixel size of the SVG icon at a preset scale; A generating module is used to import the SVG icon into a GIS system based on the scale factor, the width and the height of the SVG icon, and generate a map symbol.

9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the map symbol generation method for the metallurgical industry as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating map symbols for the metallurgical industry as claimed in any one of claims 1 to 7 is implemented.