Digital elevation model sampling method based on virtual earth platform

By introducing a constant velocity model second-order Kalman filter and a snake traversal strategy into the virtual globe platform, and adaptively adjusting the camera height, the instability and low efficiency of batch terrain elevation acquisition in the virtual globe environment are solved, and efficient and reliable elevation data generation and output are achieved.

CN121962498APending Publication Date: 2026-05-01EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
EAST CHINA NORMAL UNIV
Filing Date
2026-02-10
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In a network-based virtual globe environment, existing technologies struggle to achieve stability and efficiency in batch terrain elevation acquisition when faced with factors such as online terrain data chunk loading, hierarchical detailing, and asynchronous rendering. Furthermore, sampling results are easily affected by viewpoint height, camera pose, and network latency, leading to sampling failures or outliers.

Method used

A constant velocity model second-order Kalman filter technique is used for recursive estimation and prediction. Combined with serpentine traversal and time delay control strategies, the camera height is adaptively adjusted. The first sampling point or the scene with missing prediction value is processed by secondary sampling initialization. This adapts to the uncertainty of online terrain loading and rendering, and ensures the stability and continuity of sampling results.

Benefits of technology

It improves the stability and efficiency of batch sampling, reduces the probability of sampling fluctuations and outliers, enhances the reliability of generated elevation data, and outputs in the standard GeoTIFF format, which is convenient for geographic information system analysis and engineering applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962498A_ABST
    Figure CN121962498A_ABST
Patent Text Reader

Abstract

The invention discloses a digital elevation model sampling method based on a virtual earth platform. The digital elevation model sampling method comprises a sampling point construction and coordinate conversion link a, a virtual earth environment and online terrain loading link b, a second-order Kalman filter establishment link c, a traversal sampling and adaptive height adjustment link d and a result output and rasterized data generation link e. Aiming at the uncertainty of online terrain block loading and asynchronous rendering, recursive estimation and prediction are performed on a terrain height program sequence by utilizing constant speed model second-order Kalman filtering, and the camera height is determined by adopting secondary sampling at a first point or when no prediction value exists; sampling-estimation-parameter adjustment closed-loop feedback is adopted for subsequent sampling points to achieve camera height self-adaptive adjustment, and the stability, continuity and success rate of batch sampling are improved in combination with snakelike traversal and time delay control. A sampling result can be exported after neighborhood smoothing, and a GeoTIFF grid elevation product is generated, so that local terrain analysis and application are facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of surveying and geospatial information technology, and in particular to the virtual earth online terrain elevation adaptive batch sampling technology based on the second-order Kalman filter of the constant velocity model. Specifically, it is a digital elevation model sampling method based on a virtual earth platform. Background Technology

[0002] Currently, web-based virtual earth systems, such as Google Earth, Microsoft Bing Maps 3D, and CesiumJS, are widely used in geoscience research, engineering construction, and emergency response. Virtual earth systems provide a networked 3D visualization environment that integrates imagery, terrain, 3D models, and various thematic information, allowing users to observe, analyze, and measure any local area by changing the viewpoint and perspective during interactive browsing.

[0003] With the development of Earth observation and geographic information acquisition technologies, multi-source, multi-resolution, and multi-temporal geospatial data are continuously accumulating, leading to a growing demand for refined analysis of specific regions. In these applications, terrain elevation, as a fundamental geographic element, often needs to be acquired in batches within a given spatial range using regular grids or sample point sets. This data is then used to generate rasterized elevation products (such as GeoTIFF) or to provide input data for subsequent terrain analysis. To meet these needs, technical personnel typically use the terrain sampling interface provided by online terrain services within a virtual globe environment to acquire terrain elevation point by point from the sample point set.

[0004] However, current online terrain services come from diverse sources, with varying data resolutions and update statuses, resulting in inconsistent service quality across different terrain data sources. Furthermore, online terrain services typically feature tiled loading, Level of Detail (LOD), and asynchronous rendering. The elevation results returned by the terrain sampling interface are easily affected by factors such as viewpoint height, camera pose, screen error thresholds, and network loading latency. This can lead to differences in elevation results for the same location under different sampling conditions, and even sampling failures or outliers. Especially when the first point in a batch sampling or a predicted value is missing, using only a fixed camera height and sampling rhythm often makes it difficult to obtain reliable initial observations before the terrain is fully loaded / rendered and stabilized, thus affecting the continuity and overall efficiency of subsequent sampling. In such cases, sampling results usually require further verification or repeated sampling correction.

