Coordinate system conversion method based on digital twinning

Through modular design and nonlinear offset algorithm, the path defects and redundant calculation problems of multi-source coordinate system transformation in digital twin technology are solved, realizing high-precision and safe coordinate transformation, adapting to different UE engine versions, and meeting the diverse needs of digital twin scenarios.

CN121542365APending Publication Date: 2026-02-17THREE-BODY SMART NETWORK TECH (SUZHOU) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202610059411.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-16
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing technologies in digital twin technology suffer from path defects in multi-source coordinate system transformation, efficiency bottlenecks caused by redundant calculations, and an imbalance between security and accuracy. In particular, the BD09 coordinate system cannot be directly converted to the WGS84 coordinate system, and the UE engine has weak compatibility and security encryption design.

Method used

A modular coordinate system transformation method is adopted, which realizes flexible transformation between WGS84, GCJ02, BD09 and UE engine coordinate systems through input adaptation module, transformation scheduling module, transformation algorithm module and output adaptation module. Combined with nonlinear offset algorithm, polar coordinate transformation and approximate inverse calculation, it meets the requirements of high precision and security.

Benefits of technology

It achieves direct conversion from the BD09 coordinate system to the WGS84 coordinate system, reduces the conversion path, improves conversion efficiency, ensures accuracy within 2 meters, reduces secondary development costs, enhances security, adapts to different UE engine versions, and meets diverse digital twin scenario needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121542365A_ABST
    Figure CN121542365A_ABST
Patent Text Reader

Abstract

The invention relates to a coordinate system conversion method based on digital twinning, and the method comprises the steps: planning a coordinate conversion path through a conversion scheduling module according to the combination of a source coordinate system type and a target coordinate system type; a corresponding conversion unit is called through a conversion algorithm module to execute conversion, and the conversion unit comprises a WGS84 coordinate system and GCJ02 coordinate system conversion unit, a GCJ02 coordinate system and BD09 coordinate system conversion unit and an approximate reverse calculation unit. And if the target is the UE engine coordinate system, a result is output through the output adaptation module, if the target is the UE engine coordinate system, the WGS84 coordinate system coordinates are transmitted to the Cesium docking module, and conversion with the UE engine coordinate system coordinates is completed through a CesimGeoreence assembly. Flexible conversion among a WGS84 coordinate system, a GCJ02 coordinate system, a BD09 coordinate system and a UE engine coordinate system is supported, and the industrial defect that the BD09 coordinate system cannot be directly converted into the WGS84 coordinate system is particularly overcome. And meanwhile, the method adapts to UE4 and UE5 series engines, and can meet diversified requirements of POI point position marking, track route planning and the like in a digital twin scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a coordinate system transformation method, and more particularly to a coordinate system transformation method based on digital twins. Background Technology

[0002] With the widespread application of digital twin technology in fields such as urban planning and industrial inspection, accurate conversion between different coordinate systems has become a key technological support for bridging the gap between real geographical environments and virtual twin scenarios. Currently, the commonly used coordinate systems are mainly based on BD09, GCJ02, and WGS84.

[0003] Meanwhile, while digital twin technology is widely used in urban planning and industrial inspection, significant shortcomings remain in multi-source coordinate system transformation. Existing technologies, such as the image coordinate transformation method, system, medium, and electronic device for digital twins disclosed in Chinese patent CN117830390A, propose a visual calibration method based on homography matrices to improve transformation accuracy. However, this method relies on physical calibration objects and cannot adapt to the encrypted conversion requirements of geographic coordinate systems such as WGS84, GCJ02, and BD09, especially lacking support for nonlinear encryption algorithms. Furthermore, most solutions fail to address the industry challenge of directly converting the BD09 coordinate system to the WGS84 coordinate system, resulting in redundant transformation paths and accumulated errors exceeding the 2-meter threshold for POI point marking scenarios, making it difficult to meet the requirements of high-precision twin scenarios.

[0004] Meanwhile, regarding Unreal Engine (UE) compatibility, existing technologies are generally limited to a single version interface. For example, most publicly available solutions are developed for specific versions of UE4 or UE5, and cannot dynamically adapt to API iterations from UE4.26 to UE5.3, increasing the cost of secondary development. Furthermore, security encryption design is weak: some conversion algorithms do not integrate standard non-linear offsets (such as the GCJ02 encryption specification), posing a risk of reverse leakage of geographical information. Although Chinese patent CN117830390A attempts to optimize coordinate filtering efficiency, it does not address the combined design of coordinate system encryption perturbation terms and fixed offsets, making the conversion results vulnerable to cracking.

