Method and apparatus for automatically generating geospatial data based on dwg files

By acquiring the metadata information and preprocessed feature types of DWG files, the problem of low efficiency in converting DWG files to WebGIS services in existing technologies is solved, realizing automated conversion and accurate data generation, improving conversion efficiency and reducing data loss.

CN115757669BActive Publication Date: 2026-03-24TIANDI TECH CO LTD BEIJING TECH RES BRANCH +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing technologies rely on manual operation in the process of converting DWG files to WebGIS services, which requires a high level of expertise, resulting in low efficiency and data loss. In particular, insufficient support for arc types leads to wasted disk space.

Method used

By acquiring the metadata information of the DWG file, spatial reference values ​​are determined, and detailed information of preset feature types is preprocessed, stored in a spatial data table, generating geospatial data and sending it to the client.

Benefits of technology

It enables automated conversion of DWG files to geospatial data, improving conversion efficiency and accuracy, reducing the need for manual operations, and avoiding data loss and disk space waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115757669B_ABST
    Figure CN115757669B_ABST
Patent Text Reader

Abstract

The application relates to a method and device for automatically generating geospatial data based on a DWG file. The specific scheme is as follows: the metadata information of multiple layers in the DWG file is extracted by acquiring the DWG file; the spatial reference value of the DWG file is determined based on the spatial information of the layers; for each layer, the detail information of a preset feature type is preprocessed based on the metadata information of the layer; the metadata information, the spatial reference value and the preprocessed detail information of the preset feature type are stored into a spatial data table according to a preset rule; and the geospatial data is generated based on the to-be-published data and is sent to a client. The application improves the efficiency and accuracy of converting the DWG file into the geospatial data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for automatically generating geospatial data based on DWG files. Background Technology

[0002] In related technologies, the process of converting DWG files to WebGIS services using ArcGIS platform products heavily relies on ArcGIS Desktop software. Each step, from acquiring spatial information of layers to publishing GIS services, requires manual operation by professionals, demanding a high level of GIS expertise from the operators. During metadata export, each layer needs to be extracted by name, and the style of each layer needs to be manually acquired and configured. ArcGIS has poor support for arc types in DWG files, resulting in the loss of all arc information during data export. The manual data conversion process generates a lot of intermediate data, which is stored as files on disk, wasting disk space. Summary of the Invention

[0003] Therefore, this application provides a method and apparatus for automatically generating geospatial data based on DWG files. The technical solution of this application is as follows:

[0004] According to a first aspect of the embodiments of this application, a method for automatically generating geospatial data based on DWG files is provided, the method comprising:

[0005] Obtain a DWG file and extract metadata information for each of the multiple layers in the DWG file; wherein, the spatial information of the metadata layer includes the layer name and layer information; the layer information includes multiple sets of detailed information for different feature types; each set of detailed information includes spatial information and attribute information for at least one feature; the attribute information includes text information and style information;

[0006] Based on the spatial information of the layer, determine the spatial reference value of the DWG file;

[0007] For each layer, based on the metadata information of the layer, the detailed information of the preset feature type is preprocessed;

[0008] The metadata information, the spatial reference value, and the preprocessed details of the preset element type are stored in the spatial data table according to preset rules;

[0009] Geospatial data is generated based on the data to be published, and the geospatial data is sent to the client.

[0010] According to one embodiment of this application, the preprocessing of detailed information of a preset feature type based on the metadata information of the layer for each layer includes:

[0011] For each layer, in response to the fact that the feature type of the detailed information is an arc segment, the center point coordinates, radius, starting angle and ending angle of the arc segment are obtained based on the metadata information of the layer.

[0012] Based on the center point coordinates, radius, starting angle, and ending angle of the arc segment, determine the starting point coordinates and ending point coordinates of the arc segment.

[0013] Based on the coordinates of the starting point and ending point of the arc segment, the coordinates of the midpoint of the arc segment are determined by interpolation.