[0005] To address the aforementioned issues, a feasible solution involves introducing dynamic modeling and closed-loop control of terrain elevation changes during the sampling process. At the first sampling point, a reliable camera height reference is obtained through secondary sampling initialization. At subsequent sampling points, a constant velocity model with second-order Kalman filtering is used to recursively estimate and predict the observed elevation sequence. The prediction results are then fed back to adaptively adjust the camera height. Simultaneously, a serpentine traversal and time-delay control strategy is combined to adapt to the uncertainties of online terrain chunking and asynchronous rendering, thereby improving the stability, continuity, and overall efficiency of batch sampling. However, a universal method for batch terrain elevation acquisition tasks in a virtual globe environment, adaptable to online terrain loading mechanisms, and capable of adaptive scheduling and parameter control, is still lacking. Therefore, a stable and efficient adaptive sampling method is urgently needed to handle the above situation. Summary of the Invention

[0006] Based on the above background, this invention aims to achieve stable, continuous and efficient batch sampling of terrain elevations for a specified range of sampling points in uncertain environments such as online terrain patch loading, hierarchical detail (LOD) and asynchronous rendering of virtual earth, and to provide reliable basic data and standardized output capabilities for applications such as digital elevation model construction, terrain visualization and terrain analysis.

[0007] The purpose of this invention is to overcome the limitations of existing technologies and propose a digital elevation model sampling method based on a virtual earth platform. This method aims to solve the problems of unstable sampling results, low sampling efficiency, and local sampling failures or outliers when acquiring the terrain elevation of a set of sampling points within a specified range in a network-based virtual earth environment. These problems are caused by factors such as online terrain data block loading, LOD changes, and asynchronous rendering.

[0008] To achieve the above objectives, the present invention adopts the following technical solution:

[0009] A digital elevation model sampling method based on a virtual earth platform includes the following steps:

[0010] S1: Sampling point construction and coordinate transformation, within a given rectangular space, according to the sampling interval. A grid of regular sampling points is generated and a set of sampling points is constructed. The set of sampling points is then subjected to coordinate transformation to meet the positioning and sampling requirements in the virtual earth environment. The rectangular spatial range is specified by the user and can be located in any area defined by latitude and longitude on Earth. The geographical location of the area is not limited.

[0011] S2: Virtual Earth Sampling Environment and Online Terrain Loading. A three-dimensional sampling environment is created in a network-based virtual earth platform, an online terrain data source is loaded, and the set of sampling points is loaded to support subsequent point-by-point sampling.

[0012] S3: Establishment of a second-order Kalman filter for the constant velocity model. Construct a second-order Kalman filter for the constant velocity model and initialize the relevant parameters of the filter to achieve recursive estimation and prediction of terrain elevation sequence.

[0013] S4: Traversal sampling and adaptive height adjustment: The terrain height sampling interface is called point by point in a predetermined traversal order to obtain the observed elevation. And adaptively determine the camera height of the current sampling point based on the predicted elevation status:

[0014] When it is the first sampling point or there is no valid predicted elevation estimate, a secondary sampling initialization method is used to obtain the camera height.

[0015] When a valid predicted elevation estimate exists, use the formula: "Camera Height = Predicted Terrain Elevation". The camera height is calculated using the "offset" value; after moving the camera to the specified camera height and waiting for the online terrain loading and rendering to stabilize, the observed elevation of the sampling point is obtained. ;

[0016] When observing elevation When the value is valid, the observed elevation will be... The second-order Kalman filter is input for recursive updating to obtain the new predicted terrain elevation. And used for camera height calculation at the next sampling point; when the observed elevation When the value is invalid, record the abnormal state and do not update the predicted terrain elevation. ;

[0017] S5: Output of results and generation of rasterized data. Store and export the sampling results and generate rasterized elevation products.

[0018] Furthermore, the coordinate transformation can convert any engineering / projected coordinate system that meets the application requirements into the geographic coordinate system EPSG:4326.