[0005] In summary, the existing technology has the following systemic defects: 1. Path defect: There is a lack of a compliant path for indirect conversion from BD09 to WGS84, which requires GCJ02 as an intermediary, resulting in conversion logic errors or loss of accuracy; 2. Efficiency bottleneck: Algorithm redundancy causes processing time for a single set of coordinates to exceed 10 milliseconds, and the plugin size is huge (usually >100MB), affecting real-time performance; 3. Imbalance between security and accuracy: It fails to simultaneously meet the requirements of encryption irreversibility and error control of ≤2 meters.

[0006] In view of the above-mentioned shortcomings, the designer has actively researched and innovated in order to create a coordinate system transformation method based on digital twins, making it more valuable for industrial applications. Summary of the Invention

[0007] To address the aforementioned technical problems, the purpose of this invention is to provide a coordinate system transformation method based on digital twins.

[0008] The coordinate system transformation method based on digital twins of the present invention includes the following steps: Step 1: Receive user input information through the input adaptation module. The input information includes source coordinate system type, target coordinate system type, and original coordinate data. The source coordinate system type and target coordinate system type are selected from any one of the WGS84 coordinate system, GCJ02 coordinate system, BD09 coordinate system, and UE engine coordinate system. Step 2: The conversion scheduling module plans the coordinate conversion path according to the combination of the source coordinate system type and the target coordinate system type. If the target is the UE engine coordinate system, it is first converted to the WGS84 coordinate system. When converting the BD09 coordinate system to the WGS84 coordinate system, it is transferred through the GCJ02 coordinate system. Step 3: The conversion algorithm module calls the corresponding conversion unit to perform the conversion. The conversion unit includes a WGS84 coordinate system to GCJ02 coordinate system conversion unit, a GCJ02 coordinate system to BD09 coordinate system conversion unit, and an approximate inverse calculation unit. Step 4: Output the results through the output adaptation module. If the target is the UE engine coordinate system, transfer the WGS84 coordinate system coordinates to the Cesium docking module and complete the conversion between the CesiumGeoreference and the UE engine coordinate system coordinates through the CesiumGeoreference component. The input adaptation module, conversion scheduling module, conversion algorithm module, and output adaptation module are connected via a data stream.

[0009] The input adaptation module, conversion scheduling module, conversion algorithm module, and output adaptation module are all connected to the version adaptation module, which adapts to different UE engine versions.

[0010] Specifically, the CesiumGeoreference component is an optimization of the traditional Cesium for Unreal plugin, and using this CesiumGeoreference component provides the following functionality: 1. Modular Design: The transformation algorithms between different coordinate systems are encapsulated into independent units, including: WGS84 and GCJ02 transformation units, GCJ02 and BD09 transformation units, and approximate inverse calculation units. Each unit has a single and independent function.

[0011] 2. Dynamic calling mechanism: The conversion algorithm module calls the required conversion units in sequence according to the path planned by the conversion scheduling module, avoiding the execution of irrelevant conversion steps and eliminating redundant calculations.

[0012] 3. Data flow standardization: Coordinate data is transmitted between modules and transformation units in JSON format. The data fields include source longitude value, source latitude value, source coordinate system identifier, target coordinate system identifier and data transmission timestamp, eliminating the need for repeated parsing or formatting.

[0013] 4. Dedicated Interoperability Logic: When the target is the UE engine coordinate system, the output adaptation module encapsulates the WGS84 coordinates into a standardized structure containing latitude, longitude, and altitude. The Cesium interoperability module reads the OriginLatitude and OriginLongitude parameters of the CesiumGeoreference component, writes the standardized WGS84 coordinates into the corresponding parameter fields, and triggers the component's built-in coordinate mapping algorithm to complete the final transformation. It is only responsible for the transformation to WGS84 coordinates. Subsequent mapping is performed by mature components, balancing accuracy and efficiency.

[0014] 5. Lightweight Adaptation: Through the Visual Studio compilation interface and Rider compilation interface of the version adaptation module, configure and generate plugin installation packages adapted to UE4.26~4.27 and UE5.0~5.3 series engines. The plugin size after ZIP compression is no more than 50MB, the single coordinate transformation time is ≤10 milliseconds, the impact on the performance of digital twin scenarios is ≤0.1%, and it can be integrated without secondary development.

[0015] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the input adaptation module includes a longitude verification unit, a latitude verification unit, and a data encapsulation unit. The longitude verification unit and the latitude verification unit interact in parallel with the user-inputted raw coordinate data, and respectively perform range verification on the longitude and latitude in the coordinates. The longitude verification unit limits the longitude range to -180°~180°, and the latitude verification unit limits the latitude range to -90°~90°. The coordinate data that passes the verification is transmitted to the data encapsulation unit. The data encapsulation unit converts it into a standardized data format that can be recognized by the algorithm execution unit, and then transmits it to the transformation scheduling module.