[0014] According to one embodiment of this application, the preprocessing of detailed information of a preset feature type based on the metadata information of the layer for each layer further includes:

[0015] For each layer, in response to the fact that the feature type of the detailed information is text, the rotation angle value of the text is obtained based on the metadata information of the layer;

[0016] Multiply the rotation angle value of the text by -1 to obtain the corrected rotation angle value.

[0017] According to one embodiment of this application, the step of generating geospatial data based on the data to be published and sending the geospatial data to the client includes:

[0018] Monitor the spatial data table;

[0019] In response to the detection of updated data in the spatial data table, geospatial data is generated based on the data to be published.

[0020] The geospatial data is sent to the client.

[0021] According to one embodiment of this application, the element types include points, lines, surfaces, and arc segments.

[0022] According to one embodiment of this application, the table name of each spatial data table is a unique table name generated by the snowflake algorithm.

[0023] According to a second aspect of the embodiments of this application, an apparatus for automatically generating geospatial data based on DWG files is provided, the apparatus comprising:

[0024] The extraction module is used to acquire a DWG file and extract metadata information for each of the multiple layers in the DWG file. The spatial information of the metadata layer includes the layer name and layer information. The layer information includes multiple sets of detailed information for different feature types. Each set of detailed information includes spatial information and attribute information for at least one feature. The attribute information includes text information and style information.

[0025] The determination module is used to determine the spatial reference value of the DWG file based on the spatial information of the layer;

[0026] The preprocessing module is used to preprocess the detailed information of the preset feature type for each layer based on the metadata information of the layer;

[0027] The storage module is used to store the metadata information, the spatial reference value, and the preprocessed detailed information of the preset element type into the spatial data table according to preset rules;

[0028] The sending module is used to generate geospatial data based on the data to be published and send the geospatial data to the client.

[0029] According to one embodiment of this application, the preprocessing module is specifically used for:

[0030] For each layer, in response to the fact that the feature type of the detailed information is an arc segment, the center point coordinates, radius, starting angle and ending angle of the arc segment are obtained based on the metadata information of the layer.

[0031] Based on the center point coordinates, radius, starting angle, and ending angle of the arc segment, determine the starting point coordinates and ending point coordinates of the arc segment.

[0032] Based on the coordinates of the starting point and ending point of the arc segment, the coordinates of the midpoint of the arc segment are determined by interpolation.

[0033] According to one embodiment of this application, the preprocessing module is further configured to:

[0034] For each layer, in response to the fact that the feature type of the detailed information is text, the rotation angle value of the text is obtained based on the metadata information of the layer;

[0035] Multiply the rotation angle value of the text by -1 to obtain the corrected rotation angle value.

[0036] According to one embodiment of this application, the sending module is specifically used for:

[0037] Monitor the spatial data table;

[0038] In response to the detection of updated data in the spatial data table, geospatial data is generated based on the data to be published.

[0039] The geospatial data is sent to the client.

[0040] According to one embodiment of this application, the element types include points, lines, surfaces, and arc segments.

[0041] According to one embodiment of this application, the table name of each spatial data table is a unique table name generated by the snowflake algorithm.

[0042] According to a third aspect of the embodiments of this application, an electronic device is provided, characterized in that it includes: a processor, and a memory communicatively connected to the processor;

[0043] The memory stores computer-executed instructions;

[0044] The processor executes computer execution instructions stored in the memory to implement the method as described in any one of the first aspects.

[0045] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of the first aspects.

[0046] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in any one of the first aspects.

[0047] The technical solutions provided by the embodiments of this application have at least the following beneficial effects:

[0048] By acquiring a DWG file, metadata information for each of the multiple layers within the DWG file is extracted. Based on the spatial information of the layers, spatial reference values ​​are determined for the DWG file. For each layer, detailed information for a preset feature type is preprocessed based on the layer's metadata information. The metadata information, spatial reference values, and preprocessed detailed information for the preset feature type are stored in a spatial data table according to preset rules. Geospatial data is generated based on the data to be published and sent to the client. This achieves the automatic generation of geospatial data from parsed DWG files, improving the efficiency and accuracy of converting DWG files into geospatial data.

