Laser radar data visualization method based on CesiumHeatmap and electronic equipment
By obtaining and processing the latitude and longitude information of lidar, and using CesiumHeatmap to load heat map data in Cesium maps, the problem of being unable to render and obtain lidar data in the existing technology is solved, and the complete rendering and click acquisition functions of the data are realized.
Patent Information
- Application Number
- CN202410685885.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-10-01
AI Technical Summary
The existing CesiumHeatmap plug-in cannot directly render lidar data with non-latitude and longitude information, and cannot obtain the data of the corresponding location when clicked.
By obtaining the latitude and longitude information of the lidar, calculation processing is performed to generate a latitude and longitude data group, and CesiumHeatmap is used to load the heat map data in the Cesium map to implement data rendering and click event processing to display the corresponding monitoring data.
It realizes the complete rendering of lidar data and the function of clicking to obtain data, solving the problem of being unable to render and obtain data in the existing technology.
Smart Images

Figure CN118733663A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of radar data processing technology, and in particular to a laser radar data visualization method and electronic equipment based on CesiumHeatmap. Background Art
[0002] Cesium is an open source JavaScript library for 3D earth and map visualization developed by AGI's computer graphics development team in 2011. It provides an efficient data visualization platform for 3D GIS. It provides powerful functions for presenting the earth and various geographic data on the earth in a web browser.
[0003] CesiumHeatmap is a plugin based on the Cesium JavaScript library for creating heat maps in a 3D earth scene. The CesiumHeatmap plugin represents a heat map by displaying a color gradient on the earth scene. It can color different areas on the earth according to the values in the dataset to visualize the density and distribution of the data. For example, you can use CesiumHeatmap to display data on population density, temperature distribution, air quality index, etc.
[0004] To meet the data visualization effect of lidar, the existing methods have great limitations. First, the data of the visualization effect achieved by using Cesium and CesiumHeatmap must have location information, that is, each point needs to have longitude and latitude information, while the radar data has no longitude and latitude information except the radar longitude and latitude information. Secondly, the visualization effect completed by using CesiumHeatmap in Cesium does not have the function of clicking to obtain the corresponding location data. Summary of the invention
[0005] The purpose of the present invention is to provide a laser radar data visualization method and electronic device based on CesiumHeatmap to solve the problems raised in the above background technology.
[0006] To achieve the above object, the present invention provides the following technical solution: a CesiumHeatmap-based laser radar data visualization method, the method comprising:
[0007] Get the location of the laser radar;
[0008] The latitude and longitude information of the laser radar location is calculated and processed to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range to form a latitude and longitude data group;
[0009] Load the lidar heat map data in the Cesium map based on the method in CesiumHeatmap.
[0010] Render the canvas on the Cesium map and embed the longitude and latitude data set into the canvas to display the corresponding monitoring data when clicked.
[0011] Furthermore, the latitude and longitude information corresponding to the monitoring data within the monitoring range of the laser radar is calculated and processed to form a longitude and latitude data group, which includes:
[0012] Obtain the longitude and latitude of the center of the monitoring range and the longitude and latitude points of the monitoring range center moving toward the north direction by a set step length to obtain a longitude and latitude point group;
[0013] The longitude and latitude point group is rotated 360° clockwise with a rotation angle of 1° to obtain the longitude and latitude information of the point corresponding to the lidar data;
[0014] The AJAX asynchronous method is used to obtain the lidar monitoring data from the background database, and the lidar monitoring data is bound and processed with the longitude and latitude of the points corresponding to the lidar data to obtain a longitude and latitude data group.
[0015] Furthermore, the first line that the laser radar starts scanning is the due north direction.
[0016] Furthermore, the method of loading the thermal map data of the lidar in the Cesium map based on the latitude and longitude data group in CesiumHeatmap includes: using the latitude and longitude data group to load the thermal map data of the lidar in the Cesium map using the create and setWGS84Data methods in CesiumHeatmap.
[0017] Furthermore, rendering the canvas on the Cesium map and embedding the longitude and latitude data set into the canvas to display the corresponding monitoring data when clicked includes:
[0018] Calculate the angle between the click position on the Cesium map and the north direction of the center position of the lidar, as well as the distance to the center position;
[0019] According to the obtained angle and distance, the latitude and longitude information of the laser radar data corresponding to the clicked position is obtained from the latitude and longitude data group;
[0020] Render the canvas on the Cesium map to display the latitude and longitude information of the lidar data corresponding to the clicked location;
[0021] Bind the mouse click event on the Cesium map, convert the screen coordinates into longitude and latitude information, and pass the displayed longitude and latitude information to display the corresponding monitoring data.
[0022] Furthermore, rendering a canvas on a Cesium map to display the latitude and longitude information of the lidar data corresponding to the clicked position includes: creating a Canvas to draw text, using the method of adding a billboard in Cesium and the created Canvas to draw text, and rendering the latitude and longitude information of the lidar data corresponding to the clicked position into the Cesium map.
[0023] Furthermore, the mouse click event is bound to the Cesium map, the screen coordinates are converted into longitude and latitude information, and the displayed longitude and latitude information is passed in to display the corresponding monitoring data, including: using Cesium.ScreenSpaceEventHandler in the Cesium map to bind the currently rendered canvas and using setInputAction to add a left mouse click event to the canvas, and writing a method to convert screen coordinates into longitude and latitude. According to the angle between the click position on the Cesium map and the north direction of the center position of the lidar and the distance from the center position, the longitude and latitude information is passed in to display the corresponding monitoring data.
[0024] An electronic device comprises a memory and a processor, wherein the memory stores program instructions, and when the processor runs the program instructions, the steps in the above-mentioned CesiumHeatmap-based laser radar data visualization method are executed.
[0025] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention calculates the longitude and latitude information corresponding to the lidar monitoring data within the monitoring range according to the longitude and latitude information of the lidar location through a longitude and latitude calculation algorithm, and combines with CesiumHeatmap to completely render the longitude and latitude information corresponding to the lidar monitoring data and obtain the monitoring data of the corresponding location by clicking, thereby solving the problems that CesiumHeatmap cannot directly render the lidar data and cannot click to obtain the corresponding data. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flow chart of the laser radar data visualization method based on CesiumHeatmap of the present invention;
[0027] Figure 2 A flow chart of a method for calculating and processing the latitude and longitude information of the laser radar location to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range to form a latitude and longitude data group;
[0028] Figure 3 A flowchart of a method for rendering a canvas on a Cesium map and embedding a longitude and latitude data set into the canvas to display corresponding monitoring data when clicked is provided in the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] like Figure 1 As shown, this embodiment provides a laser radar data visualization method based on CesiumHeatmap, and the method includes the following steps:
[0031] S1: Get the location of the laser radar;
[0032] S2: Calculate and process the latitude and longitude information of the laser radar location to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range to form a latitude and longitude data group;
[0033] S3: Load the thermal map data of the lidar into the Cesium map based on the method in CesiumHeatmap.
[0034] S4: Render a canvas on the Cesium map and embed the longitude and latitude data set into the canvas to display the corresponding monitoring data when clicked.
[0035] For ease of understanding, this embodiment is described by way of example: the longitude of the known radar is 118, the latitude is 26, the step length is 30m, and the monitoring range is 3660m;
[0036] Afterwards, the latitude and longitude information of the laser radar location is calculated and processed to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range to form a longitude and latitude data group, such as Figure 2 As shown, the following steps are included:
[0037] S21: Obtain the longitude and latitude of the center of the monitoring range and the longitude and latitude points of the monitoring range center moving toward the north direction with a set step length to obtain a longitude and latitude point group;
[0038] S22: Rotate the longitude and latitude point group clockwise by 360° with a rotation angle of 1° to obtain the longitude and latitude information of the point corresponding to the laser radar data;
[0039] S23: Using the AJAX asynchronous method, the laser radar monitoring data is obtained from the background database, and the laser radar monitoring data is bound and processed with the longitude and latitude of the points corresponding to the laser radar data to obtain a longitude and latitude data group.
[0040] Specifically, we deeply analyzed the data source collected by the LiDAR and found that the range gate of the LiDAR is X (in meters), that is, data is monitored every X (in meters) on a line, and the first line scanned by the LiDAR is the geographic north position. Therefore, with the help of the conversion method between longitude and latitude and radians in Cesium, we wrote a custom method calculateDestinationCoordinates to define the parameters that can be passed in as longitude and latitude and the step length distance to calculate the longitude and latitude after moving the corresponding step length towards the north direction. The specific code is as follows:
[0041]
[0042]
[0043] Based on the above, it is not difficult to conclude that if you want to get the longitude and latitude of all corresponding points on a line, you only need to pass different distance parameters to the above calculateDestinationCoordinates method. Therefore, write a custom method getLineCoordinates to define the parameters that can be passed in as the longitude and latitude of the center point, the step length, and the range, calculate the total number of points, and use the total number of points to traverse the calculateDestinationCoordinates method to obtain the longitude and latitude points of all points in the range facing due north to obtain the longitude and latitude point group. The specific code is as follows:
[0044]
[0045] It is known that the laser radar scans clockwise and the scanning distance is 1°. The longitude and latitude point group obtained by the getLineCoordinates method is rotated 1° clockwise with the radar center as the center. The longitude and latitude data of all points after the rotation of 1° can be obtained by using trigonometric functions. Therefore, a custom method get360LinesCoordinates is written to define the parameters that can be passed in as the center longitude and latitude, step size, and range. The longitude and latitude point group obtained by the getLineCoordinates method is rotated clockwise with 1° as the rotation angle to calculate the longitude and latitude of the entire line after the rotation. After traversing 360 times, the longitude and latitude data of 360 lines starting from due north can be obtained. In this way, the longitude and latitude of all points in the monitoring range that can correspond to the radar data are obtained. The specific code is as follows:
[0046]
[0047]
[0048] Use Axios to send an asynchronous request to the backend database to obtain the monitoring data of the lidar, process the monitoring data of the lidar, insert the monitoring data into the corresponding longitude and latitude points and store them flatly in heatMapList. The data stored in heatMapList is the longitude and latitude data group. The specific code is as follows:
[0049]
[0050]
[0051] The latitude and longitude data set processed above can be used by CesiumHeatmap. The create and setWGS84Data methods can be used to load the corresponding heat map data of the lidar into the Cesium map. The specific code is as follows:
[0052]
[0053]
[0054] After that, render the canvas on the Cesium map and embed the longitude and latitude data set into the canvas so that the corresponding monitoring data can be displayed when clicked, such as Figure 3 As shown, the following steps are included:
[0055] S41: Calculate the angle between the click position on the Cesium map and the north direction of the center position of the LiDAR, as well as the distance to the center position;
[0056] S42: According to the obtained angle and distance, the longitude and latitude information of the laser radar data corresponding to the click position is obtained from the longitude and latitude data group;
[0057] S43: Rendering a canvas on the Cesium map to display the latitude and longitude information of the lidar data corresponding to the clicked location;
[0058] S44: Bind the mouse click event on the Cesium map, convert the screen coordinates into longitude and latitude information, and pass the displayed longitude and latitude information to display the corresponding monitoring data;
[0059] Specifically, the data of the known laser radar in 0-X (unit m) can be replaced by the data in X (unit m). If the angle between the mouse click position and the north direction of the radar center position and the distance from the center position are known, the data to be obtained at the click position can be calculated. Write a calculation method calculateValue, define the parameters that can be passed in as the angle to the north direction, distance, step size, array to be filtered, key name, calculate and return the value of the corresponding key name in the radar data, so that the latitude and longitude information of the laser radar data corresponding to the click position can be obtained from the latitude and longitude data group. The specific code is as follows:
[0060]
[0061]
[0062] Write the createLabelImage method to create a Canvas canvas so that Cesium's billboard can be rendered better on the map. The specific code is as follows:
[0063]
[0064]
[0065] Write the angle and distance calculation method calculateMapClick, and use the calculateValue method to get the value of the corresponding key name. Then use the billboard method added in Cesium and combine it with the createLabelImage method to render the data on the Cesium map and display the latitude and longitude information of the lidar data corresponding to the clicked position. The specific code is as follows:
[0066]
[0067]
[0068]
[0069] In the Cesium map, bind the left-click event, and convert the screen coordinates obtained by the click into longitude and latitude in this event. Then use the calculateMapClick method to pass the longitude and latitude, and display the corresponding monitoring data after the user clicks. The specific code is as follows:
[0070]
[0071]
[0072] This embodiment also provides an electronic device, which includes a memory and a processor. The memory stores program instructions. When the processor runs the program instructions, the steps in the above-mentioned CesiumHeatmap-based lidar data visualization method are executed. The electronic device can be a computer, a tablet computer or other electronic device.
[0073] The present invention uses a longitude and latitude calculation algorithm to calculate the longitude and latitude information corresponding to the lidar monitoring data within the monitoring range according to the longitude and latitude information of the lidar location, and combines CesiumHeatmap to completely render the longitude and latitude information corresponding to the lidar monitoring data and obtain the monitoring data of the corresponding location by clicking, thereby solving the problems that CesiumHeatmap cannot directly render the lidar data and cannot click to obtain the corresponding data.
[0074] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A laser radar data visualization method based on CesiumHeatmap, characterized in that: The method comprises: Get the location of the laser radar; The latitude and longitude information of the laser radar location is calculated and processed to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range to form a latitude and longitude data group; Load the lidar heat map data in the Cesium map based on the method in CesiumHeatmap. Render the canvas on the Cesium map and embed the longitude and latitude data set into the canvas to display the corresponding monitoring data when clicked.
2. The CesiumHeatmap-based laser radar data visualization method according to claim 1, characterized in that: The latitude and longitude data group formed by calculating and processing the latitude and longitude information of the laser radar location to obtain the latitude and longitude information corresponding to the monitoring data within the laser radar monitoring range includes: Obtain the longitude and latitude of the center of the monitoring range and the longitude and latitude points of the monitoring range center moving toward the north direction by a set step length to obtain a longitude and latitude point group; The longitude and latitude point group is rotated 360° clockwise with a rotation angle of 1° to obtain the longitude and latitude information of the point corresponding to the lidar data; The AJAX asynchronous method is used to obtain the lidar monitoring data from the background database, and the lidar monitoring data is bound and processed with the longitude and latitude of the points corresponding to the lidar data to obtain a longitude and latitude data group.
3. The CesiumHeatmap-based laser radar data visualization method according to claim 2, characterized in that: The first line that the lidar starts scanning is the true north direction.
4. The CesiumHeatmap-based laser radar data visualization method according to claim 2, characterized in that: The method of loading the heat map data of the laser radar in the Cesium map based on the latitude and longitude data group in CesiumHeatmap includes: using the latitude and longitude data group to load the heat map data of the laser radar in the Cesium map using the create and setWGS84Data methods in CesiumHeatmap.
5. The CesiumHeatmap-based laser radar data visualization method according to claim 1, characterized in that: The rendering of the canvas on the Cesium map and the embedding of the longitude and latitude data set into the canvas to display the corresponding monitoring data when clicked include: Calculate the angle between the click position on the Cesium map and the north direction of the center position of the lidar, as well as the distance to the center position; According to the obtained angle and distance, the latitude and longitude information of the laser radar data corresponding to the clicked position is obtained from the latitude and longitude data group; Render the canvas on the Cesium map to display the latitude and longitude information of the lidar data corresponding to the clicked location; Bind the mouse click event on the Cesium map, convert the screen coordinates into longitude and latitude information, and pass the displayed longitude and latitude information to display the corresponding monitoring data.
6. The CesiumHeatmap-based laser radar data visualization method according to claim 5, characterized in that: Rendering a canvas on a Cesium map to display the latitude and longitude information of the lidar data corresponding to the clicked position includes: creating a Canvas to draw text, using the method of adding a billboard in Cesium and the created Canvas to draw text, and rendering the latitude and longitude information of the lidar data corresponding to the clicked position into the Cesium map.
7. The CesiumHeatmap-based laser radar data visualization method according to claim 6, characterized in that: Bind the mouse click event on the Cesium map, convert the screen coordinates into longitude and latitude information, and pass the displayed longitude and latitude information to display the corresponding monitoring data, including: use Cesium.ScreenSpaceEventHandler in the Cesium map to bind the currently rendered canvas and use setInputAction to add a left mouse click event to the canvas, write a method to convert screen coordinates into longitude and latitude, and pass the longitude and latitude information according to the angle between the click position on the Cesium map and the north direction of the center position of the lidar and the distance from the center position to display the corresponding monitoring data.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, wherein the memory stores program instructions, and when the processor runs the program instructions, the steps in any one of claims 1 to 7 of the CesiumHeatmap-based lidar data visualization method are executed.