[0016] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the version adaptation module includes a Visual Studio compilation interface and a Rider compilation interface, which are configured to generate plugin installation packages adapted to the UE4 and UE5 engines.

[0017] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the output adaptation module includes a geographic coordinate output interface and a UE coordinate output interface, wherein the UE coordinate output interface is used to output X / Y / Z coordinates and Cesium component configuration parameters.

[0018] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the transformation scheduling module is equipped with a non-volatile memory for a transformation rule base. The rule base stores constraint rules for the BD09 coordinate system that cannot be directly converted to the WGS84 coordinate system and can only be interfaced with the Cesium component in the WGS84 coordinate system.

[0019] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the WGS84 coordinate system is converted to the GCJ02 coordinate system using a nonlinear offset algorithm. The Krasovsky ellipsoid parameters are referenced, with its semi-major axis A = 6378245.0 meters pre-set, and this method is only applicable to geographic coordinates within a preset region. This preset region can be further defined to restrict the area of ​​the map coordinates as needed.

[0020] Furthermore, in the above-mentioned coordinate system transformation method based on digital twins, the transformation process of converting the GCJ02 coordinate system to the BD09 coordinate system unit is as follows: converting the rectangular coordinates of the GCJ02 coordinate system to polar coordinates, adding radius and angle perturbations, superimposing a fixed offset, and then converting to rectangular coordinates to obtain the coordinates of the BD09 coordinate system. The fixed offset is longitude +0.0065 degrees and latitude +0.006 degrees.

[0021] Furthermore, in the aforementioned coordinate system transformation method based on digital twins, the approximate reverse calculation unit inverts the offset using a forward algorithm, thereby converting the GCJ02 coordinate system to the WGS84 coordinate system and the BD09 coordinate system to the GCJ02 coordinate system.

[0022] By means of the above-described solution, the present invention has at least the following advantages: 1. This invention supports flexible conversion between WGS84, GCJ02, BD09, and UE engine coordinate systems, especially addressing the industry-wide limitation that the BD09 coordinate system cannot be directly converted to the WGS84 coordinate system. It is also compatible with UE4 and UE5 series engines, meeting diverse needs in digital twin scenarios such as POI point marking and trajectory route planning, covering coordinate system data usage scenarios for different customer groups.

[0023] 2. By using nonlinear offset algorithms, polar coordinate transformation and fixed offset combination algorithms, and approximate inverse calculation logic, combined with Krasovsky ellipsoid parameter correction and regional deviation adaptation, the coordinate transformation error can be strictly controlled within 2 meters. Moreover, the transformation process is continuous and differentiable, avoiding problems such as map display jumps and discontinuities in digital twin scenarios, and ensuring the accuracy and smoothness of geographic information presentation.

[0024] 3. The plugin can adopt a nested transformation architecture, with no redundant calculations and a negligible impact on the performance of digital twin scenarios. It can be adapted to different UX engine versions through standardized compilation interfaces, reducing the workload of secondary development.

[0025] 4. When converting from the WGS84 coordinate system to the GCJ02 coordinate system, an encrypted offset algorithm conforming to conventional surveying standards is adopted to meet the requirements of map coordinate encryption. Through complex nonlinear formulas and the design of small perturbation terms, the coordinate transformation is made irreversible, effectively preventing the leakage of geographic information through reverse derivation. At the same time, it adapts to the regional needs of coordinate transformation and improves the security of data use.

[0026] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, the preferred embodiments of the present invention are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0027] Figure 1 This is a schematic diagram of coordinate system transformation based on digital twins. Detailed Implementation

[0028] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0029] like Figure 1 The coordinate system transformation method based on digital twins is unique in that it includes the following steps: Step 1: Input Information Reception and Preprocessing. The input adaptation module receives user input information, including the source coordinate system type, target coordinate system type, and raw coordinate data. Both the source and target coordinate system types can be selected from any one of the following: WGS84, GCJ02, BD09, and the UE engine coordinate system. The input adaptation module consists of a longitude verification unit, a latitude verification unit, and a data encapsulation unit. These three units work together in a logical sequence of "verification, encapsulation, and transmission." The longitude and latitude verification units work in parallel with the user-inputted raw coordinate data, performing range verification on the longitude and latitude. The longitude verification unit limits the longitude range to -180° to 180°, and the latitude verification unit limits the latitude range to -90° to 90°. Coordinate data outside these ranges is considered invalid and will not proceed to the subsequent conversion process. Valid coordinate data that passes verification is automatically transmitted to the data encapsulation unit. The core function of the data encapsulation unit is format standardization, converting raw coordinate data into a standardized data format recognizable by the algorithm execution unit. During implementation, the standardized data format adopts JSON, whose fields include source longitude value, source latitude value, source coordinate system identifier, target coordinate system identifier, and data transmission timestamp. The coordinate system identifier uses a three-character encoding: "WGS" for WGS84 coordinate system, "GCJ" for GCJ02 coordinate system, "BD0" for BD09 coordinate system, and "UE0" for UE engine coordinate system. After the format conversion is complete, the data encapsulation unit transmits the standardized data to the conversion scheduling module, fully realizing the entire process of input data verification, encapsulation, and transmission.