[0049] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description

[0050] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.

[0051] Figure 1 This is a flowchart illustrating a method for automatically generating geospatial data based on DWG files, as described in an embodiment of this application.

[0052] Figure 2 This is a structural block diagram of an apparatus for automatically generating geospatial data based on DWG files, as described in an embodiment of this application.

[0053] Figure 3 This is a block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0054] To enable those skilled in the art to better understand the technical solutions of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0055] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0056] It should be noted that smart mines are the core driving force for the coal industry to transform its development model and improve the quality of industry development. However, the overall level of informatization in coal mines still needs further improvement, and various data and information in the production process cannot yet be effectively linked. Based on the need for a unified "one map" integration of multiple coal mine systems, the production of a digital foundation for coal mines is particularly important. Typically, the digital foundation for a unified "one map" in coal mines is based on the mining engineering plan of the mine. In actual production, these mining engineering plans are mostly in DWG data format (DWG is a proprietary file format used by the computer-aided design software AutoCAD and software based on AutoCAD to save design data, originating from the InteractCAD software in the 1970s). How to losslessly convert DWG file data into online GIS (Geographic Information System) services is a crucial step in constructing a digital foundation for a unified "one map" in coal mines.

[0057] Converting a DWG-format mining engineering plan into GIS data and then publishing the converted GIS data as an online map service to serve as the digital foundation for a "single map" of the coal mine requires at least the following three steps: (1) Obtaining the spatial reference information (SRID) of the DWG file; (2) Accurately extracting the spatial information of each layer in the original DWG file and storing it without loss, and then publishing the stored data as an online map service conforming to the OGC (Open Geospatial Consortium) standard; (3) After the data is published as a WebGIS service, the WebGIS layer styles (such as color, line width, etc.) should be consistent with the layer styles in the DWG file.

[0058] Due to the high requirements for ease of use, file fidelity, and conversion efficiency when converting DWG files to WebGIS services, the current process of reading DWG files using GIS software, manually setting spatial references, manually exporting SHP data by layer name, manually setting styles for each layer, and then publishing as a Web service is no longer sufficient for actual production needs. Therefore, it is necessary to propose a complete and efficient method for converting DWG files to WebGIS services to ensure that it meets actual production needs in terms of user convenience, file fidelity, and conversion efficiency.

[0059] Existing ArcGIS platform software provides a method for constructing DWG files to WebGIS services. This method first loads the DWG file using ArcGIS Desktop; then, it selects the Polyline layer and exports all data as SHP data; operators manually set the spatial reference for the exported SHP data in the software using the spatial reference information from the DWG file; the exported data is filtered by the Layer attribute field, and data with the same Layer value are exported as SHP data for that specific layer; based on the style of the corresponding layer name in the DWG file, the style of each exported SHP data is manually set; these layers are published as online REST map services via ArcGIS Server; and finally, the map service is loaded and displayed in the browser using ArcGIS for JavaScript.

[0060] The following are the shortcomings of using ArcGIS platform software to convert DWG files to WebGIS services: (1) It is highly dependent on ArcGIS Desktop software and cannot run across platforms; (2) Each step, such as obtaining spatial information of layers and publishing GIS services, requires manual operation by professionals, which places high demands on the GIS expertise of the operators; (3) During the export of metadata information, each layer needs to be extracted by name, and the style of each layer needs to be manually obtained and configured; (4) ArcGIS has poor support for arc type in DWG files, resulting in the loss of all arc information during the data export process; (5) During the manual data conversion process, a lot of intermediate data will be generated, which is stored on the disk in the form of files, resulting in a waste of disk space.

