Geographic coordinate conversion method and device for dwg data, computer device and medium

By obtaining the coordinates of the reference point in the DWG data in the geospatial coordinate system, and using the positional relationship between other points in the Cartesian coordinate system and the reference point, as well as the relationship between unit longitude and unit latitude, the coordinates of other points in the DWG data in the geospatial coordinate system are calculated. This solves the problem of complex and inaccurate DWG data conversion, and achieves the effect of simplifying and improving the accuracy of data conversion.

CN115510175BActive Publication Date: 2026-02-24BOE TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211199318.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2026-02-24
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

In existing technologies, the conversion of DWG data into geographic information data is complex and inaccurate, making further data processing impossible.

Method used

By obtaining the coordinates of the reference point in the DWG data in the geospatial coordinate system, and utilizing the positional relationship between other points in the Cartesian coordinate system and the reference point, as well as the relationship between unit longitude and unit latitude, the coordinates of other points in the DWG data in the geospatial coordinate system are calculated, simplifying the conversion process and improving accuracy.

Benefits of technology

It simplifies the data conversion process, improves the accuracy of data conversion, and enables the converted data to be applied to various processing and calibration methods, further enhancing the accuracy of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510175B_ABST
    Figure CN115510175B_ABST
Patent Text Reader

Abstract

The application discloses a geographic coordinate conversion method and device for dwg data, computer equipment and a medium, wherein the geographic coordinate conversion method for dwg data of an embodiment comprises the following steps: obtaining dwg data, wherein points in the dwg data have coordinates in a rectangular coordinate system; obtaining a reference point in the dwg data and obtaining the coordinates of the reference point in a geographic space coordinate system; calculating the coordinates of other points in the dwg data in the geographic space system according to the positional relationship between the other points and the reference point in the dwg file and the relationship between a unit longitude and a unit latitude, so as to complete the conversion. The geographic coordinate conversion method provided by the application completes the conversion by using the relationship between the unit longitude and the unit latitude on the basis of the reference point, and the accuracy of data conversion is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer and geographic information technology, and in particular to a method and apparatus for converting DWG data to geographic coordinates, as well as computer equipment and media. Background Technology

[0002] With the development of technology, the use of various map-related software, such as online maps, is becoming increasingly widespread. The construction of online map services mainly utilizes data sharing between AutoCAD software and other geographic information application platforms. When using online map-related software, it is necessary to load the DWG data generated by AutoCAD and convert the DWG data into standard geographic information data (e.g., Geojson).

[0003] However, the methods for converting DWG data in related technologies require a one-time translation calibration before coordinate transformation based on the offset value. This process is complex and the data processing method is limited. The converted data cannot be further processed, resulting in low accuracy. Summary of the Invention

[0004] To address at least one of the aforementioned problems, the first aspect of this application provides a method for transforming geographic coordinates of DWG data, comprising:

[0005] Obtain DWG data, where points in the DWG data have coordinates in a Cartesian coordinate system;

[0006] Obtain the reference point from the DWG data and obtain the coordinates of the reference point in the geospatial coordinate system;

[0007] Based on the positional relationships between other points in the DWG data and the reference point, as well as the relationship between units of longitude and latitude, calculate the coordinates of other points in the DWG data in the geospatial system to complete the transformation.

[0008] Wherein, the unit longitude and unit latitude satisfy:

[0009]

[0010] Among them, dlen lat dlen represents latitude. lon The unit represents longitude. lat2-lat1 represents the difference in latitude length between any two points with different longitudes. lon2-lon1 represents the difference in longitude length between any two points. lat2 represents the latitude in radians of any one of the two points.

[0011] In some optional embodiments, acquiring DWG data further includes:

[0012] Obtain the dwg file. The data in the dwg file includes: point layers, line layers, and surface layers, which are named according to preset names.

[0013] Read the dwg file to obtain the dwg data.

[0014] In some optional embodiments, the coordinates of other points in the DWG data in the geographic coordinate system are calculated based on the positional relationship between other points in the DWG file and the reference point, as well as the relationship between unit longitude and unit latitude. This further includes:

[0015] Based on the positional comparison between the DWG graphic and the geographic satellite image, it was determined that there is a displacement deviation in a certain direction between the DWG graphic and the geographic satellite image.

[0016] Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system;

[0017] Based on the coordinate difference between the corresponding point and the reference point, the coordinates of the DWG data are translated and calibrated to complete the transformation.

[0018] In some optional embodiments, the coordinates of other points in the DWG data in the geographic coordinate system are calculated based on the positional relationship between other points in the DWG file and the reference point, as well as the relationship between unit longitude and unit latitude. This further includes:

[0019] Based on the positional comparison between the DWG graphic and the geographic satellite image, it was determined that there is a displacement deviation between the DWG graphic and the geographic satellite image along two certain directions.

[0020] Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system;

[0021] Based on the corresponding point of the reference point, the displacement ratio of the reference point relative to the benchmark point in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system, the coordinates of the DWG data are scaled and calibrated to complete the transformation.