[0030] Step 2: Conversion Path Planning. The conversion scheduling module intelligently plans the optimal coordinate conversion path based on the combination of the source and target coordinate system types. This module has a built-in non-volatile memory for storing the conversion rule base, using a Flash memory chip to ensure data integrity even in the event of power failure. The conversion rule base pre-stores three sets of core constraint rules: BD09 coordinate system cannot be directly converted to WGS84 coordinate system; only WGS84 coordinate system can interface with Cesium components; and the UE engine coordinate system only accepts WGS84 coordinate system as the conversion input source. Specifically, the path planning logic is as follows: If the target coordinate system is the UE engine coordinate system, regardless of the source coordinate system type, the source coordinates must first be converted to WGS84 coordinate system before subsequent UE engine coordinate system adaptation. If the source coordinate system is BD09 and the target coordinate system is WGS84, a two-step conversion from BD09 to GCJ02 and then to WGS84 coordinate system is required, involving an intermediate step. If the source coordinate system is WGS84 and the target coordinate system is BD09, a two-step transformation is performed: from WGS84 to GCJ02 and then back to BD09. If the source and target coordinate systems require a direct transformation between WGS84 and GCJ02, or between GCJ02 and BD09, a single transformation path is planned. After completing the path planning, the transformation scheduling module will generate the path instructions and standardized coordinate data, and then transmit them to the transformation algorithm module.

[0031] Step 3: Coordinate Transformation Execution. The transformation algorithm module calls the corresponding transformation unit to perform the coordinate transformation operation. During implementation, the transformation unit includes the WGS84 coordinate system to GCJ02 coordinate system transformation unit, the GCJ02 coordinate system to BD09 coordinate system transformation unit, and an approximate reverse calculation unit. The transformation algorithm module adopts a nested transformation architecture, with each transformation unit called sequentially according to the path instructions to avoid redundant calculations and ensure transformation efficiency.

[0032] According to a preferred embodiment of the present invention, the conversion from the WGS84 coordinate system to the GCJ02 coordinate system is performed using an encrypted offset algorithm (non-linear offset algorithm), and is only applicable to the geographic coordinates of a preset area. Furthermore, the Krasovsky ellipsoid parameters are invoked during the conversion process. The preset parameters include the semi-major axis A = 6378245.0 meters and the square of the first eccentricity EE = 0.00669342162296594323, conforming to the general specifications for geographic coordinate conversion. The specific conversion steps are as follows: 1. Regional Applicability Judgment: The coordinate range comparison algorithm is used to determine whether the original WGS84 coordinates are within the above coordinate range. Only coordinates within the range are processed for subsequent transformation steps. For coordinates outside the range, the original data is output directly without offset processing.

[0033] 2. Calculate the basic offset: Two sets of independent empirical formulas are used to calculate the initial offsets of latitude and longitude respectively. The basic offset calculation formula includes polynomial terms, trigonometric function terms, and square root terms. These components work together to simulate the nonlinear deviation of geospatial data. The specific formulas are as follows: Initial latitude offset Δlat = 2.0 x+3.0 y+0.2 y y+0.1 x y+sin(6.0 x PI) + sin(2.0 x PI) + sqrt(abs(x)). Initial longitude offset Δlon = 2.0 y+3.0 x+0.2 x x + 0.1 x y +sin(6.0 y PI)+sin(2.0 y The transformation is calculated as PI + sqrt(abs(y)). Here, x is the deviation of the original WGS84 coordinate system longitude from 105°, in degrees, calculated as x = original longitude - 105.0. y is the deviation of the original WGS84 coordinate system latitude from 35°, in degrees, calculated as y = original latitude - 35.0. PI is pi, with a value of 3.141592653589793. sqrt(abs(x)) and sqrt(abs(y)) are square root terms used to provide non-linear growth characteristics, ensuring a smooth transition at coordinate boundaries.

[0034] 3. Ellipsoid Projection Correction: Since the initial offset is calculated in meters, it needs to be converted to degrees before being superimposed on the original coordinates. The correction process must consider the shape of the Earth's ellipsoid to avoid errors caused by spherical projection. The correction formula is as follows: meters per degree in the latitudinal direction = (A (1-EE)) / (magic sqrtMagic) PI / 180.0.

[0035] meters per degree in longitude = (A / sqrtMagic) cos(radLat)) PI / 180.0.