[0061] To address the aforementioned issues, this application proposes a method and apparatus for automatically generating geospatial data based on DWG files. This method allows for the extraction of metadata information from multiple layers within a DWG file. Based on the spatial information of each layer, spatial reference values ​​are determined from the DWG file. For each layer, detailed information of a preset feature type is preprocessed based on the layer's metadata information. The metadata information, spatial reference values, and preprocessed detailed information of the preset feature type are stored in a spatial data table according to preset rules. Geospatial data is generated based on the data to be published and then sent to the client. This achieves the automatic generation of geospatial data from parsed DWG files, improving the efficiency and accuracy of converting DWG files into geospatial data.

[0062] Figure 1 This is a flowchart illustrating a method for automatically generating geospatial data based on DWG files, as described in an embodiment of this application.

[0063] like Figure 1 As shown, the method for automatically generating geospatial data based on DWG files includes:

[0064] Step 101: Obtain the DWG file and extract the metadata information of each layer in the DWG file.

[0065] In this embodiment of the application, the spatial information of the metadata information layer includes the layer name and layer information.

[0066] In this embodiment, the spatial information of the layer includes detailed information of multiple different feature types.

[0067] As one possible implementation example, the spatial information Layers includes the layer name (LayerName) after parsing the DWG file and the spatial information LayerDetails. Layers can contain detailed information for multiple sets of different FeatureTypeLayers. Since some layers in a DWG file can contain multiple geographic types, such as text information containing line and point annotations, the spatial information LayerDetails can contain detailed information for multiple sets of different FeatureTypeLayers.

[0068] In this embodiment of the application, each set of detailed information includes spatial information and attribute information of at least one element. The attribute information includes text information and style information.

[0069] Optionally, the style information mentioned above may include line segment width, line segment length, color, etc. The text information mentioned above may be annotation information used to label lines and points.

[0070] In some embodiments of this application, the element types include points, lines, surfaces, and arc segments.

[0071] As a possible implementation example, the software development tools provided by ODA (Open Design Alliance) are used to parse DWG format files and extract the metadata information of each layer in the DWG file.

[0072] Step 102: Determine the spatial reference value of the DWG file based on the spatial information of the layer.

[0073] In this embodiment, the Spatial Reference System Identifier (SRID) corresponds to a spatial reference system based on a specific ellipsoid and can be used for planar sphere mapping or circular sphere mapping. Since the scale of most coal mine mining engineering plan maps is greater than 1:10000, maps within this scale range mostly use the 3-degree zone Gauss-Kruger projection. Currently, my country has uniformly converted to the China Geodetic Coordinate System 2000. Because the X-coordinate of geometric objects in a DWG file has 8 decimal places before the decimal point, with the first two digits representing the projection zone number, the Spatial Reference System Identifier (SRID) can be automatically obtained once the reference ellipsoid, 3-degree zone projection method, and zone number are determined. For example, given a point with coordinates X = 36510911.862 and Y = 2965499.737, the X coordinate has 8 decimal places. Therefore, the first two digits, 36, indicate the zone number of the region under the Gauss-Kruger 3-degree projection. Considering that my country currently uses the CGCS2000 reference ellipsoid, the SRID under this condition is 4524. After obtaining the SRID, its value is filled into the spatial data table during subsequent storage of spatial data. A DWG file has one and only one SRID value.

[0074] Step 103: For each layer, preprocess the detailed information of the preset feature type based on the layer's metadata information.

[0075] In some embodiments of this application, step 103 includes:

[0076] Step a1: For each layer, in response to the feature type of the detailed information being arc segment, obtain the center point coordinates, radius, start angle, and end angle of the arc segment based on the layer's metadata information.

[0077] Understandably, CAD records arc segments by recording the coordinates of the center point, radius, starting angle, and ending angle of the arc segment, while GIS systems construct arc segments by recording the coordinate points on the arc segment and then writing them into a spatial data table. Therefore, it is necessary to determine the coordinates of the starting point, ending point, and midpoint of the arc segment.