[0022] In some optional embodiments, the ratio of the displacement between the reference point and the base point to the displacement between the corresponding point of the reference point and the base point is equal to the ratio of the displacement between the point to be calibrated and the base point to the displacement between the target point of the point to be calibrated and the base point.

[0023] In some optional embodiments, obtaining the dwg file further includes:

[0024] Export the original dwg file from the drawn graphic;

[0025] Generate a closed polyline figure from a two-dimensional polyline closed figure;

[0026] Based on the graphic properties of closed polyline figures, closed polyline figures are divided into point layers, line layers, and surface layers; and

[0027] Name and store the point layer, line layer, and surface layer with preset names respectively.

[0028] In some optional embodiments, the dwg file further includes: an indoor map, shape annotations saved in JSON format, and

[0029] Each geospace in the dwg file has a named directory, which contains individually named outdoor map files and at least one building floor map file.

[0030] A second aspect of this application provides a geographic coordinate transformation device for DWG data, comprising:

[0031] The acquisition module is configured to acquire DWG data, where points in the DWG data have coordinates in a Cartesian coordinate system.

[0032] Select the module and configure it to obtain the reference point in the DWG data and obtain the coordinates of the reference point in the geospatial coordinate system;

[0033] The conversion module calculates the coordinates of other points in the DWG data within the geospatial system based on the positional relationships between other points in the DWG data and the reference point, as well as the relationship between units of longitude and latitude, to complete the conversion.

[0034] Wherein, the unit longitude and unit latitude satisfy:

[0035]

[0036] Among them, dlen lat dlen represents latitude. lon The unit represents longitude. lat2-lat1 represents the difference in latitude length between any two points with different longitudes. lon2-lon1 represents the difference in longitude length between any two points. lat2 represents the latitude in radians of any one of the two points.

[0037] A third aspect of this application provides a computer-readable storage medium having a computer program stored thereon that, when executed by a processor, implements the method described above.

[0038] A fourth aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described above.

[0039] The beneficial effects of this application are as follows:

[0040] This application addresses existing problems by developing a method, apparatus, computer equipment, and medium for geographic coordinate transformation of DWG data. It involves obtaining a reference point from the DWG data and its coordinates in a geographic spatial coordinate system. By utilizing the positional relationships between other points in the Cartesian coordinate system and the reference point, combined with the relationship between unit longitude and unit latitude, the transformation of all coordinate points to their geographic spatial coordinates is completed. This simplifies the data transformation process, improves the accuracy of the transformation, and allows for various processing and calibration applications, further enhancing the accuracy of the data and demonstrating broad application prospects. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 A flowchart illustrating a method for transforming geographic coordinates of DWG data according to an embodiment of this application is shown.

[0043] Figure 2 A flowchart illustrating a geographic coordinate transformation method according to another embodiment of this application is shown;

[0044] Figure 3 and Figure 4 A schematic interface diagram showing the method steps in a geographic coordinate transformation method according to an embodiment of this application;

[0045] Figure 5 A schematic diagram illustrating the relationship between a rectangular coordinate system and a geographic spatial coordinate system in a geographic coordinate transformation method according to an embodiment of this application is shown.

[0046] Figure 6 A schematic interface diagram showing the method steps in a geographic coordinate transformation method according to an embodiment of this application;

[0047] Figure 7 A flowchart illustrating a geographic coordinate transformation method according to another embodiment of this application is shown;

[0048] Figure 8 A schematic diagram illustrating the translation calibration process in a geographic coordinate transformation method according to an embodiment of this application is shown.

[0049] Figure 9 A flowchart illustrating a geographic coordinate transformation method according to another embodiment of this application is shown;

[0050] Figure 10 A schematic diagram illustrating the scaling calibration process in a geographic coordinate transformation method according to an embodiment of this application is shown.

[0051] Figure 11 and Figure 12 A schematic interface diagram showing the method steps in a geographic coordinate transformation method according to an embodiment of this application;

[0052] Figure 13 A schematic structural block diagram of a geographic coordinate transformation device for DWG data according to another embodiment of this application is shown; and

[0053] Figure 14 This illustration shows a structural schematic diagram of a computer device according to another embodiment of this application. Detailed Implementation

[0054] To more clearly illustrate this application, the following description, in conjunction with preferred embodiments and accompanying drawings, further clarifies the application. Similar components in the drawings are indicated by the same reference numerals. Those skilled in the art should understand that the specific description below is illustrative rather than restrictive and should not be construed as limiting the scope of protection of this application.

[0055] It should be noted that the terms "having", "comprising", and "including" used in this application are all open-ended, meaning that when a method is described as "having", "comprising", or "including" the first step, the second step, and / or the third step, it indicates that the module includes other steps in addition to the first step, the second step, and / or the third step.

[0056] To solve at least one of the above problems, such as Figure 1 As shown, an embodiment of this application provides a method for transforming geographic coordinates of DWG data, including:

[0057] S1. Obtain DWG data. Points in the DWG data have coordinates in a Cartesian coordinate system.

[0058] S2. Obtain the reference point from the DWG data and obtain the coordinates of the reference point in the geospatial coordinate system;