[0019] Furthermore, the secondary sampling initialization includes: obtaining the first terrain sampling value at the sampling point location. Set the camera height to And wait for the online terrain loading and rendering to stabilize before obtaining the second terrain sampling value. Set the camera height The camera height at this sampling point is used; for subsequent sampling points, the formula "camera height = predicted terrain elevation" is applied. The camera height is calculated using the "+ offset value" method.

[0020] Furthermore, the predetermined traversal order is a serpentine traversal order, that is, adjacent columns are sampled in opposite directions.

[0021] Furthermore, the rasterized elevation product is GeoTIFF and is written using the EPSG:3826 coordinate reference system.

[0022] This invention introduces a constant velocity model second-order Kalman filter technique, treating the observation elevation sequence obtained by point-by-point sampling as a dynamic process. It recursively estimates and predicts terrain elevation through a closed-loop feedback mechanism of "sampling-estimation-parameter adjustment," and uses the prediction results in real time to adaptively adjust the sampling camera height. At the same time, it introduces secondary sampling initialization in the first sampling point or in scenarios where the prediction value is missing, and combines serpentine traversal and time delay waiting strategies to adapt to the latency fluctuations of online terrain loading and rendering, thereby improving the success rate and overall efficiency of batch sampling.

[0023] Compared with the prior art, the present invention has the following advantages:

[0024] This invention improves the stability and continuity of batch sampling. By introducing recursive estimation and prediction updates using a second-order Kalman filter with a constant velocity model, and feeding the prediction results back to adaptive camera height adjustment, it significantly reduces sampling fluctuations and outlier probabilities under conditions of online terrain patch loading, LOD changes, and asynchronous rendering.

[0025] This invention improves sampling reliability and overall efficiency in scenarios where the first point and prediction are missing. It obtains a reliable camera height reference through secondary sampling initialization and combines serpentine traversal and latency waiting strategies to reduce sampling failures caused by view jumps and insufficient loading, thereby improving sampling success rate and batch processing efficiency.

[0026] This invention enhances the engineering usability of the output results. The sampling results can be further converted into rasterized elevation products such as standard GeoTIFF, facilitating distribution, integration, and reuse in GIS analysis, engineering applications, and subsequent geoscientific processing workflows. Attached Figure Description

[0027] The present invention will be further described below with reference to the accompanying drawings and specific embodiments. To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, a brief introduction to the drawings used in the specification will be provided below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.

[0028] Figure 1 This is a schematic diagram of the process and each step of the present invention;

[0029] Figure 2 This invention introduces a sub-process for adaptive camera height control with secondary sampling initialization in this embodiment.

[0030] Figure 3 This is a schematic diagram of the "sampling-estimation-parameter adjustment" closed loop of the second-order Kalman filter based on the constant velocity model in an embodiment of the present invention, involving traversal sampling and adaptive height adjustment of the d-stage.

[0031] Figure 4 This is a schematic diagram of the sampling rectangle area and terrain loading effect on the page;

[0032] Figure 5 This is a schematic diagram illustrating the spatial distribution and traversal order of the sampling point set in a virtual Earth environment in an embodiment of the present invention;

[0033] Figure 6 This is a schematic diagram of the GeoTIFF output results displayed in GIS software. Detailed Implementation

[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0035] like Figure 1 As shown, the embodiment of this invention mainly consists of five functional stages: stage a (S1) for constructing sampling points and transforming coordinates; stage b (S2) for virtual earth sampling environment and online terrain loading; stage c (S3) for establishing a second-order Kalman filter for a constant velocity model; stage d (S4) for traversal sampling and adaptive height adjustment; and stage e (S5) for result output and rasterized data generation. Stage a is used to sample points within a given spatial range according to the sampling interval. The process involves generating regular grid sampling points and performing coordinate transformation; step b is used to create a virtual 3D earth scene in the browser and load an online terrain data source; step c is used to construct and initialize a constant velocity model second-order Kalman filter; step d is used to perform specific point-by-point sampling operations and adjust the camera based on filter feedback; and step e is used to perform format conversion and product generation on the sampling results.