[0036] Where magic is an intermediate calculation parameter, the calculation formula is as follows. magic = sqrt(A (1-EE) / (1-EE sin(radLat) sin(radLat)). sqrtMagic is an intermediate calculation parameter, and the calculation formula is sqrtMagic = sqrt(1-EE). sin(radLat) sin(radLat)). radLat is the radian value after latitude transformation in the original WGS84 coordinate system. The transformation formula is radLat = original latitude value. PI / 180.0. cos(radLat) is the cosine of the latitude radian value, used to correct for projection deviation in the longitude direction.

[0037] 4. Coordinate Overlay: The offsets corrected by ellipsoidal projection (Δlat correction, Δlon correction) are added to the latitude and longitude of the original WGS84 coordinates respectively to obtain the GCJ02 coordinates. The calculation method is: GCJ02 latitude = original WGS84 latitude + Δlat correction. GCJ02 longitude = original WGS84 longitude + Δlon correction.

[0038] The reason this invention employs this nonlinear offset algorithm is that it can perform necessary encryption processing on specially defined map coordinates, complying with relevant surveying and mapping security standards. Simultaneously, for security reasons, the polynomial terms, trigonometric function terms, and square root terms included in the algorithm form a complex nonlinear relationship, preventing the coordinates from being directly derived in reverse and avoiding the leakage of geographic information. Furthermore, it can adapt to regional differences; the x and y deviation values ​​differ in different regions, and the offset calculated by the formula has regional characteristics, accurately correcting systematic deviations in different geographical areas and preventing simple rule-based cracking.

[0039] Furthermore, when converting from the GCJ02 coordinate system to the BD09 coordinate system, a combination algorithm of polar coordinate transformation and fixed offset is used. The conversion process is as follows: 1. Rectangular to Polar Coordinate Conversion: Convert the rectangular coordinates (x_gcj, y_gcj) in the GCJ02 coordinate system to polar coordinates (r, θ), where x_gcj is the longitude value in the GCJ02 coordinate system (in degrees), and y_gcj is the latitude value in the GCJ02 coordinate system (in degrees). The conversion formula is r = sqrt(x_gcj) / θ. x_gcj + y_gcj r is the radius in polar coordinates, and θ is the angle in polar coordinates (in radians). The atan2 function can handle coordinate transformations in all quadrants, avoiding sign errors.

[0040] 2. Add small perturbations: Add sine / cosine perturbations to the radius and angle in the polar coordinates, respectively. The perturbation terms are designed to enhance the irreversibility of the transformation. The specific formulas are as follows: r_disturb=r+0.00002 sin(y_gcj X_PI); θ_disturb=θ+ 0.000003 cos(x_gcj X_PI). Where X_PI is a special calculation parameter with a value of 3.14159265358979324. 3000.0 / 180.0 ≈ 52.3598775598. This special value makes the sine wave period approximately 0.0686 degrees, resulting in high-frequency oscillations and making the transformation more complex. 0.00002 sin(y_gcj X_PI) is the radius perturbation term, which is related to the latitude of the GCJ02 coordinate system. 0.000003 cos(x_gcj X_PI) is an angle perturbation term, which is related to the longitude of the GCJ02 coordinate system. Both perturbations are small quantities, which do not affect the continuity of the coordinates but can significantly increase the difficulty of reverse engineering.

[0041] 3. Add a fixed offset: Add a fixed offset to the perturbed polar coordinates. The offset radius r_offset = r_disturb, and the offset angle θ_offset = θ_disturb. The fixed offset is longitude +0.0065 degrees and latitude +0.006 degrees. A longitude offset of 0.0065 degrees is approximately 723 meters, and a latitude offset of 0.006 degrees is approximately 667 meters. This offset is the reference offset of the BD09 coordinate system relative to the GCJ02 coordinate system and is a core feature of the Baidu coordinate system.

[0042] 4. Polar to Cartesian Coordinates: Convert the offset polar coordinates (r_offset, θ_offset) back to Cartesian coordinates to obtain BD09 coordinates (x_bd, y_bd). The conversion formula is x_bd = r_offset cos(θ_offset) + 0.0065, y_bd = r_offset sin(θ_offset) + 0.006.