[0059] S3. Based on the positional relationships between other points in the DWG file and the reference point, as well as the relationship between units of longitude and latitude, calculate the coordinates of other points in the DWG data in the geospatial system to complete the transformation.

[0060] Wherein, the unit longitude and unit latitude satisfy:

[0061]

[0062] Among them, dlen latdlen represents latitude. lon The unit represents longitude. lat2-lat1 represents the difference in latitude length between any two points with different longitudes. lon2-lon1 represents the difference in longitude length between any two points. lat2 represents the latitude in radians of any one of the two points.

[0063] In this embodiment, by obtaining a reference point from the DWG data and its coordinates in the geospatial coordinate system, the positional relationship between other points in the Cartesian coordinate system and the reference point, combined with the relationship between unit longitude and unit latitude, is used to complete the conversion of all coordinate points to coordinates in the geospatial coordinate system. This simplifies the data conversion process, improves the accuracy of the data conversion, and allows the converted data to be processed and calibrated in various ways, providing conditions for further improving the accuracy of the data.

[0064] It should be noted that the geographic coordinate transformation method for DWG data in this application embodiment can be implemented as a transformation plugin or firmware loaded into a server or terminal device. When the transformation plugin or firmware is installed and started, the DWG data to be transformed is read and the geographic coordinate transformation process is completed in response to the user's operation. Those skilled in the art should understand that the user's operation should be implemented based on a human-computer interaction interface, and the specific process will be described in detail below. In addition, the geographic coordinate transformation method for DWG data in this application embodiment is not limited to being implemented in a single plugin. For example, some steps can also be performed by using engineering drawing software (e.g., AutoCAD software) to standardize and process the data before importing it into the above-mentioned transformation plugin or firmware for reading and transformation, which will not be elaborated here.

[0065] The following describes in detail the process of the geographic coordinate transformation method for DWG data in this application, with reference to specific examples.

[0066] Step S1: Obtain DWG data. Points in the DWG data have coordinates in a Cartesian coordinate system.

[0067] First, it's important to clarify that the geographic data currently used in geographic application platforms is stored as regular graphical representations, typically closed shapes composed of polylines (such as various closed polygons) formed by points, polylines, and polygons. This allows for the identification of building outlines, roads, and other features. However, DWG data used in Geographic Information Systems (GIS) is a common type of data in engineering drawing software (such as AutoCAD). In actual files, it contains numerous objects without fixed rules, making it difficult to extract corresponding information from DWG data. Therefore, directly converting DWG data presents drawbacks such as complex operations, lack of data type differentiation (leading to data corruption), and inability to output in a standard geographic information data format. Consequently, the converted data is often inaccurate and cannot be directly applied in Geographic Information Systems (GIS).

[0068] With this in mind, in the embodiments of this application, a standardized data specification is defined when loading the drawn graphics, and standardized dwg data is generated according to the data specification for use in subsequent conversion steps.

[0069] Specifically, obtaining DWG data may include: obtaining a DWG file, the data in the DWG file including point layers, line layers and surface layers named according to preset names; and reading the DWG file to obtain the DWG data.

[0070] Through this setting, the embodiments of this application provide a simplified DWG data specification. By separating the irregular and indiscriminately disordered object data (points, lines, and surfaces) into layers and naming them according to preset names, the point, line, and surface layers of DWG data can be read according to the agreed names during conversion. The data can be accurately identified according to type, such as building outlines and roads, thereby ensuring that the read and converted data is a standard geographic information data format that can be directly applied.

[0071] To be more specific, refer to Figure 2 As shown, obtaining DWG data further includes:

[0072] Step S11: Export the original dwg file from the drawn graphics. The dwg file exported in this step can be a dwg file that is created and drawn directly in engineering drawing software (e.g., AutoCAD) and then exported. Alternatively, it can be a dwg file that is created by deleting redundant graphics in existing CAD drawings, then imported into software such as 3D MAX for drawing, and then exported.

[0073] Step S12: Generate a polyline closed figure from a two-dimensional polyline closed figure. When not standardized, the graphic data is stored as a closed figure composed of two-dimensional polylines. Each closed figure is still in the form of multiple line segments. In this step, these closed figures composed of multiple line segments are regenerated into a polyline closed figure (i.e., data represented as a graphic). The road segments need to be redrawn manually.

[0074] Step S13: Divide the polyline closed figure into point layer, line layer and surface layer according to the graphic attributes of the polyline closed figure. That is, divide the data into point layer, line layer and surface layer according to the graphic attributes.

[0075] Step S14: Name and store the point layer, line layer and surface layer with preset names respectively.

[0076] For example, the point layer is named POINT, the line layer is named POLYLINE, and the surface layer is named POLYGON. The point layer is responsible for marking points of interest or navigation guide points, which are generally point targets and locations such as the start / end position of a road, the entrance / exit position of a building, etc. The shapes in the line layer represent roads or linear features, and are represented by polylines (polylines). The shapes in the surface layer are polygons and cannot overlap, and are represented by closed polylines (polylines).