[0036] like Figure 2 As shown, Figure 2 This demonstrates the specific execution logic of the "adaptive camera height control" introduced in step d, which involves secondary sampling initialization. For each sampling point... During processing, the first step is to determine whether a valid predicted elevation estimate exists. If the first point or the filter is not initialized, it is determined that there is no valid predicted elevation estimate. If it does not exist, perform secondary sampling initialization to obtain a reliable camera height reference: call the terrain sampling interface at the sampling point location to obtain the first observation value. Set the camera height to After the online terrain loading and rendering stabilizes, the terrain sampling interface will be called again to obtain a second set of observations. And set the camera height to The camera height is used as the current sampling point; if it is determined to exist, then according to the formula "camera height = The current camera height is calculated using the "offset" value. The camera is then moved to this height, and a waiting delay is set to allow the online terrain loading to stabilize. Finally, the Cesium scene terrain sampling interface is called to obtain the observed elevation. .like If the value is valid, it is input into a second-order Kalman filter to complete the recursive update and obtain a new predicted value. For use at the next point; if If the value is invalid, such as a loading failure or a return of NaN, the exception is logged and the predicted value is not updated. This process ensures that the camera height can be dynamically adjusted according to terrain undulations and enhances robustness in initial point initialization and abnormal situations.

[0037] like Figure 3 As shown, Figure 3 This macroscopically demonstrates the closed-loop mechanism of "sampling-estimation-parameter adjustment" in the second-order Kalman filter based on a constant velocity model, involving traversal sampling and adaptive height adjustment of component d. After the system inputs sampling points, the camera presses either "secondary sampling initialization" or "..." "Obtain the current observed elevation after the strategy has completed height setting and the terrain has stabilized." ;when When effective, the new predicted value is obtained by recursively updating through a second-order Kalman filter. This predicted value is directly fed back to calculate the adaptive camera height for the next sampling point; when When the prediction is invalid, the prediction state is not updated and the next point is sampled, thus forming a closed-loop system that is continuously cyclically corrected and more robust to online terrain uncertainties.

[0038] like Figure 4 As shown, the online terrain is loaded and the sampling area is displayed in the getHeight.html page; Figure 5 As shown, the distribution of sampling points and the serpentine traversal path are rendered on the page to visually verify the traversal order; as... Figure 6 As shown, the sampling results can be further converted into CSV and GeoTIFF files, and then displayed in GIS software.

[0039] This invention can be developed and implemented on a microcomputer platform using both Python and JavaScript languages. Python is used for sampling point generation and post-processing, while JavaScript is used for terrain sampling and closed-loop control based on the Cesium virtual globe in the browser. The specific steps are as follows:

[0040] The first step is to generate a set of sampling points and complete the coordinate transformation.

[0041] Within a given rectangular space, input the minimum / maximum X and Y coordinates and the sampling interval. At intervals, regular grid sampling points are generated, and coordinate transformation is performed to meet the positioning requirements of the virtual globe. In this embodiment, pyproj.Transformer is used to transform the engineering / projected coordinate system EPSG:3826 to the geographic coordinate system EPSG:4326, and the sampling point information is organized and stored as a JSON array. The relevant code is as follows:

[0042] def generate_sampling_points(min_x, max_x, min_y, max_y, interval):

[0043] transformer = pyproj.Transformer.from_crs("EPSG:3826", "EPSG:4326", always_xy = True)

[0044] x_coords = np.arange(min_x, max_x + interval, interval, dtype=float)

[0045] y_coords = np.arange(min_y, max_y + interval, interval, dtype=float)

[0046] sampling_points = []

[0047] for x in x_coords:

[0048] for y in y_coords:

[0049] lon, lat = transformer.transform(float(x), float(y))

[0050] sampling_points.append({

[0051] "x": float(x), "y": float(y),

[0052] "longitude": float(lon), "latitude": float(lat)

[0053] })

[0054] return sampling_points

[0055] Among them, sampling interval The corresponding function parameter 'interval' is used to control the grid density of the sampling points and the scale of the output points.

[0056] The second step is to construct the sampling point data and load it as a browser-side variable.

[0057] To facilitate batch sampling on the browser side, the above JSON sampling point data is assigned to the variable name 'data' and saved as a JavaScript file, such as '. / temp / 50m.js', for direct loading and use by subsequent pages. The purpose of this step is to inject the sampling point set into the front-end sampling logic as an array, thereby enabling batch traversal and point-by-point processing.