[0078] As a possible implementation example, for the detailed information of the element type arc segment, the center point coordinates, radius, starting angle and ending angle of the arc segment stored in the detailed information are obtained.

[0079] Step a2: Based on the center point coordinates, radius, starting angle, and ending angle of the arc segment, determine the starting point coordinates and ending point coordinates of the arc segment.

[0080] It is understandable that the coordinates of the starting point and the ending point of the arc segment can be uniquely determined based on the coordinates of the center point, radius, starting angle, and ending angle of the arc segment.

[0081] Step a3: Based on the coordinates of the starting point and ending point of the arc segment, determine the coordinates of the midpoint of the arc segment using interpolation.

[0082] As one possible implementation example, the coordinates of the starting point and ending point of the arc segment are averaged to determine the coordinates of the midpoint of the arc segment.

[0083] In some embodiments of this application, step 103 further includes:

[0084] Step b1: For each layer, in response to the feature type of the detail information being text, obtain the rotation angle value of the text based on the layer's metadata information.

[0085] Understandably, since CAD software defines angles differently than GIS software, the rotation angle of the text needs to be corrected.

[0086] Step b2: Multiply the text rotation angle value by -1 to obtain the corrected rotation angle value.

[0087] As an example of possible implementation, for each layer, if the feature type to which the detail information belongs is text, the rotation angle value of the text is obtained based on the layer's metadata information, and the rotation angle value of the text is multiplied by -1 to obtain the corrected rotation angle value.

[0088] Understandably, preprocessing the detailed information of preset feature types provides support for the automated construction of spatial database tables based on DWG files. This improves the integrity of data during data import and the efficiency of creating new spatial database tables.

[0089] Step 104: Store the metadata information, spatial reference values, and preprocessed details of the preset feature types into the spatial data table according to preset rules.

[0090] As an example of possible implementation, a spatial data structure based on DWG files is pre-built to store metadata information, spatial reference values, and detailed information of pre-processed preset feature types in a spatial data table.

[0091] In some embodiments of this application, the table name of each spatial data table is a unique table name generated by the snowflake algorithm.

[0092] Optionally, in the spatial data table, all features within the same FeatureTypeLayer must be of the same geographic object type, i.e., any one of Point, LineString, or Polygon. The table created from FeatureTypeLayer must have a field named geometry to record feature location information (feature location information can be in WKT format), supporting the storage of feature types such as points, lines, polygons, and arc segments. The backend service will automatically create other fields contained in FeatureTypeLayer, such as RGB (color) and Width (line width), to describe the basic information of the layer style. Each record in FeatureTypeLayer represents a Feature, which includes three aspects: the type field indicating the feature's feature type, the geometry field indicating the feature's spatial location information, and the attributes field indicating all the feature's attribute information.

[0093] The aforementioned spatial data table's robust structure can completely record the geometric, style, and attribute information of layers in the DWG file, providing support for the automated construction of spatial database tables based on DWG files. This improves the completeness of data import and the efficiency of creating new spatial database tables.

[0094] Step 105: Generate geospatial data based on the data to be published, and send the geospatial data to the client.

[0095] As a possible example, the geospatial data mentioned above could be in the form of a web map service.

[0096] In some embodiments of this application, step 105 includes:

[0097] Step d1: Monitor the spatial data table.

[0098] As one possible implementation example, a message middleware could be used to monitor the spatial data table.

[0099] Step d2: In response to the detection of updated data in the spatial data table, geospatial data is generated based on the data to be published.

[0100] Step d3: Send geospatial data to the client.

[0101] Understandably, publishing spatial data from a data table as a web map service based on OGC standards (including geospatial data hosted over the Internet) allows the exchange of spatial information and viewing of it as a map or image through a web browser.