[0077] In addition to the above settings, to make the acquired DWG data more accurate and standardized, and to ensure higher accuracy of the converted data, the acquired DWG file may also include: indoor maps, shape annotations saved in JSON format, and each geospace in the DWG file has a named directory containing separately named outdoor map files and at least one building floor map file.

[0078] Specifically, in this application, the DWG data includes an indoor map divided into multiple indoor DWG charts according to the floors. One indoor DWG chart represents one floor. The objects inside are mainly large regular polygons such as walls and building areas. Each floor may be different in shape or location, so an outermost layer of the overall building outline is required.

[0079] Shape annotations saved in JSON format are also an important part of the DWG file. The key is a string representing the handle of the shape in the DWG file, and the value can be a string or JSON data. If it's a string, it represents the name of the corresponding shape; JSON data represents the specific attributes of the corresponding shape. It supports the `name`, `description`, and `data` attributes.

[0080] The naming conventions for DWG files define their organization. Each outdoor area and each building floor is represented by a separate map. To maintain a clean and easy-to-understand directory, each geographic space should have a directory named after that geographic space. This directory contains the outdoor map files with the same name for that geographic space, as well as directories named after buildings. The building directory contains map files for each floor of that building, named with a number followed by the floor number, e.g., "Floor 1".

[0081] Additionally, in the embodiments of this application, the orientation of the DWG image must be north at the top and south at the bottom, and the length unit of objects in the image must be meters, with an accuracy to the millimeter. Since the standard geographic information data specification Geojson does not support curves, the curves in the DWG image need to be drawn as approximate broken lines. Templates are not used in the DWG file. It should be noted that the above process of obtaining DWG data, for users specifically operating conversion plugins or firmware, manifests as... Figure 3The interface shown in the image uses bold text to indicate the next step in the conversion process. After opening the conversion plugin on the server or terminal device, the user can locate the storage address of the DWG file from the local machine or cloud based on the text prompts on the interface. The user can then drag and drop or double-click to open the corresponding data, resulting in an image of the opened DWG file appearing at the bottom of the interface (see [link]). Figure 3 As shown in the image, the user can obtain the dwg data and then click the next button to proceed to the next step of specifying the origin.

[0082] It is worth emphasizing that DWG data is based on DWG drawing data in engineering drawing software, where each point representing the graphic has coordinates in a Cartesian coordinate system.

[0083] In addition, in the embodiments of this application, the obtained dwg data can be a dwg file that has been normalized according to the above rules, or it can be an unnormalized dwg original file. In the process of obtaining dwg data, the dwg original file is normalized according to the above rules and opened to obtain dwg data.

[0084] In step S2, the reference point is obtained from the dwg data and its coordinates in the geospatial coordinate system are obtained.

[0085] When creating a DWG drawing, the Cartesian coordinate system has a default origin and its corresponding coordinates (0, 0). For convenience, this example can select the reference point as the origin. Of course, those skilled in the art should understand that the reference point is only used as a reference point for data coordinate transformation and has no other special limitations. Therefore, this application does not limit the reference point to the origin; the reference point can be any point in the DWG data, which will not be elaborated further here.

[0086] Reference Figure 4 As shown, a reference point can be obtained by clicking on it in the map. The reference point will then be marked with a crosshair on the interface, and its coordinates in the Cartesian coordinate system can be read. Preferably, for ease of subsequent calculations, the selected reference point can be set as the origin, and other points will have clearly defined coordinates based on their relative positions, using the origin's coordinates as a basis. Additionally, the coordinates of the reference point in the geospatial coordinate system are read. Reading the coordinates of the reference point in the geospatial coordinate system assumes that these coordinates are known and pre-filled in the conversion plugin. This is because the reference point is the most important guarantee for ensuring the accuracy of data in the subsequent conversion process. In this application, the reference point must be actual data obtained through surveying, and it is recommended that the data be retained to six decimal places.

[0087] In step S3, the coordinates of other points in the DWG data in the geospatial system are calculated based on the positional relationship between other points in the DWG data and the reference point, as well as the relationship between unit longitude and unit latitude, to complete the transformation.

[0088] Specifically, in geographic information systems, a large geographical or architectural scene is not typically described in a single DWG file. In other words, the application scenario of the DWG data in a DWG file is usually not very large. For example, a DWG file usually describes a scene within the scope of a newly built park that needs to update geographic data. In this case, the geographical area occupied by a scene is generally only within a radius of a few kilometers. In this embodiment, the latitude can be considered constant within a small area with a side length of less than 3 kilometers, and the bottom surface can also be considered flat.

[0089] Reference Figure 5 As shown, using radians to represent latitude, the length of 1 latitude is:

[0090] (1)

[0091] Where R represents the Earth's radius, and lat represents latitude in radians.

[0092] The distance between two longitudes decreases as latitude increases. At the latitude lat, the length corresponding to 1 degree of longitude is:

[0093]

[0094] Therefore, the coordinates of longitude and latitude in a plane are: ( ).

[0095] Since we have assumed that the latitude remains constant within a small range, the difference in longitude between any two points with different longitudes can be expressed as:

[0096] (3)

[0097] Therefore, the units of longitude and latitude are expressed as follows:

[0098]

[0099] It can be simplified to:

[0100]

[0101] As mentioned above, when considering longitude within a small range, latitude remains constant, thus allowing the latitude radians of any two points with different longitudes to replace the latitude radian parameter in expression (5). Therefore, unit longitude and unit latitude satisfy:

[0102]

[0103] Among them, dlen lat dlen represents latitude. lon The unit represents longitude, lat2-lat1 represents the difference in latitude length between any two points with different longitudes, lon2-lon1 represents the difference in longitude length between the two points, and lat2 represents the latitude radians of one of the two points.

[0104] Since the expression (6) relating unit longitude and unit latitude is obtained, it can be understood that since all points in the DWG data have coordinates in a rectangular coordinate system, as long as the actual coordinates of a point in the DWG data in the geographic spatial coordinate system are known, the latitude and longitude coordinates (i.e., coordinates in the geographic spatial coordinate system) of all other points can be obtained using expression (6). In the embodiments of this application, the known point is the reference point obtained in the above steps, and the actual coordinates of the reference point in the geographic spatial coordinate system have been obtained, and the coordinates are accurate data obtained through surveying.

[0105] In this specific example, we set the coordinates of the origin in the rectangular coordinate system to (0, 0), and the coordinates of the origin in the geographic coordinate system to (lon1, lat1). Since other points have relative coordinates based on this origin, let a target point to be determined be (x, y), and its coordinates in the geographic coordinate system be (lon2, lat2), where x is equivalent to dlen. lon y is equivalent to dlen lat This yields the following system of equations:

[0106]

[0107]

[0108] Solving the above system of equations yields:

[0109]

[0110]

[0111] Using the above method, the coordinates of all other points in the DWG data can be calculated in the geospatial coordinate system based on their relative position to the origin and the ratio between unit longitude and unit latitude. In this application, because the positional relationship between each point in the DWG data and the origin is accurate, and the coordinates of the origin in the geospatial coordinate system are accurate values ​​obtained through surveying, and the above expression (6) is unique, the coordinates obtained in the geospatial coordinate system are also accurate. Moreover, the coordinates of all points in the geospatial coordinate system can be obtained through simple computer calculations, which is a simple method. In addition, the above coordinate transformation process does not perform any other processing on the original data, which facilitates further calibration of the data in various aspects and makes the application more flexible. The specific calibration process will be described in detail below.

[0112] Additionally, it should be noted that the above is based on the coordinate transformation process, referring to... Figure 6 As shown, users who want to convert plugins or firmware can do so by clicking the conversion button on the interface. After the conversion is complete, users can click the next button to enter the calibration process, which will not be elaborated further here.

[0113] In the embodiments of this application, preferably, considering that the drawn graphics are displayed under a scaled-down area of ​​several kilometers, there may be offset errors in the actual drawing. Even a small deviation on the screen will result in significantly inaccurate data in the actual geographic information system, which is detrimental to application. In the geographic coordinate transformation method of this application, after obtaining the coordinates of all points in the DWG data in the geographic spatial coordinate system, a calibration process is performed.

[0114] In some alternative embodiments, refer to Figure 7 As shown, based on the positional relationship between other points in the DWG file and the reference point, as well as the relationship between unit longitude and unit latitude, the coordinates of other points in the DWG data in the geographic coordinate system are calculated, further including:

[0115] S31-1. Based on the position comparison between the DWG graphic and the geographic satellite image, determine that there is a displacement deviation in a certain direction between the DWG graphic and the geographic satellite image.

[0116] S32-1. Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system.

[0117] S33-1. Based on the coordinate difference between the corresponding point and the reference point, the coordinates of the dwg data are translated and calibrated to complete the transformation.

[0118] Specifically, in step S31-1, refer to Figure 6 As shown, when calibration is about to be performed, for example, when the user clicks the conversion button, the geographic satellite image taken by the satellite is retrieved and overlaid on the DWG data layer for comparison. The comparison determines whether there is an error between the DWG graphic and the geographic satellite image, and if so, what kind of error exists.

[0119] In this example, it is determined that there is a displacement deviation in a certain direction between the DWG graphic and the geographic satellite image, that is, there is an overall offset between the two.

[0120] At this time, in step S32-1, refer to Figure 8 As shown, according to the vector translation invariance, for a vector in the same coordinate system, its magnitude is the straight-line distance between the starting point and the ending point. When this vector is moved (regardless of which direction it is moved), the length of this vector remains unchanged, that is, the magnitude of the vector does not change with the movement.

[0121] Based on the above theory, after obtaining the coordinates of all points in the DWG data in the geospatial coordinate system, we take any point in the DWG data as a reference point and its coordinates in the geospatial coordinate system, and obtain the coordinates of the corresponding point in the geographic satellite image in the geospatial coordinate system, so as to obtain the vector length of the offset of the DWG graphic relative to the geographic satellite image.