[0058] The third step is to construct a virtual Earth sampling environment and load online terrain data.

[0059] Create a Cesium Viewer in the browser, load the online terrain data source, and complete scene initialization. You can also draw a rectangular area for the sampling region in the view to visually confirm the sampling area. The relevant code is as follows:

[0060] var viewer = new Cesium.Viewer("cesiumContainer", { / * UI widget configuration * / });

[0061] (async () => {

[0062] const terrainProvider = await Cesium.CesiumTerrainProvider.fromUrl(

[0063] "http: / / YourTerrainService / CesiumWorldBathymetry / v1.0 / " );

[0065] viewer.terrainProvider = terrainProvider;

[0066] })();

[0067] const rectangleEntity = viewer.entities.add({

[0068] rectangle: {

[0069] coordinates: Cesium.Rectangle.fromDegrees(minLng, minLat, maxLng,maxLat),

[0070] material: Cesium.Color.BLUE.withAlpha(0.5),

[0071] outline: true,

[0072] outlineColor: Cesium.Color.YELLOW,

[0073] heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,

[0074] }

[0075] });

[0076] The above steps enable the system to load and render online terrain data, providing an operating environment for subsequent point-by-point terrain elevation sampling.

[0077] The fourth step is to establish a constant velocity model, a second-order Kalman filter, and implement closed-loop adaptive camera altitude control.

[0078] To achieve closed-loop control of "sampling-estimation-parameter adjustment", this embodiment constructs a second-order Kalman filter at the front end, modeling terrain elevation changes as a constant velocity process: the state vector is... ,in For terrain elevation, The elevation change rate is used. During sampling, if the first point or the predicted value is missing, the secondary sampling initialization function is called to determine the camera height of the current point; otherwise, the formula "camera height = The "+ offset" setting specifies the camera height, and a delay is set to wait for the online terrain loading and rendering to stabilize before acquiring the observed elevation. .when When effective, the new predicted elevation is obtained by recursively estimating its input filter. For use at the next sampling point; when Invalid values, such as NaN, are recorded as an anomaly and the predicted value is not updated. The core code is as follows:

[0079] const CAMERA_OFFSET = 50; / / The offset can be changed according to the actual situation.

[0080] let predictedTerrainHeight = null;

[0081] / / Second-order Kalman filter (state vector is) )

[0082] class KalmanFilter2D {

[0083] constructor({ qHeight = 0.01, qVelocity = 0.1, r = 5} = {}) {

[0084] this.x = [[NaN],[0]];

[0085] this.P = ​​[[1,0],[0,1]];

[0086] this.F = [[1,1],[0,1]];

[0087] this.H = [[1,0]];

[0088] this.Q = [[qHeight,0],[0,qVelocity]];

[0089] this.R = [[r]];

[0090] }

[0091] filter(z) {

[0092] if (isNaN(this.x[0][0])) {

[0093] this.x[0][0] = z;

[0094] this.x[1][0] = 0;

[0095] return z;

[0096] }

[0097] this.x = KalmanFilter2D.mul(this.F, this.x);

[0098] this.P = KalmanFilter2D.add(

[0099] KalmanFilter2D.mul(

[0100] KalmanFilter2D.mul(this.F, this.P),

[0101] KalmanFilter2D.transpose(this.F)),this.Q);

[0102] const y = [[z - this.x[0][0]]]; / / Residual

[0103] const S = KalmanFilter2D.add(

[0104] KalmanFilter2D.mul(

[0105] KalmanFilter2D.mul(this.H, this.P),

[0106] KalmanFilter2D.transpose(this.H)),this.R);

[0107] const K = KalmanFilter2D.mul(

[0108] KalmanFilter2D.mul(this.P, KalmanFilter2D.transpose(this.H)),

[0109] KalmanFilter2D.inverse1x1(S));

[0110] this.x = KalmanFilter2D.add(

[0111] this.x,

[0112] KalmanFilter2D.mul(K, y));

[0113] const I = [[1, 0], [0, 1]];

[0114] this.P = ​​KalmanFilter2D.mul(

[0115] KalmanFilter2D.sub(I, KalmanFilter2D.mul(K, this.H)),this.P);

[0116] return this.x[0][0]; / / Return the predicted terrain elevation

[0117] }

[0118] }