[0102] As a possible implementation example, in response to the detection of updates to the spatial data table, the GIS publishing backend service creates corresponding data storage based on the generated spatial database table. Simultaneously, for each layer, a SLD file with the same name as the layer service is created based on the table name. After setting the layer color, line width, font, etc., the backend program publishes all layers contained in the DWG file as online services of OGC one by one through GeoServer. Once all layers are successfully published as GIS services, a LayerGroup is automatically constructed to store the service addresses of all layers and automatically pushed to the front-end page for easy preview. The WebGIS service can achieve layer-level display and hiding control.

[0103] The method for automatically generating geospatial data based on DWG files according to embodiments of this application involves acquiring a DWG file and extracting metadata information for each of the multiple layers within the DWG file. Based on the spatial information of the layers, spatial reference values ​​are determined for the DWG file. For each layer, detailed information of a preset feature type is preprocessed based on the layer's metadata information. The metadata information, spatial reference values, and preprocessed detailed information of the preset feature type are stored in a spatial data table according to preset rules. Geospatial data is generated based on the data to be published and sent to the client. This method achieves automatic generation of geospatial data from parsed DWG files, improving the efficiency and accuracy of converting DWG files into geospatial data.

[0104] Figure 2 This is a structural block diagram of an apparatus for automatically generating geospatial data based on DWG files, as described in an embodiment of this application.

[0105] like Figure 2 As shown, the device for automatically generating geospatial data based on DWG files includes:

[0106] Extraction module 201 is used to acquire DWG files and extract metadata information of multiple layers in the DWG files. The spatial information of the metadata layer includes the layer name, spatial information and attribute information of the layer. The spatial information of the layer includes multiple sets of detailed information of different feature types. Each set of detailed information includes style information of at least one feature.

[0107] Module 202 is used to determine the spatial reference value of a DWG file based on the spatial information of the layers.

[0108] The preprocessing module 203 is used to preprocess the detailed information of the preset feature type based on the metadata information of the layer for each layer;

[0109] Storage module 204 is used to store metadata information, spatial reference values ​​and preprocessed details of preset feature types into a spatial data table according to preset rules;

[0110] The sending module 205 is used to generate geospatial data based on the data to be published and send the geospatial data to the client.

[0111] According to one embodiment of this application, the preprocessing module is specifically used for:

[0112] For each layer, in response to the feature type of the detailed information being an arc segment, the center point coordinates, radius, starting angle, and ending angle of the arc segment are obtained based on the layer's metadata.

[0113] Based on the coordinates of the center point of the arc segment, the radius of the arc segment, the starting angle of the arc segment, and the ending angle of the arc segment, determine the coordinates of the starting point and the ending point of the arc segment.

[0114] Based on the coordinates of the starting point and ending point of the arc segment, the coordinates of the midpoint of the arc segment are determined by interpolation.

[0115] According to one embodiment of this application, the preprocessing module is further configured to:

[0116] For each layer, in response to the fact that the feature type of the detail information is text, the rotation angle value of the text is obtained based on the layer's metadata information;

[0117] Multiply the text rotation angle value by -1 to obtain the corrected rotation angle value.

[0118] According to one embodiment of this application, the sending module is specifically used for:

[0119] Monitor the spatial data table;

[0120] In response to the detection of updated data in the spatial data table, geospatial data is generated based on the data to be published.

[0121] Send geospatial data to the client.

[0122] According to one embodiment of this application, the element types include points, lines, surfaces, and arc segments.

[0123] According to one embodiment of this application, the table name of each spatial data table is a unique table name generated by the snowflake algorithm.

[0124] The apparatus for automatically generating geospatial data based on DWG files, according to an embodiment of this application, acquires a DWG file and extracts metadata information for each of the multiple layers within the DWG file. Based on the spatial information of the layers, spatial reference values ​​are determined for the DWG file. For each layer, detailed information of a preset feature type is preprocessed based on the layer's metadata information. The metadata information, spatial reference values, and preprocessed detailed information of the preset feature type are stored in a spatial data table according to preset rules. Geospatial data is generated based on the data to be published and sent to a client. This achieves the automatic generation of geospatial data from parsed DWG files, improving the efficiency and accuracy of converting DWG files into geospatial data.