[0043] The above processing steps meet the requirements for secondary encryption. The BD09 coordinate system is a secondary encryption based on the GCJ02 coordinate system, requiring an additional protection layer on top of the original encryption. Irreversible design is possible; the combination of polar coordinate transformation and minute perturbation terms makes mathematical reverse derivation extremely difficult, making it impossible to restore the original coordinates using simple formulas. Furthermore, continuity is guaranteed; the entire transformation process is continuously differentiable, avoiding issues such as jumps and discontinuities in map display in digital twin scenarios, ensuring smooth display of POI locations and trajectory routes.

[0044] In practical implementation, an approximate inverse calculation unit is specifically used to perform the reverse transformation from the GCJ02 coordinate system to the WGS84 coordinate system and from the BD09 coordinate system to the GCJ02 coordinate system. Since the forward transformation algorithm contains complex nonlinear and trigonometric function terms and lacks an analytical inverse function, the inverse transformation employs an approximate calculation method. The core logic is achieved by inverting the offset of the forward algorithm, as detailed below: First, when converting the GCJ02 coordinate system to the WGS84 coordinate system, the nonlinear offset algorithm formula for converting from the WGS84 coordinate system to the GCJ02 coordinate system is completely reused, except that the calculated basic offset (Δlat, Δlon) and the offset after projection correction are both negative. Then, these are superimposed with the original coordinates in the GCJ02 coordinate system to obtain approximate coordinates in the WGS84 coordinate system. The calculation method is: WGS84 latitude = GCJ02 latitude - Δlat correction, WGS84 longitude = GCJ02 longitude - Δlon correction. The error of this approximate conversion is ≤2 meters, which fully meets the accuracy requirements of digital twin scenarios.