[0119] const kalman = new KalmanFilter2D({ qHeight: 1, qVelocity: 0.5, r: 3});

[0120] const initStartPointHeight = async (lng, lat) => {

[0121] const carto = Cesium.Cartographic.fromDegrees(lng, lat);

[0122] const height1 = viewer.scene.sampleHeight(carto);

[0123] viewer.camera.setView({

[0124] destination: Cesium.Cartesian3.fromDegrees(lng, lat, height1 + 2 * CAMERA_OFFSET)}); / / The default multiplier here is 2, which can be configured freely according to the actual situation.

[0125] await new Promise(resolve => setTimeout(resolve, 100));

[0126] const height2 = viewer.scene.sampleHeight(carto);

[0127] return height2 + CAMERA_OFFSET;

[0128] };

[0129] const sampleHeight = async (longitude, latitude, index) => {

[0130] let cameraHeight;<​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​​

[0144] data[index].height = height;

[0145] };

[0146] Therefore, the "adaptive" nature of this embodiment is reflected in the fact that the camera height is not fixed, but rather adjusted based on the predicted terrain elevation output by the filter at the previous moment. Dynamic adjustments, except for the initial point, ensure that the camera is always kept at a certain offset distance above the ground surface, thereby improving the stability of online terrain loading and sampling.

[0147] The fifth step is to perform batch sampling in a serpentine traversal order.

[0148] To reduce frequent viewpoint jumps in space, this embodiment calculates the row and column organization of the sampling point set and performs sampling point by point using a serpentine traversal method. The relevant code is as follows:

[0149] / / Calculate the number of rows and columns, inferring based on the monotonicity of latitude.

[0150] let rows = 1;

[0151] for (let i = 1; i < data.length; i++) {

[0152] if (data[i].latitude < data[i - 1].latitude) break;

[0153] rows++;

[0154] }

[0155] const cols = Math.floor(data.length / rows);

[0156] / / Snake-like traversal for point-by-point sampling

[0157] for (let col = 0; col < cols; col++) {

[0158] if (col % 2 === 0) {

[0159] for (let row = 0; row < rows; row++) {

[0160] const idx = col * rows + row;

[0161] await sampleHeight(data[idx].longitude, data[idx].latitude,idx);

[0162] }

[0163] } else {

[0164] for (let row = rows - 1; row >= 0; row--) {

[0165] const idx = col * rows + row;

[0166] await sampleHeight(data[idx].longitude, data[idx].latitude,idx);

[0167] }

[0168] }

[0169] }

[0170] After sampling is completed, each sampling point record in the 'data' array will be accompanied by a corresponding elevation attribute 'height'.

[0171] Step 6 outputs the sampling results and generates GeoTIFF rasterized elevation products.

[0172] After sampling, the sampling point data containing elevation attributes is exported as JSON, further converted to CSV, and then reconstructed into a raster matrix and written to a GeoTIFF file. In this embodiment, the key code for JSON to CSV conversion is as follows:

[0173] with open('. / temp / ' + file_name + '.json', 'r', encoding='utf-8') asjson_file:

[0174] data = json.load(json_file)

[0175] with open('. / csv / ' + file_name + '.csv', 'w', newline='', encoding='utf-8') as csv_file:

[0176] writer = csv.DictWriter(csv_file, fieldnames=sorted({k for row in data for k in row.keys()}))

[0177] writer.writeheader()

[0178] for row in data:

[0179] writer.writerow(row)

[0180] The key code for converting CSV to GeoTIFF is as follows (taking EPSG:3826 as an example):

[0181] data = pd.read_csv('. / csv / 10m_ECNU.csv')

[0182] data = data.sort_values(['y', 'x'])

[0183] height = data['height'].values

[0184] unique_x = np.unique(data['x'].values)

[0185] unique_y = np.unique(data['y'].values)

[0186] height_matrix = height.reshape(len(unique_x), len(unique_y), order='F').T

[0187] height_matrix = np.flipud(height_matrix[:-1, :-1])

[0188] transform = from_bounds(x_min, y_min, x_max, y_max, num_cols, num_rows)

[0189] with rasterio.open('. / geotif / 10m_ECNU.tif', 'w', driver='GTiff',

[0190] height=num_rows, width=num_cols, count=1,

[0191] dtype=height_matrix.dtype, crs=CRS.from_epsg(3826),

[0192] transform=transform) as dst:

[0193] dst.write(height_matrix, 1)

[0194] The above post-processing steps yield standard GeoTIFF raster elevation products, which facilitate visualization and further analysis in GIS software.

[0195] Example

[0196] like Figure 1 As shown, according to the steps of this invention, in a microcomputer platform environment, the sampling range and sampling interval are first set using getPointByXY.py. Generate a set of sampling points and perform coordinate transformation from EPSG:3826 to EPSG:4326, saving the results as a data file loadable by the front end; then open the getHeight.html page, load the online terrain service, and display the sampling area range. Figure 4 The system calls the terrain sampling interface point by point in a serpentine traversal order to obtain the observed elevation. See the traversal path. Figure 5 After each valid observation is obtained, a constant velocity model with second-order Kalman filtering is used for recursive estimation, thereby adaptively adjusting the camera height at the next sampling point. The closed-loop process is described in [link to closed-loop process]. Figure 3 After sampling, export the JSON result containing elevation attributes. Then run the post-processing scripts sequentially, such as json2csv.py and csv2geotif.py, to generate a GeoTIFF file. This GeoTIFF file can be opened and displayed in GIS software such as QGIS for verification. See [link / details]. Figure 6 This completes the entire process from online batch terrain sampling to the generation of standard raster products.

Claims

1. A digital elevation model sampling method based on a virtual globe platform, characterized in that, The method includes the following specific steps: S1: Sampling point construction and coordinate transformation, within a given rectangular space, according to the sampling interval. Generate a grid of regular sampling points and construct a set of sampling points. Perform coordinate transformation on the set of sampling points to meet the positioning and sampling requirements in the virtual earth environment. S2: Virtual Earth Sampling Environment and Online Terrain Loading. A three-dimensional sampling environment is created in a network-based virtual earth platform, and an online terrain data source and the set of sampling points are loaded to support subsequent point-by-point sampling. S3: Establishment of a second-order Kalman filter for the constant velocity model. Construct a second-order Kalman filter for the constant velocity model and initialize the parameters of the filter to achieve recursive estimation and prediction of the terrain elevation sequence. S4: Traversal sampling and adaptive height adjustment. The terrain height sampling interface is called point by point in a predetermined traversal order to obtain the observed elevation z. Based on the observed elevation status, the camera height of the current sampling point is adaptively determined: after moving the camera to the specified camera height and waiting for online terrain loading and rendering to stabilize, the observed elevation of that sampling point is obtained. When observing elevation When the value is a valid value that is neither empty nor an anomaly, the elevation will be observed. The second-order Kalman filter is input for recursive updating to obtain the new predicted terrain elevation. And used for the camera height of the next sampling point; when the observation elevation When the value is invalid, record the abnormal state and do not update the predicted terrain elevation. ; S5: Output of results and generation of rasterized data. Store and export the sampling results and generate rasterized elevation products.

2. The virtual earth terrain elevation adaptive sampling method according to claim 1, characterized in that, The coordinate transformation includes converting any engineering / projected coordinate system that meets the positioning requirements of the virtual globe into the geographic coordinate system EPSG:4326.

3. The digital elevation model sampling method based on a virtual earth platform according to claim 1, characterized in that, The adaptive calculation method for camera height involves determining the camera height using secondary sampling initialization for the first sampling point or when there is no predicted elevation estimate. This secondary sampling initialization includes: obtaining the first terrain sampling value at the sampling point location. Set the camera height to And wait for the online terrain loading and rendering to stabilize before obtaining the second terrain sampling value. Set the camera height to The camera height at this sampling point is used; for subsequent sampling points, the ratio of camera height to predicted terrain elevation is used. The camera height is calculated using the "+ offset value" method.

4. The digital elevation model sampling method based on a virtual earth platform according to claim 1, characterized in that, The predetermined traversal order is a serpentine traversal order, meaning that adjacent columns are sampled in opposite directions.

5. The virtual earth terrain elevation adaptive sampling method according to claim 1, characterized in that, The rasterized elevation product is raster data with geographic reference information. When writing, the coordinate reference system used is EPSG:3826, or other engineering / projection coordinate systems that meet the application requirements.