[0122] Reference Figure 8 As shown, assuming reference point A is taken as the origin, its coordinates in the geographic space coordinate system are (0, 0), and the corresponding point of reference point A in the geographic satellite image is A', with coordinates in the geographic space coordinate system being (dlen). lon dlen lat Additionally, in the DWG data, a point to be calibrated is selected, with coordinates (lon, lat) in the geospatial coordinate system. Here, we take point B as an example for explanation. In practical applications, the point to be calibrated should be a point where deviation occurs, such as other points in the DWG data other than the reference point.

[0123] In step S33-1, based on the reference point obtained above, and based on the coordinate difference between the corresponding point and the reference point, in this example, the difference in longitude is dlen. lon The difference in latitude is dlen. lat Then the longitude and latitude coordinates of the point B to be calibrated are also translated by the corresponding values, which are then the coordinates in the geographic space coordinate system after calibration. The coordinates of B' are (lon + dlen) lon lat+dlen lat ).

[0124] In some alternative embodiments, refer to Figure 9As shown, based on the positional relationship between other points in the DWG file and the reference point, as well as the relationship between unit longitude and unit latitude, the coordinates of other points in the DWG data in the geographic coordinate system are calculated, further including:

[0125] S31-2. Based on the position comparison between the DWG graphic and the geographic satellite image, determine that there is a displacement deviation between the DWG graphic and the geographic satellite image in two directions.

[0126] S32-2. Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system.

[0127] S33-2. Based on the corresponding point of the reference point and the displacement ratio of the reference point relative to the benchmark point in the geospatial coordinate system, as well as the coordinates of the point to be calibrated in the geospatial coordinate system, the coordinates of the dwg data are scaled and calibrated to complete the transformation.

[0128] Specifically, in step S31-2, refer to Figure 6 As shown, when calibration is about to be performed, for example, when the user clicks the conversion button, the geographic satellite image taken by the satellite is retrieved and overlaid on the DWG data layer for comparison. The comparison determines whether there is an error between the DWG graphic and the geographic satellite image, and if so, what kind of error exists.

[0129] The difference lies in the fact that, in this example, it is determined that there is a displacement deviation between the DWG graphic and the geographic satellite image in two directions. In other words, sometimes when a building is drawn, the wall edges are not as strictly vertical as expected, but may be tilted; or sometimes the width of the building outline is not strictly in accordance with the specified size, indicating that the two outlines of the outer wall are shifted outward to both sides, which means that the wall has been enlarged.

[0130] At this time, in step S32-2, refer to Figure 10 As shown, since the coordinate system transformation is a linear transformation, the two vectors have the following characteristics: (1) the length ratio of the two vectors in different coordinate systems is the same; (2) the angle between the two vectors in different coordinate systems is the same. That is to say, if points C and D are currently offset points and E and F are accurate points, then according to the above characteristics, ΔOCD is similar to ΔOEF.

[0131] Based on this, if OC=k1, OE=k2, OD=k3, OF=k4, then according to the similar triangle theorem, the following relationship exists:

[0132]

[0133] Therefore, referring to the above relationships, as long as it is known Figure 10 The coordinates of the fourth point can be obtained from the coordinates of the three points in the diagram.

[0134] In step S32-2, the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system are obtained. Specifically, in this example, the reference point is C, and its coordinates in the geospatial coordinate system are (lon1, lat1). The coordinates of the corresponding point E of the reference point C in the geospatial satellite image are (lon2, lat2). The point to be calibrated is D, and its coordinates in the geospatial coordinate system are (lon3, lat3). The target point is F, and its coordinates in the geospatial coordinate system are (lon4, lat4). In addition, the reference point is the known O(lon0, lat0). Here, lon0=0, lat0=0.

[0135] In step S33-2, based on the above distance relationship, the coordinates (lon4, lat4) of the target point F in the geographic spatial coordinate system are calculated according to the known coordinates.

[0136] Specifically, since the ratio k1 / k2 of the displacement between reference point C and datum point O to the displacement between the corresponding point E of reference point C and datum point O is equal to the ratio k3 / k4 of the displacement between the point to be calibrated D and datum point O to the displacement between the target point F of the point to be calibrated D and datum point O, based on the above coordinates, this relationship can be expressed as:

[0137]

[0138] Since (lon1, lat1) and (lon2, lat2) are known, k is known.

[0139] Furthermore, since "the angle between the two vectors is the same in different coordinate systems", let the angle between k3 and k4 and the horizontal axis be 'a', then we have:

[0140]

[0141] Therefore, we have:

[0142]

[0143] Substituting it into expression (10), we get the expression:

[0144] From expression (11), we get:

[0145]

[0146] according to Figure 10 The relationship is known to be that

[0147]

[0148] Then we get:

[0149]

[0150] Similarly, we get:

[0151]

[0152] By using the above settings and the coordinates of the converted DWG data in the geospatial coordinate system, the type of deviation is determined by comparing the position between the DWG graphic and the geographic satellite image. Different calibration methods are then applied based on the specific type of deviation. In other words, because the coordinates in the geospatial coordinate system have already been converted, the calibration process is more targeted by addressing specific coordinate issues. Furthermore, directly using geometric relationships for translation and scaling calibration makes the calibration process simple, accurate, and easy to implement, resulting in more applicable geographic information.

