Method for converting DSM into DEM
Through a DSM to DEM method, vegetation and building boundary vectors are calculated, vector data is extracted and merged, and topographic grille data is cropped and filled, which is a fast and high-precision conversion from DSM to DEM, solving the problem of DEM data acquisition efficiency and accuracy in the water conservancy industry.
Patent Information
- Application Number
- CN202510393123.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-03-31
AI Technical Summary
It is difficult for the existing technology to quickly obtain high-precision DEM data, especially in water conservancy industries such as small basin division, floodwater analysis and calculation, and river wet week calculation. Existing projects rely mostly on drones to collect point cloud data, and the airspace application time is long, which is time-consuming and labor-consuming.
A method of DSM to DEM is provided. By calculating the vegetation boundary vector and the building boundary vector, extracting the DSM boundary range, merging vector data, performing intersection inversion, cropping DSM data, filling the terrain grid data, and fusing the DEM generated by the segmentation to achieve rapid acquisition of DEM.
Using existing DSM data to quickly obtain high-precision DEM, eliminate the process of drone data collection, reduce airspace application time, improve data acquisition efficiency and accuracy, and is suitable for application needs in the water conservancy industry.
Smart Images

Figure CN120198544A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition processing, and particularly to a method for converting DSM to DEM. Background Art
[0002] DSM is the Digital Surface Model. In addition to elevation information, it also integrates the height information of ground objects such as buildings, bridges, and trees on the ground surface. DEM is the Digital Elevation Model, which only contains terrain elevation information and does not contain other surface information.
[0003] Common remote sensing processing software can directly extract DSM from stereo images, and the data acquisition method is mature and the data accumulation is rich. However, for the water conservancy industry, especially for small watershed division, catchment analysis and calculation, channel wetted perimeter calculation, etc., DEM data is required. Generally speaking, 30-meter DEM can be directly downloaded, but the accuracy is not sufficient to meet the application requirements. In existing projects, drones are mostly equipped with lidar, and DEM information can be obtained through point cloud data and operations such as filtering. The data acquisition efficiency varies with the size of the flight area. However, for drones to fly, airspace application is required, and the time period is 1 - 3 months, which is very time-consuming for projects with tight construction periods that only need to obtain DEM for some small areas. Summary of the Invention
[0004] In order to facilitate the rapid acquisition of DEM, the present invention provides a method for converting DSM to DEM.
[0005] The present invention provides a method for converting DSM to DEM, adopting the following technical solutions: A method for converting DSM to DEM includes the following steps: Calculate the vegetation boundary vector and the building boundary vector according to the DSM data; Extract the DSM boundary range from the DSM data; Merge the building boundary vector and the vegetation boundary vector respectively; Take the inverse of the intersection of the DSM boundary range, the building boundary vector, and the vegetation boundary vector to obtain the terrain vector data; Crop the DSM data to obtain the terrain grid data; Fill the terrain grid data; Fuse the DEMs generated by sub - maps.
[0006] In a specific feasible implementation, calculating the vegetation boundary vector includes the following steps: Based on the red, green, and blue bands, input the DSM data into ENVI software, calculate the VDVI index, and further calculate to obtain the vegetation boundary vector; The calculation formula for the VDVI index is:
[0007] In the above formula, is the VDVI index, represents the reflectance of the green band; represents the reflectance of the red band; represents the reflectance of the blue band.
[0008] In a specific feasible implementation, calculating the building boundary vector includes the following steps: Calculate the regional NDBI index:
[0009] In the above formula, is the regional NDBI index, and the preliminary building boundary vector is obtained; represents the reflectance of the shortwave infrared band; represents the reflectance of the near-infrared band; According to the building gray-scale characteristics, construct and set the threshold interval range of the gray-scale characteristics, and optimize and adjust the preliminary building boundary vector according to the threshold interval to obtain the building boundary vector.
[0010] In a specific feasible implementation, extracting the DSM boundary range from the DSM data includes the following steps: Input the DSM data into ArcGIS, select "3D Analyst Tools" in "ArcToolbox", and successively select "Conversion - From Raster - Raster Range" in "3D Analyst Tools" to convert the spatial range of the DSM data into vector data.
[0011] In a specific feasible implementation, merging the building boundary vector and the vegetation boundary vector respectively includes the following steps: Input the building boundary vector and the vegetation boundary vector into ArcGIS respectively, and successively select "Data Management Tools - General - Merge" in "ArcToolbox" for polygon merging.
[0012] In a specific feasible implementation, during the polygon merging process, if there is no association between a large and a small polygon, delete the small polygon.
[0013] In a specific implementation scheme, the intersection inversion of the DSM boundary range, the building boundary vector and the vegetation boundary vector includes the following steps: In the "ArcToolbox" of ArcGIS, select "Analysis Tools-Overlay Analysis-Intersection Inversion" in sequence, remove the building boundary vector and vegetation boundary vector in the DSM boundary range, and only retain the terrain information to form terrain vector data.
[0014] In a specific implementation scheme, trimming DSM data includes the following steps: Use the terrain vector data as a mask, select "Spatial Analyst Tools - Extraction Analysis - Extract by Mask" in ArcGIS "ArcToolbox" in turn, and use the terrain vector data to remove the building and vegetation data from the DSM data to obtain terrain grid data with holes.
[0015] In a specific implementation scheme, filling the terrain grid data includes the following steps: In the "ArcToolbox" of ArcGIS, select "Data Management Tools - LAS Dataset - Create LAS Dataset" to build the LAS dataset and store the point cloud data output by the global mapper in the LAS dataset; In "ArcToolbox", select "Conversion Tools - Convert to Raster - LAS Dataset to Raster" to convert the point cloud data into raster data. In "ArcToolbox", select "Spatial Analyst Tools - Grid Calculator" to post-process the grid data, set: Com("Grid Data" < 0, 0, "Grid Data") to remove negative values in the grid data; set: SetNull("Grid Data" == 0, "Grid Data") to remove null values in the grid data.
[0016] In a specific feasible implementation method, after constructing the las data set, the terrain grid data is converted into point cloud data in las format through Global Mapper, and the point cloud data is corrected.
[0017] In summary, the present invention has the following beneficial effects: 1. The existing DSM can be used to convert DEM, eliminating the need to specially assign drones to collect DEM, making it convenient and quick to obtain DEM.
[0018] 2. When filling the terrain grid data, convert the DSM into point cloud data and make fine corrections to improve the accuracy of DSM to DEM. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flowchart of the method for converting DSM to DEM.
[0020] Figure 2 It is a comparison diagram before and after patch processing. Specific implementation manner
[0021] For the convenience of understanding, some terms are described below.
[0022] DEM (Digital Elevation Model), that is, Digital Elevation Model, is a digital simulation of the ground terrain through limited terrain elevation data (that is, the digital expression of the terrain surface form), and is a kind of entity ground model representing the ground elevation in the form of an ordered numerical array. It is a branch of the Digital Terrain Model (DTM for short).
[0023] DSM (Digital Surface Model), Digital Surface Model, is a ground elevation model that includes the heights of surface buildings, bridges, trees, etc. Compared with DEM, DEM only contains the elevation information of the terrain and does not contain other surface information. DSM further covers the elevation of other surface information except the ground on the basis of DEM. DSM expresses the undulation of the real earth surface and contains more information, such as natural geographical space information such as building height and vegetation canopy height.
[0024] The following combines the attached Figure 1-2 The present invention will be further described in detail.
[0025] Refer to Figure 1 , the method for converting DSM to DEM includes the following steps: S100, extract buildings and vegetation from the DSM data to obtain a vector range.
[0026] DSM is a digital ground model that includes terrain, ground objects such as houses, trees, and vegetation. Therefore, for areas with a large number of vegetation and buildings, DSM cannot be directly used. For areas with less vegetation and ground objects, it can be considered that DSM is a simple elevation model and can be directly used to generate contour lines. However, general construction areas such as reservoirs and dams in water conservancy projects are mostly mountainous areas with dense vegetation. If directly default processed, it will definitely be affected by vegetation coverage, which will affect the real data of the elevation and have a great impact on the auxiliary design. Therefore, it is necessary to obtain ground points by removing non-surface ground objects. The ground points include two categories: vegetation and buildings.
[0027] Based on the red, green, and blue bands, the DSM data is input into ENVI software, and the VDVI index is constructed and calculated using the following formula. The vegetation boundary vector is further calculated based on the VDVI index. The calculation formula of the VDVI index is as follows:
[0028] In the above formula, is the VDVI index, represents the reflectance of the green band; represents the reflectance of the red band; represents the reflectance of the blue band.
[0029] The regional NDBI index is constructed and calculated according to the following formula:
[0030] In the above formula, is the regional NDBI index, and the preliminary building boundary vector is obtained; represents the reflectance of the shortwave infrared band; represents the reflectance of the near-infrared band.
[0031] According to the gray-scale characteristics of the building, the threshold interval range of the gray-scale characteristics is constructed and set, and the preliminary building boundary vector is optimized and adjusted according to the threshold interval, so as to obtain the building boundary vector.
[0032] By calculating the vegetation boundary vector and the building boundary vector, it is convenient to remove non-surface ground objects in the DSM subsequently.
[0033] S200, convert the boundary range of the DSM into vector data.
[0034] Input the DSM data into ArcGIS, and convert the DSM data into vector polygons or polylines through the raster extent tool in ArcGIS, that is, convert the spatial range of the DSM data into vector data, which is convenient for subsequent processing of the DSM data.
[0035] Specifically: After the DSM data is input into ArcGIS, select the "3D Analyst Tools" in "ArcToolbox", and then select "Conversion - From Raster - Raster Extent" in the "3D Analyst Tools" in turn to extract the DSM boundary range from the DSM data, that is, convert the DSM data into vector data.
[0036] S300, merge the building boundary vector and the vegetation boundary vector.
[0037] Input the building boundary vector and the vegetation boundary vector into ArcGIS. Use the tools in ArcGIS to merge the building boundary vector and the vegetation boundary vector respectively, and remove the fragmented patches.
[0038] Specifically: Taking Figure 2 as an example, among the building boundary vectors before processing, there are small patches in the large patches, that is, there are multiple vector ranges. After inputting the building boundary vector into ArcGIS, successively select "Data Management Tools - General - Merge" in "ArcToolbox" to obtain the processed building boundary vector, and merge the small patches into the large patches, as shown in Figure 2 . It can be understood that if there is no association between a large and a small patch, the small patch will be deleted. By merging and removing patches, the building boundary vector and the vegetation boundary vector can be simplified, reducing the data processing workload. The same applies to the vegetation boundary vector and will not be elaborated here.
[0039] S400. Take the inverse of the intersection of the DSM boundary range, the building boundary vector, and the vegetation boundary vector to obtain the terrain vector data.
[0040] By successively selecting "Analysis Tools - Overlay Analysis - Inverse Intersection" in the "ArcToolbox" of ArcGIS, remove the building boundary vector and the vegetation boundary vector from the DSM boundary range, that is, complete the removal of non-surface features, so that only terrain information is retained in the DSM boundary range, forming the terrain vector data.
[0041] S500. Clip the DSM data to obtain the terrain grid data.
[0042] Use the terrain vector data as a mask and clip the DSM data through mask extraction to obtain the data of buildings and vegetation in the DSM data.
[0043] Specifically: By successively selecting "Spatial Analyst Tools - Extraction Analysis - Extract by Mask" in the "ArcToolbox" of ArcGIS, use the terrain vector data to remove the building and vegetation data from the DSM data, resulting in a terrain grid data with holes.
[0044] S600. Fill the terrain grid data.
[0045] After removing the vegetation and buildings, there are sometimes some other non-surface features, so the DSM data needs to be further corrected. By converting the DSM close to the surface into a point cloud form and correcting it through the point cloud, the accurate point cloud close to the surface is obtained after correction.
[0046] Specifically, the terrain grid data is converted into point cloud data in las format through Global Mapper. It can be understood that there are some low shrubs in the terrain raster data. Since they are extremely close to the ground, the surface data close to the ground needs to be removed. After converting the terrain data into point cloud, it can be manually removed to obtain a refined processing result.
[0047] In the "ArcToolbox" of ArcGIS, successively select "Data Management Tools - LAS Dataset - Create LAS Dataset" to construct the LAS dataset, and store the point cloud data output by global mapper in the LAS dataset for subsequent loading of point cloud data.
[0048] In the "ArcToolbox", successively select "Conversion Tools - To Raster - LAS Dataset to Raster", and convert the point cloud data into raster data. During the conversion process, select the inverse distance weighting method as the interpolation algorithm.
[0049] Combining the low-precision DEM and the high-precision point cloud for hole filling and interpolation, it will be found that there is an overflow phenomenon during the operation, that is, negative values appear.
[0050] In the "ArcToolbox", successively select "Spatial Analyst Tools - Raster Calculator" to post-process the raster data. Set: Com("raster data" < 0, 0, "raster data") to remove the negative values in the raster data; Set: SetNull("raster data" == 0, "raster data") to remove the null values in the raster data. Finally, the formed terrain raster data is the DEM.
[0051] In some other embodiments, it is also possible to select the "Raster to Multipoint" command in the "ArcToolbox" to convert the terrain raster data into multipoint data, replacing the original conversion to point cloud data. Then select the "Multipoint to Point" command to convert the multipoint data into point data. Then use the "Extract Values to Points" command to extract the elevation values of the point data. Use the "Create TIN" command to construct an irregular triangular network based on the point data. Finally, use "TIN to Raster" to convert the TIN into raster data to generate the DEM.
[0052] In some other embodiments, the "Raster to Multipoint" command can also be selected in "ArcToolbox" to convert terrain raster data into multipoint data, replacing the original conversion to point cloud data. Then select the "Multipoint to Point" command to convert the multipoint data into point data. Then use the "Extract Values to Points" command to extract the elevation values of the point data. Use "Raster Interpolation" and select an interpolation method, such as inverse distance weighting, Kriging interpolation, etc., to generate a DEM. During the process of generating the DEM, adjust the interpolation parameters according to the situation, such as using weight coefficients, search radii, etc.
[0053] In some other embodiments, the terrain raster data can also be converted into a.txt format in Global Mapper, and the.txt file is input into CC software for data processing such as point cloud filtering and denoising. The data in the processed.txt file is exported as a point vector file and input into ArcGIS, and "Raster Interpolation" is used for interpolation to generate a DEM.
[0054] For S700, the DEMs generated in separate sheets are fused.
[0055] In ArcGIS, through the "Mosaic to Raster" command, multiple DEMs generated through steps S100 - S600 are fused to finally generate a complete and seamless DEM.
[0056] The above are all preferred embodiments of the present invention, and the protection scope of the present invention is not limited thereby. Therefore, all equivalent changes made according to the structure, shape, and principle of the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for converting DSM to DEM, characterized by: The steps include: Calculate vegetation boundary vector and building boundary vector based on DSM data; Extract DSM boundary range from DSM data; Merge building boundary vectors and vegetation boundary vectors separately; The intersection of the DSM boundary range, the building boundary vector and the vegetation boundary vector is inverted to obtain the terrain vector data; Crop DSM data to obtain terrain grid data; Fill the terrain grid data; The DEM generated by segmentation is merged.
2. The method for converting DSM to DEM according to claim 1, characterized in that: Calculating the vegetation boundary vector includes the following steps: Based on the red, green and blue bands, the DSM data were input into the ENVI software to calculate the VDVI index, and the vegetation boundary vector was further calculated; The calculation formula of VDVI index is: In the above formula, That is the VDVI index, Indicates the reflectance of the green band; Represents the red band reflectance; Represents the blue band reflectance.
3. The method for converting DSM to DEM according to claim 1, characterized in that: Calculating the building boundary vector includes the following steps: Calculate the regional NDBI index: In the above formula, That is the regional NDBI index, and the preliminary boundary vector of the building is obtained; Indicates the reflectivity in the short-wave infrared band; Represents the reflectivity in the near-infrared band; According to the grayscale features of the building, a threshold interval range of the grayscale features is constructed and set, and the preliminary boundary vector of the building is optimized and adjusted according to the threshold interval, so as to obtain the boundary vector of the building.
4. The method for converting DSM to DEM according to claim 1, characterized in that: Extracting DSM boundary range from DSM data includes the following steps: Input the DSM data into ArcGIS, select "3D Analyst Tools" in "ArcToolbox", and select "Conversion - From Raster - Raster Extent" in "3D Analyst Tools" to convert the spatial extent of the DSM data into vector data.
5. The method for converting DSM to DEM according to claim 1, characterized in that: Merging the building boundary vector and the vegetation boundary vector separately includes the following steps: Input the building boundary vector and vegetation boundary vector into ArcGIS respectively, and select "Data Management Tools-General-Merge" in "ArcToolbox" to merge the spots.
6. The method for converting DSM to DEM according to claim 5, characterized in that: During the image patch merging process, if one large image patch and one small image patch are unrelated, the small image patch will be deleted.
7. The method for converting DSM to DEM according to claim 1, characterized in that: The intersection inversion of the DSM boundary range, building boundary vector and vegetation boundary vector includes the following steps: In the "ArcToolbox" of ArcGIS, select "Analysis Tools-Overlay Analysis-Intersection Inversion" in sequence, remove the building boundary vector and vegetation boundary vector in the DSM boundary range, and only retain the terrain information to form terrain vector data.
8. The method for converting DSM to DEM according to claim 7, characterized in that: The steps of trimming DSM data are as follows: Use the terrain vector data as a mask, select "Spatial Analyst Tools-Extraction Analysis-Extraction by Mask" in ArcGIS "ArcToolbox", and use the terrain vector data to remove the building and vegetation data from the DSM data to obtain terrain grid data with holes.
9. The method for converting DSM to DEM according to claim 1, characterized in that: Filling terrain grid data includes the following steps: In the "ArcToolbox" of ArcGIS, select "Data Management Tools - LAS Dataset - Create LAS Dataset" to build the LAS dataset and store the point cloud data output by the global mapper in the LAS dataset; In "ArcToolbox", select "Conversion Tools - Convert to Raster - LAS Dataset to Raster" to convert the point cloud data into raster data. In "ArcToolbox", select "Spatial Analyst Tools - Grid Calculator" to post-process the grid data and set: Com("Grid Data" < 0, 0, "Grid Data") to remove negative values in the grid data; Setting: SetNull("grid data"==0, "grid data") to remove null values in the grid data.
10. The method for converting DSM to DEM according to claim 9, characterized in that: After constructing the las data set, the terrain grid data is converted into point cloud data in las format through Global Mapper, and the point cloud data is corrected.
Citation Information
Patent Citations
Automated construction method of digital elevation model
CN105678097A
DEM rapid processing method based on point cloud data
CN107749080A
Method for extracting surface feature elements in topographic map
CN111382715A
DSM editing method and system, terminal and readable storage medium
CN116597123A
Automatic editing and obtaining method from InSAR-DSM to DEM
CN116977867A