[0125] Figure 3 This is a block diagram of an electronic device according to an embodiment of this application. For example... Figure 3 As shown, the electronic device may include: a transceiver 31, a processor 32, and a memory 33.

[0126] Processor 32 executes computer execution instructions stored in memory, causing processor 32 to perform the scheme in the above embodiments. Processor 32 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0127] The memory 33 is connected to the processor 32 via the system bus and completes communication between them. The memory 33 is used to store computer program instructions.

[0128] Transceiver 31 can be used to obtain the task to be run and its configuration information.

[0129] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0130] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0131] This application also provides a chip for executing instructions, which is used to execute the message processing method described in the above embodiments.

[0132] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the message processing method described in the above embodiments.

[0133] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the message processing method in the above embodiments.

[0134] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0135] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for automatically generating geospatial data based on DWG files, characterized in that, The method includes: Obtain a DWG file and extract metadata information for each of the multiple layers in the DWG file; wherein, the metadata information includes layer name and layer information; the layer information includes multiple sets of detailed information for different feature types; each set of detailed information includes spatial information and attribute information for at least one feature; the attribute information includes text information and style information; Based on the spatial information of the layer, determine the spatial reference value of the DWG file; For each layer, based on the metadata information of the layer, the detailed information of the preset feature type is preprocessed; The metadata information, the spatial reference value, and the preprocessed details of the preset element type are stored in the spatial data table according to preset rules; Geospatial data is generated based on the data to be published, and the geospatial data is sent to the client.

2. The method according to claim 1, characterized in that, For each layer, based on the layer's metadata information, the preprocessing of detailed information for a preset feature type includes: For each layer, in response to the feature type of the detailed information being an arc segment, the center point coordinates, radius, starting angle, and ending angle of the arc segment are obtained based on the metadata information of the layer. Based on the center point coordinates, radius, starting angle, and ending angle of the arc segment, determine the starting point coordinates and ending point coordinates of the arc segment. Based on the coordinates of the starting point and ending point of the arc segment, the coordinates of the midpoint of the arc segment are determined by interpolation.

3. The method according to claim 1, characterized in that, The step of preprocessing detailed information of a preset feature type based on the metadata information of each layer also includes: For each layer, in response to the fact that the feature type of the detailed information is text, the rotation angle value of the text is obtained based on the metadata information of the layer; Multiply the rotation angle value of the text by -1 to obtain the corrected rotation angle value.

4. The method according to claim 1, characterized in that, The step of generating geospatial data based on the data to be published and sending the geospatial data to the client includes: Monitor the spatial data table; In response to the detection of updated data in the spatial data table, geospatial data is generated based on the data to be published. The geospatial data is sent to the client.

5. The method according to claim 1, characterized in that, The element types include points, lines, and surfaces.

6. The method according to claim 1, characterized in that, Each of the aforementioned spatial data tables has a unique name generated using the snowflake algorithm.

7. A device for automatically generating geospatial data based on DWG files, characterized in that, The device includes: The extraction module is used to acquire a DWG file and extract metadata information for each of the multiple layers in the DWG file; wherein, the metadata information includes layer name and layer information; the layer information includes multiple sets of detailed information for different feature types; each set of detailed information includes spatial information and attribute information for at least one feature; the attribute information includes text information and style information; The determination module is used to determine the spatial reference value of the DWG file based on the spatial information of the layer; The preprocessing module is used to preprocess the detailed information of the preset feature type for each layer based on the metadata information of the layer; The storage module is used to store the metadata information, the spatial reference value, and the preprocessed detailed information of the preset element type into the spatial data table according to preset rules; The sending module is used to generate geospatial data based on the data to be published and send the geospatial data to the client.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Spatial data conversion method and system

    CN105279243A

  • Method and system for converting dwg data into gdb data

    CN109933588A