[0153] It should be noted that the above calibration process is based on... Figure 11 As shown, for users who are specifically operating the conversion plugin or firmware, they can achieve this by clicking the calibration button in the interface. Whether it is translation calibration in one direction or scaling calibration in two directions is not immediately apparent to the user. After the background calibration is completed, the interface will display the aligned DWG image after calibration.

[0154] After the calibration process is complete, if you click Next, as follows: Figure 12 As shown, the converted geographic data can be saved in JSON format by selecting or entering a save address, thus generating accurate geographic data that can be directly applied by a geographic information system. Furthermore, it should be noted that in the embodiments of this application, the converted coordinates will be WGS84 coordinates. Of course, this application does not intend to limit the specific geographic coordinate type; in some application scenarios, it can also be converted to other geographic coordinate standards, which will not be elaborated here.

[0155] For the geographic coordinate transformation method corresponding to DWG data, refer to... Figure 13 As shown, embodiments of this application also provide a geographic coordinate transformation apparatus for implementing the geographic coordinate transformation method described above, comprising:

[0156] The acquisition module 101 is configured to acquire DWG data, where points in the DWG data have coordinates in a Cartesian coordinate system.

[0157] Select module 102 and configure it to obtain a reference point from the dwg data and obtain the coordinates of the reference point in the geospatial coordinate system.

[0158] The conversion module 103 calculates the coordinates of other points in the DWG data in the geospatial system based on the positional relationships between other points in the DWG file and the reference point, as well as the relationship between units of longitude and latitude, to complete the conversion.

[0159] Wherein, the unit longitude and unit latitude satisfy:

[0160]

[0161] Among them, dlen lat dlen represents latitude. lon The unit represents longitude. lat2-lat1 represents the difference in latitude length between any two points with different longitudes. lon2-lon1 represents the difference in longitude length between any two points. lat2 represents the latitude in radians of any one of the two points.

[0162] In this embodiment, a reference point is obtained from the DWG data by a selection module, and the coordinates of the reference point in the geospatial coordinate system are obtained. Then, a conversion module is used to convert all coordinate points to coordinates in the geospatial coordinate system by utilizing the positional relationship between other points in the rectangular coordinate system and the reference point, and combining the relationship between unit longitude and unit latitude. This simplifies the data conversion process, improves the accuracy of data conversion, and allows the converted data to be processed and calibrated in various ways, providing conditions for further improving the accuracy of the data and showing broad application prospects.

[0163] Another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon. When executed by a processor, the program performs the following: acquiring DWG data, wherein points in the DWG data have coordinates in a Cartesian coordinate system; acquiring a reference point in the DWG data and acquiring the coordinates of the reference point in a geographic spatial coordinate system; and calculating the coordinates of other points in the DWG data in the geographic spatial system based on the positional relationship between other points in the DWG data and the reference point, as well as the relationship between unit longitude and unit latitude, to complete the conversion.

[0164] In practical applications, a computer-readable storage medium can take any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0165] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.

[0166] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0167] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0168] like Figure 14As shown, another embodiment of this application provides a structural schematic diagram of a computer device. Figure 14 The computer device 13 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0169] like Figure 14 As shown, the computer device 13 is represented in the form of a general-purpose computing device. The components of the computer device 13 may include, but are not limited to: one or more processors or processor units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processor unit 16).

[0170] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0171] Computer device 13 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 13, including volatile and non-volatile media, removable and non-removable media.

[0172] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 13 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 14 Not shown; usually referred to as a "hard drive"). Although Figure 14 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0173] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this application.

[0174] Computer device 13 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 13, and / or with any device that enables the computer device 13 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 52. Furthermore, computer device 13 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 50. Figure 14 As shown, network adapter 50 communicates with other modules of computer device 13 via bus 18. It should be understood that, although... Figure 14 As not shown, other hardware and / or software modules may be used in conjunction with computer device 13, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0175] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a code update method based on the K8S platform provided in the embodiments of this application.

[0176] This application addresses existing problems by developing a method, apparatus, computer equipment, and medium for geographic coordinate transformation of DWG data. It involves obtaining a reference point from the DWG data and its coordinates in a geographic spatial coordinate system. By utilizing the positional relationships between other points in the Cartesian coordinate system and the reference point, combined with the relationship between unit longitude and unit latitude, the transformation of all coordinate points to their geographic spatial coordinates is completed. This simplifies the data transformation process, improves the accuracy of the transformation, and allows for various processing and calibration applications, further enhancing the accuracy of the data and demonstrating broad application prospects.

[0177] Obviously, the above embodiments of this application are merely examples for clearly illustrating this application, and are not intended to limit the implementation of this application. For those skilled in the art, other variations or modifications can be made based on the above description. It is impossible to exhaustively list all implementation methods here. Any obvious variations or modifications derived from the technical solutions of this application are still within the protection scope of this application.

Claims