[0045] Subsequently, when converting from the BD09 coordinate system to the GCJ02 coordinate system, the combined algorithm formula for converting from the GCJ02 coordinate system to the BD09 coordinate system was reused, only the fixed offsets were negative (longitude offset -0.0065 degrees, latitude offset -0.006 degrees). Simultaneously, the perturbation term was inverted, and the radius perturbation term was changed to -0.00002. sin(y_bd X_PI), the angle perturbation term is changed to -0.000003. cos(x_bd Then, perform the transformation in reverse order: convert from rectangular coordinates to polar coordinates, invert the offset, and convert from polar coordinates to rectangular coordinates. This will yield approximate coordinates in the GCJ02 coordinate system, with a transformation error of ≤2 meters.

[0046] The mathematical basis for the inverse transformation is the assumption of function linearization. Near a point G in the GCJ02 coordinate system, the forward transformation function F is assumed to be locally approximately linear, with its linearized expression being F(W)≈F(G)+J(G)·(WG), where J(G) is the Jacobian matrix of F at point G. Since the forward transformation is locally approximated as an identity mapping plus an offset, we can assume J(G)≈J(W)≈I (the identity matrix), thus deriving Δ=F(G)-G (Δ being the offset). The inverse approximation transformation formula is W≈G-Δ. Although this assumption is approximate, it meets the accuracy requirements with a single iteration and has extremely high computational efficiency, avoiding complex iterative methods or numerical solutions, thus meeting the lightweight design requirements of the plug-in. In the above description, W stands for WGS84, G for GCJ-02, and F for the transformation function.

[0047] Step 4: Output the conversion result and adapt it to the UE engine. During this process, the conversion result is output through the output adaptation module, which includes a geographic coordinate output interface and a UE coordinate output interface. These two interfaces can be switched and called as needed. Specifically: if the target coordinate system is WGS84, GCJ02, or BD09, the corresponding latitude and longitude coordinate values ​​are output through the geographic coordinate output interface in the format of "longitude value (degrees), latitude value (degrees)," retaining 6 decimal places to ensure coordinate accuracy. If the target coordinate system is the UE engine coordinate system, the X / Y / Z three-dimensional coordinate values ​​(in meters) and Cesium component configuration parameters are output through the UE coordinate output interface. The Cesium component configuration parameters include Origin Latitude, Origin Longitude, and Origin Height. Simultaneously, the output adaptation module transmits the converted WGS84 coordinates to the Cesium interface module through a preset data channel.

[0048] Furthermore, the Cesium interface module and the Cesium for Unreal plugin's CesiumGeoreference component are mutually compatible. After receiving coordinates from the WGS84 coordinate system, the Cesium interface module automatically reads the Origin Latitude and Origin Longitude parameters from the Cesium Georeference component, writing the latitude, longitude, and altitude data from the WGS84 coordinate system into the corresponding parameter fields. Simultaneously, the component's built-in coordinate mapping algorithm completes the final conversion from the WGS84 coordinate system to the UE engine's coordinate system. After the conversion, the UE engine can directly use this coordinate data to build digital twin scenes, achieving precise matching between the scene model and the real-world location. For example, in an inspection route planning scenario, the converted UE coordinates can be directly used to generate a virtual inspection path that perfectly corresponds to the real geographical environment.

[0049] The version adaptation module used in this invention includes a Visual Studio compilation interface and a Rider compilation interface. It is configured to generate plugin installation packages adapted to the UE4 and UE5 engines. The specific adaptation process is as follows: Using Visual Studio 2019 or later, or Rider 2021 or later, open the plugin core code project file. In the project properties, select the target UE engine version (UE4.26~UE4.27, UE5.0~UE5.3), set the target compilation platform to Windows 64-bit, and import the corresponding UE engine's SDK development package. Then, execute the compilation command to generate a plugin installation package with the .uplugin extension. During the compilation process, the API interfaces and dependency libraries of the target engine are automatically adapted. The compiled plugin is compressed using a ZIP compression algorithm, resulting in a compressed size of no more than 50MB, far smaller than the typical GB-level size of digital twin projects, facilitating project integration and deployment. Meanwhile, the plugin adopts a nested transformation method, with each transformation unit called sequentially and without redundant calculations. The calculation time for a single set of coordinate transformations is ≤10 milliseconds, and its performance impact on the digital twin scene is ≤0.1%, which is negligible and will not affect the running efficiency of core functions such as scene rendering and model loading.

[0050] The working principle of this invention is as follows: In the POI (Point of Interest) labeling scenario of a digital twin city, the source coordinates input by the user are in the BD09 coordinate system, including longitude 116.403874 degrees and latitude 39.914885 degrees. The target coordinate system is the UE engine coordinate system. After receiving this information, the input adaptation module performs verification by the longitude and latitude verification units respectively, determining that longitude 116.403874 degrees is within the range of -180° to 180°, and latitude 39.914885 degrees is within the range of -90° to 90°. The data that passes the verification is converted into standardized JSON format by the encapsulation unit and transmitted to the conversion scheduling module. Subsequently, the conversion scheduling module plans the path as "BD09 coordinate system to GCJ02 coordinate system, then to WGS84 coordinate system, and finally to UE engine coordinate system". The conversion algorithm module calls the corresponding conversion units to perform the conversion sequentially according to the path. Finally, the X / Y / Z coordinates of the UE engine coordinate system and the Cesium component configuration parameters are obtained. The output adaptation module outputs the result through the UE coordinate output interface. The Cesium docking module completes the docking with the CesiumGeoreference component. The UE engine completes the POI point marking based on the coordinates to achieve accurate correspondence with the real city location.

[0051] Furthermore, the orientations or positional relationships described in this invention are based on the orientations or positional relationships shown in the accompanying drawings. They are only for the purpose of facilitating the description of this invention and simplifying the description, and are not intended to indicate or imply that the device or structure referred to must have a specific orientation, or to operate in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0052] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A coordinate system conversion method based on digital twinning, characterized in that The method comprises the following steps: Step one, receiving user input information through the input adaptation module, the input information including source coordinate system type, target coordinate system type and original coordinate data, the source coordinate system type and the target coordinate system type being selected from any one of WGS84 coordinate system, GCJ02 coordinate system, BD09 coordinate system and UE engine coordinate system; Step two, planning a coordinate conversion path according to the combination of the source coordinate system type and the target coordinate system type through the conversion scheduling module, if the target is the UE engine coordinate system, first convert to the WGS84 coordinate system, and when converting the BD09 coordinate system to the WGS84 coordinate system, pass through the GCJ02 coordinate system; Step three, calling the corresponding conversion unit to perform conversion through the conversion algorithm module, the conversion unit including a WGS84 coordinate system and GCJ02 coordinate system conversion unit, a GCJ02 coordinate system and BD09 coordinate system conversion unit, and an approximate inverse calculation unit; The WGS84 coordinate system is converted to the GCJ02 coordinate system by executing an encryption offset algorithm, calling the parameters of the Krassovsky ellipsoid, setting the major semi-axis A = 6378245.0 meters, the first eccentricity square EE = 0.00669342162296594323, automatically identifying whether it is a geographical coordinate in a preset area through a preset area judgment logic, and only performing conversion on the coordinates in the area, the area judgment logic being realized through a coordinate range comparison algorithm; when converting, first calculate the basic offset, then superimpose the original coordinates after the ellipsoid projection correction to obtain the GCJ02 coordinate system coordinates; The GCJ02 coordinate system is converted into the BD09 coordinate system by using a combination algorithm of polar coordinate conversion and fixed offset. First, the rectangular coordinates of the GCJ02 coordinate system are converted into polar coordinates, r = sqrt(x_gcj x_gcj+y_gcj y_gcj), θ = atan2(y_gcj, x_gcj), a radius disturbance is added, r_disturb = r + 0.00002 sin(y_gcj X_PI) and an angle disturbance is added, θ_disturb = θ + 0.000003 cos(x_gcj X_PI), wherein X_PI = 3.14159265358979324 3000.0 / 180.0; then, after superimposing a fixed offset of 0.0065 degrees in longitude and 0.006 degrees in latitude, the polar coordinates are converted into rectangular coordinates to obtain the BD09 coordinate system coordinates. The approximate inverse calculation unit takes the opposite of the calculated offset by reusing the formula of the corresponding forward conversion algorithm, wherein when the GCJ02 coordinate system is converted to the WGS84 coordinate system, the algorithm formula of WGS84 to GCJ02 is reused, the basic offset and the offset after the projection correction are taken negatively and superimposed with the GCJ02 coordinates; when the BD09 coordinate system is converted to the GCJ02 coordinate system, the algorithm formula of GCJ02 to BD09 is reused, the fixed offset and the perturbation term are taken inversely and the conversion is performed in the reverse steps; Step four, outputting the result through the output adaptation module, if the target is the UE engine coordinate system, passing the WGS84 coordinate system coordinates to the Cesium docking module to complete the conversion with the UE engine coordinate system coordinates through the CesiumGeoreference component; The input adaptation module, the conversion scheduling module, the conversion algorithm module and the output adaptation module are connected through data flow; The input adaptation module, the conversion scheduling module, the conversion algorithm module and the output adaptation module are connected with the version adaptation module, and different versions of the UE engine are adapted through the version adaptation module.

