CN-122023625-A - Meteorological data visual rendering method, device, computer equipment and storage medium
Abstract
The embodiment of the application provides a visual rendering method, a visual rendering device, computer equipment and a storage medium for meteorological data, wherein the visual rendering method comprises the steps of creating a map object and a layer instance, and initializing the created map object; the method comprises the steps of initializing a map object, registering multiple projections on the initialized map object, adding a created map layer instance to the map object, initializing a rendering context for the map layer instance added to the map object, initializing a data loader according to uniform resource locator parameters in the map layer instance, adding a current map layer instance to a map layer set of the loader object, requesting data and analyzing the data by the data loader, pushing the analyzed data to the current map layer instance, completing data rendering at the map layer instance based on the multiple projections on the map object, and presenting rendering effects on the map object, wherein the aim of providing rendering capability for multiple types of meteorological data can be achieved by expanding the map layer.
Inventors
- SONG WENBIN
- LV ZHONGLIANG
- LIU TAO
- HE YANAN
- SUN JING
- GAO BOHAN
- YU LIANQING
- HAN FENG
Assignees
- 国家气象中心(中央气象台、中国气象局气象导航中心)
Dates
- Publication Date
- 20260512
- Application Date
- 20260310
Claims (10)
- 1. A visual rendering method of meteorological data is characterized by comprising the following steps: creating a map object and a layer instance, and initializing the created map object; registering a plurality of projections on the initialized map object, and adding the created layer instance to the map object; Initializing a rendering context for a layer instance added to a map object, initializing a data loader according to uniform resource locator parameters in the layer instance, and adding the current layer instance to a layer set of the loader object; and using a data loader to request data and analyze the data, pushing the analyzed data to the current layer instance, completing data rendering at the layer instance based on various projections on the map object, and presenting rendering effects on the map object.
- 2. The method of claim 1, wherein creating a layer instance comprises: Creating a color spot map layer, a contour extraction map layer, a grid value map layer, a UV color spot map layer, a wind pole map layer, an RGB color spot map layer, a wind particle map layer, a surge map layer, an arrow map layer, a ground map filling map layer, a high-altitude map filling map layer, a site map layer and a contour map layer.
- 3. The method of claim 1, wherein registering the plurality of projections on the initialized map object comprises: the Albers equal-volume projections, lambert equiangular cone projections, northern hemisphere polar red plane projections, southern hemisphere polar red plane projections and nominal projections are registered on the initialized map object.
- 4. The method of claim 1, wherein requesting data with the data loader comprises: and initiating a request by using a data loader according to the uniform resource locator parameter in the layer instance, and acquiring remote data.
- 5. The method of claim 1, wherein parsing the data with the data loader comprises: Cutting the raster data according to the map range under the condition that the acquired remote data is raster data; And preprocessing the vector data under the condition that the acquired remote data is the vector data, wherein the preprocessing at least comprises the steps of converting a data structure and filtering invalid data.
- 6. The method of claim 1, wherein the rendering of data at the layer instance based on the plurality of projections on the map object comprises: And the layer organizes data according to the context types in the parsed data, executes WebGL or Canvas2D context rendering, and selects corresponding projections from various projections on the map object in the rendering process, wherein WebGL is a world wide web graphic library, and Canvas2D is a two-dimensional Canvas.
- 7. The method of claim 6, wherein selecting a corresponding projection from a plurality of projections on the map object during the rendering process comprises: Acquiring projection information of a current map, and organizing projection conversion related parameters according to the projection information; determining a projection conversion mode according to the current layer rendering context: under the condition that the current layer rendering context is Canvas2D, generating a conversion function according to projection conversion related parameters, converting longitude and latitude coordinates of data into screen coordinates, and rendering vector data on a Canvas; Under the condition that the current layer rendering context is webgl, the projection conversion related parameters are transmitted into a shader, the raster data is converted pixel by pixel in the shader according to a projection conversion formula, and the corresponding color is taken out from the legend texture according to the numerical value, so as to complete the rendering of the tiff format meteorological data, wherein the tiff format is a bitmap image format.
- 8. A visual rendering device for meteorological data, comprising: the creation module is used for creating map objects and layer instances and initializing the created map objects; The registration module is used for registering various projections on the initialized map object and adding the created layer instance to the map object; The initialization module is used for initializing rendering context for the layer instance added to the map object, initializing a data loader according to the uniform resource locator parameter in the layer instance, and adding the current layer instance into the layer set of the loader object; And the rendering module is used for requesting data and analyzing the data by utilizing the data loader, pushing the analyzed data to the current layer instance, completing data rendering at the layer instance based on various projections on the map object, and presenting the rendering effect on the map object.
- 9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the weather data visualization rendering method of any of claims 1 to 7.
- 10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the weather data visualization rendering method of any of claims 1 to 7.
Description
Meteorological data visual rendering method, device, computer equipment and storage medium Technical Field The application relates to the technical field of meteorological data visualization, in particular to a meteorological data visualization rendering method, a device, computer equipment and a storage medium. Background In the meteorological field, the open source map engine openlayers is an open source project, and the core capability comprises access vector data (geojson, topojson, kml, mvt and other formats) service and raster data service (XYZ, WMS, WMTS and other formats), rendering and displaying with map elements, and basic Web map interaction capability (adding, searching, editing, deleting elements, event interaction and the like). The currently used browser almost 100% realizes the support of WebGL (Web Graphics Library, web graphic library) and Canvas2D (two-dimensional Canvas) drawing technology, and a JavaScript interface is provided by the browser to call the two-dimensional or three-dimensional graphic library for drawing on the Web Canvas. The proj4 projection conversion library is an open source project, and the core capability is to register other geographic projections into the map engine and provide the function of mutually converting longitude and latitude coordinates and registered projection coordinates of international standard codes of a WGS84 coordinate system. The geotiff library is an open source item, the core capability is to acquire TIFF data from a remote place or a local place and efficiently read the data according to a given range, and the method can be applied to common TIFF data and COGeoTiff data, wherein COGeoTiff data is GeoTIFF format data optimized by cloud, and GeoTIFF format refers to raster data storage format of extending geospatial reference information on the basis of TIFF image format. In the related art, the weather data rendering method includes collecting data (storing collected wind field data through an elastic search database), generating a gray data slice (converting the collected wind field data and generating the gray data slice), front-end page rendering (rendering the gray data slice through leaflet-variability plugins and using WebGL to achieve wind field particle effects), including data collection, storage, processing and slicing, rendering the whole flow, focusing on the collection, processing and rendering of the UV wind field data, not all weather data, and using leaflet-variability plugins to achieve final data rendering, not openlayers technology families. The optimization method for large-scale image data visualization rendering comprises R tree space index construction (space division is carried out on image data to be rendered, an R tree index structure is constructed, space query efficiency of the image data is optimized), self-adaptive segmentation model (segmentation (subgraph) is formed by dynamically dividing the image data based on R tree index, segmentation granularity is adjusted according to a view port range and data complexity, rendering load balance is achieved), view port prediction and subgraph loading (user interaction data are collected in real time (such as translation and scaling), the position of the next view port is predicted through a prediction algorithm, corresponding subgraph to be rendered is loaded in advance), client performance analysis and rendering strategies (equipment hardware parameters (such as GPU performance and memory) are obtained, rendering capacity is analyzed, rendering strategies (such as resolution and special effect level) are dynamically selected), off-screen rendering and result rendering are carried out on the subgraph (off-screen rendering is carried out on the subgraph in a background thread, rendering results are synchronized to a main window after user operation is finished, interaction smoothness is ensured), the data visualization scheme in the non-meteorological field does not relate to the use scenes in GIS fields such as projection conversion and map interaction, the situation of data multiplexing is not processed, and the scheme of time interpolation playing of similar data is not expanded to users. However, the weather data rendering method focuses on the acquisition processing and slicing of the UV wind field data, the rendering scheme is leaflet-variability plug-in, the three-dimensional wind field particle animation effect is achieved, and the method does not have rendering capability and support for vector data for data of other elements of weather, such as temperature, precipitation, air pressure, relative humidity, satellite cloud pictures, radar and the like. The optimization method for the large-scale image data visualization rendering emphasizes the rendering of common large-scale data, adopts the WebGL and Canvas2D technical scheme, emphasizes the performance improvement when a large amount of data is rendered, and does not realize the rendering capability of meteoro