1. A method for transforming geographic coordinates of DWG data, characterized in that, include: Acquire DWG data, wherein the points in the DWG data have coordinates in a Cartesian coordinate system; Obtain the reference point from the DWG data and obtain the coordinates of the reference point in the geospatial coordinate system; Based on the positional relationships between other points in the DWG data and the reference point, as well as the relationship between units of longitude and latitude, the coordinates of the other points in the DWG data in the geospatial system are calculated to complete the transformation. Wherein, the unit longitude and the unit latitude satisfy: Among them, dlen lat dlen represents latitude. lon The unit represents longitude; lat2-lat1 represents the difference in latitude in radians between any two points with different longitudes; lon2-lon1 represents the difference in longitude length between the two points; and lat2 represents the latitude in radians of one of the two points. The step of calculating the coordinates of the other points in the DWG data in the geographic coordinate system based on the positional relationship between the other points in the DWG data and the reference point, and the relationship between unit longitude and unit latitude, further includes: Based on the positional comparison between the DWG graphic and the geographic satellite image, it is determined that there is a displacement deviation between the DWG graphic and the geographic satellite image in two directions. Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system; Based on the corresponding point of the reference point and the displacement ratio of the reference point relative to the benchmark point in the geospatial coordinate system, as well as the coordinates of the point to be calibrated in the geospatial coordinate system, the coordinates of the point to be calibrated in the geospatial coordinate system in the dwg data are scaled and calibrated to complete the conversion.

2. The geographic coordinate transformation method according to claim 1, characterized in that, The acquisition of DWG data further includes: Obtain a dwg file, the data in the dwg file including: point layers, line layers and surface layers named according to preset names respectively; Read the dwg file to obtain the dwg data.

3. The geographic coordinate transformation method according to claim 1, characterized in that, The step of calculating the coordinates of the other points in the DWG data in the geographic coordinate system based on the positional relationship between the other points in the DWG data and the reference point, and the relationship between unit longitude and unit latitude, further includes: Based on the positional comparison between the DWG graphic and the geographic satellite image, it is determined that there is a displacement deviation along a certain direction between the DWG graphic and the geographic satellite image. Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system; Based on the coordinate difference between the corresponding point and the reference point, the coordinates of the point to be calibrated in the DWG data are translated and calibrated in the geospatial coordinate system to complete the transformation.

4. The geographic coordinate transformation method according to claim 1, characterized in that, in, The ratio of the displacement between the reference point and the benchmark point to the displacement between the corresponding point of the reference point and the benchmark point is equal to the ratio of the displacement between the point to be calibrated and the benchmark point to the displacement between the target point of the point to be calibrated and the benchmark point.

5. The geographic coordinate transformation method according to claim 2, characterized in that, The process of obtaining the dwg file further includes: Export the original dwg file from the drawn graphic; Generate a closed polyline figure from a two-dimensional polyline closed figure; Based on the graphic attributes of the polyline closed graphic, the polyline closed graphic is divided into a point layer, a line layer, and a surface layer; and The point layer, line layer, and surface layer are named and stored using preset names.

6. The geographic coordinate transformation method according to claim 2, characterized in that, in, The dwg file also includes: an indoor map, shape annotations saved in JSON format, and Each geospace in the dwg file has a named directory, which contains individually named outdoor map files and at least one building floor map file.

7. A geographic coordinate transformation device for DWG data, characterized in that, include: The acquisition module is configured to acquire DWG data, wherein the points in the DWG data have coordinates in a Cartesian coordinate system; Select the module and configure it to obtain a reference point from the DWG data and obtain the coordinates of the reference point in the geospatial coordinate system; The conversion module calculates the coordinates of the other points in the DWG data in the geospatial system based on the positional relationship between the other points in the DWG data and the reference point, as well as the relationship between units of longitude and latitude, to complete the conversion. Wherein, the unit longitude and the unit latitude satisfy: Among them, dlen lat dlen represents latitude. lon The unit represents longitude; lat2-lat1 represents the difference in latitude in radians between any two points with different longitudes; lon2-lon1 represents the difference in longitude length between the two points; and lat2 represents the latitude in radians of one of the two points. The step of calculating the coordinates of the other points in the DWG data in the geographic coordinate system based on the positional relationship between the other points in the DWG data and the reference point, and the relationship between unit longitude and unit latitude, further includes: Based on the positional comparison between the DWG graphic and the geographic satellite image, it is determined that there is a displacement deviation between the DWG graphic and the geographic satellite image in two directions. Obtain the coordinates of the reference point in the DWG data in the geospatial coordinate system, the coordinates of the corresponding point of the reference point in the geographic satellite image in the geospatial coordinate system, and the coordinates of the point to be calibrated in the geospatial coordinate system; Based on the corresponding point of the reference point and the displacement ratio of the reference point relative to the benchmark point in the geospatial coordinate system, as well as the coordinates of the point to be calibrated in the geospatial coordinate system, the coordinates of the point to be calibrated in the geospatial coordinate system in the dwg data are scaled and calibrated to complete the conversion.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Method and device for displaying CAD(computer-aided design) pipeline drawings in Baidu map

    CN108009301A

  • Translation correction processing method and device for CAD data in geographic coordinate system

    CN111309841A

  • Coordinate conversion method and system

    CN112269197A