2. The coordinate system conversion method based on digital twinning according to claim 1, characterized in that: The input adaptation module includes a longitude verification unit, a latitude verification unit and a data packaging unit, the longitude verification unit and the latitude verification unit are connected in parallel to the original coordinate data input by the user, and the longitude and latitude in the coordinate are respectively verified in range, the longitude verification unit limits the longitude range to -180°~180°, and the latitude verification unit limits the latitude range to -90°~90°; The coordinate data after the check passes is transmitted to a data packaging unit; the data packaging unit converts it into a standardized data format recognizable by an algorithm execution unit, and then transmits it to a conversion scheduling module.

3. The coordinate system conversion method based on digital twinning according to claim 1, characterized in that: The version adaptation module includes a Visual Studio compilation interface and a Rider compilation interface, and is configured to generate a plug-in installation package for adapting UE4 and UE5 engines.

4. The coordinate system conversion method based on digital twinning of claim 1, wherein: The output adaptation module includes a geographic coordinate output interface and a UE coordinate output interface, and the UE coordinate output interface is used to output X / Y / Z coordinates and Cesium component configuration parameters.

5. The digital-twin-based coordinate system conversion method of claim 1, wherein: The conversion scheduling module is provided with a non-volatile memory of conversion rules, the rule library stores a constraint rule that a BD09 coordinate system cannot be directly converted into a WGS84 coordinate system and only a WGS84 coordinate system can be connected to a Cesium component.

6. The digital-twin-based coordinate system conversion method of claim 1, wherein: The WGS84 coordinate system is converted into a GCJ02 coordinate system through an encryption offset algorithm, and parameters of a Krassovsky ellipsoid are called, a long semi-axis A=6378245.0 meters is preset, and the geographic coordinates are only suitable for a preset region.

7. The digital-twin-based coordinate system conversion method of claim 1, wherein: The conversion process of the GCJ02 coordinate system into the BD09 coordinate system unit is to convert the GCJ02 coordinate system rectangular coordinates into polar coordinates, add a radius and an angle disturbance, superimpose a fixed offset, and then convert the rectangular coordinates into the BD09 coordinate system coordinates, and the fixed offset is longitude +0.0065 degrees and latitude +0.006 degrees.

8. The digital-twin-based coordinate system conversion method of claim 1, wherein: The approximate reverse calculation unit converts the GCJ02 coordinate system into the WGS84 coordinate system and the BD09 coordinate system into the GCJ02 coordinate system by negating the forward algorithm offset.

Citation Information

Patent Citations

  • Image coordinate conversion method and system for digital twinning, medium and electronic equipment

    CN117830390A

  • Point position marking and coordinate conversion method and device and electronic equipment

    CN116681763A

  • Geographic information system for digital twin city platform

    CN116842122A

  • Construction method and device of digital twin platform base

    CN118941726A