Meteorological emergency oriented rapid drawing method and device
Technical Field
The invention relates to the technical field of weather mapping, in particular to a weather emergency fast mapping method and a device thereof.
Background
The traditional weather data drawing is to load various weather element data and map data resources by adopting a software tool of a desktop version in a man-machine interaction mode, and then manually configure graph coincidence and style to finally produce drawing pictures. The method has high drawing refinement degree, but needs to consume a large amount of manpower and time, has the problems of slow drawing period, high drawing cost and the like, and is difficult to meet the requirements of rapid response of emergency events, important activity guarantee, important historical event duplication and other scenes for rapid drawing.
The existing rapid drawing of meteorological data generally adopts a BS architecture, uses a canvas technology based on a browser, adopts a mode similar to screen capturing, converts two-dimensional map and various meteorological element data displayed on the browser into pictures with fixed size, fixed map scale and format for output, reduces manual interaction processing compared with the traditional mode, improves drawing efficiency, but has the problems of single drawing result, solidification, difficult dynamic interaction adjustment, difficult guarantee of drawing effect and the like, and is difficult to meet the requirements of sudden meteorological disaster events on the rapid drawing and flexibility.
The existing weather data drawing adopts a mode of generating pictures in a static mode by canvas, and if the drawing range size is determined on a map window page, drawing parameters cannot be dynamically adjusted, and only pictures with fixed space ranges and scale can be output.
Disclosure of Invention
Object of the invention
The invention aims to provide a rapid drawing method and device for a meteorological emergency, which can be adjusted and drawn in time according to actual requirements when facing the meteorological emergency.
(II) technical scheme
In order to solve the above problems, a first aspect of the present invention provides a weather emergency oriented rapid mapping method, which includes the following steps:
The step of dividing the grid points, namely automatically acquiring and analyzing the weather grid point data, determining the spatial resolution, the initial longitude and the initial latitude of a two-dimensional matrix of the weather grid point data, and dividing the area corresponding to the weather grid point data into a plurality of grid points according to the initial longitude and the initial latitude;
Generating a weather grid point space layer, namely taking each grid point in the weather grid point data as a space grid center point, generating a weather grid point space layer, wherein the grid is square, the side length is the resolution of the grid point data, and the weather grid point space layer consists of a plurality of space grids corresponding to the grid points one by one;
constructing a map window, namely constructing a map window with a length L and a width W and used for visually loading the weather lattice point space layer and the three-dimensional topographic layer, and fusing and rendering the weather lattice point space layer and the three-dimensional topographic layer;
Creating a drawing template according to a preset rule, and creating a preview container for displaying all object contents in the map window according to a set value of the drawing template;
generating a drawing preview window, namely generating a preview window according to the drawing template, adjusting the angle, the height, the direction, the map level and the scale of display content in the preview window according to the weather emergency scene requirement, and performing dynamic adjustment and visual preview;
And outputting a drawing result, namely confirming the final content in the preview window and outputting the final drawing result.
Furthermore, in the weather emergency oriented rapid drawing method
The four-to-longitude and latitude calculation formula of the lattice point Z ij in the lattice point dividing step is as follows:
Minloni=lon+(i-1)×r
Maxloni=lon+i×r
Minlatj=lat+j×r
Maxlatj=lat+(j-1)×r
Wherein Min loni is the minimum longitude of the grid point Z ij, max loni is the maximum longitude of the grid point Z ij, min latj is the minimum latitude of the grid point Z ij, max latj is the maximum latitude of the grid point Z ij, i is the grid point Z ij grid point row number i, j is the grid point Z ij grid point column number j, r is the spatial resolution of the weather grid point data two-dimensional matrix, lon is the starting longitude, and lat is the starting latitude.
Furthermore, in the weather emergency oriented rapid drawing method
In the step of generating the weather lattice point space layer, the lattice points are consistent with the space grids in size, the four-to-longitude and latitude of the lattice points in the step of dividing the lattice points are corrected, and a calculation formula after correction is as follows:
RE-Minloni=lon+(i-1)×r+r/2
RE-Maxloni=lon+i×r+r/2
RE-Minlatj=lat+j×r+r/2
RE-Maxlatj=lat+(j-1)×r+r/2
Where RE-Min loni is the minimum longitude of corrected lattice point Z ij, RE-Max loni is the maximum longitude of corrected lattice point Z ij, RE-Min latj is the minimum latitude of corrected lattice point Z ij, RE-Max latj is the maximum latitude of corrected lattice point Z ij.
Furthermore, in the weather emergency oriented rapid drawing method
In the step of generating the weather lattice point space layer, the weather lattice point space layer is generated by using a GIS technology, and the specific steps are as follows:
Creating a space data set, wherein the space data set comprises a lattice index number field, a longitude field, a latitude field and a lattice data field;
Traversing the weather lattice point data according to the starting longitude and the starting latitude;
after 1 ten thousand weather lattice point data are read, storing the read weather lattice point data into the lattice point data field in the space data set;
a spatial index is created for the spatial dataset.
Furthermore, in the weather emergency oriented rapid drawing method
In the map form construction step, the weather lattice diagram layer and the three-dimensional topographic map layer are visually loaded by utilizing a WebGL technology and a geographic information technology, and the weather lattice diagram layer is displayed above the three-dimensional topographic map layer and is sequentially rendered and loaded from bottom to top.
Furthermore, in the weather emergency oriented rapid drawing method
In the step of creating the drawing template, the preset rules comprise a drawing size, a drawing scale, a drawing unit, a longitude and latitude net and a compass, and are displayed in the drawing template;
acquiring pixel coordinates of the upper left corner and the lower right corner of the preview container, converting the pixel coordinates and longitude and latitude of the weather lattice point data, and converting the pixel coordinates into three-dimensional geographic coordinates, wherein the method comprises the following steps of:
x_geo=a×col+b×row+a×0.5+b×0.5+c
y_geo=d×col+e×row+d×0.5+e×0.5+f
wherein x_geo is a column coordinate of the three-dimensional geographic coordinate, x_geo is a row coordinate of the three-dimensional geographic coordinate, col is a column coordinate of the pixel coordinate, row is a row coordinate of the pixel coordinate, a, b, c, d, e and f are geographic conversion parameters.
The second aspect of the invention provides a weather data rapid drawing device, which comprises the following modules:
The grid dividing module is used for automatically acquiring and analyzing the weather grid data, determining the spatial resolution, the initial longitude and the initial latitude of the weather grid data two-dimensional matrix, and dividing the area corresponding to the weather grid data into a plurality of grid points according to the initial longitude and the initial latitude;
the weather grid point space layer generating module is used for generating a weather grid point space layer by taking each grid point in the weather grid point data as a space grid center point, wherein the grid is square, the side length is the resolution of the grid point data, and the weather grid point space layer consists of a plurality of space grids corresponding to the grid points one by one;
The map window construction module is used for constructing a map window with the length L and the width W and visually loading the weather lattice point space layer and the three-dimensional topographic layer, and fusing and rendering the weather lattice point space layer and the three-dimensional topographic layer;
the drawing template creating module is used for creating a drawing template according to a preset rule and creating a preview container for displaying all object contents in the map window according to a set value of the drawing template;
the drawing preview window generation module is used for generating a preview window according to the drawing template, adjusting the angle, the height, the direction, the map level and the scale of the display content in the preview window according to the weather emergency scene requirement, and performing dynamic adjustment and visual preview;
and the output drawing result module is used for confirming the final content in the preview window and outputting a final drawing result.
By analyzing the weather lattice point data and fusing and rendering the weather lattice point data and the three-dimensional topographic data, the weather lattice point data and the three-dimensional topographic data are displayed in the preview container, dynamic adjustment and visual preview can be carried out according to actual demands, and contents such as display level, scale, height, pitch angle and the like of a map can be dynamically adjusted according to actual scene demands of weather emergencies in the preview window, drawing achievements with different scales and different spatial ranges can be output under the determined drawing template conditions, and re-drawing is not needed, so that the quick drawing efficiency for the weather emergencies is greatly improved, the demands of the weather emergencies on efficient drawing are solved, and the drawing efficiency is greatly improved.
Drawings
FIG. 1 is a schematic flow chart of an embodiment of the present invention;
FIG. 2 is a schematic diagram of the final drawing result of the embodiment of the present invention;
Fig. 3 is a block diagram of an embodiment of the present invention.
Detailed Description
The objects, technical solutions and advantages of the present invention will become more apparent by the following detailed description of the present invention with reference to the accompanying drawings. It should be understood that the description is only illustrative and is not intended to limit the scope of the invention. In addition, in the following description, descriptions of well-known structures and techniques are omitted so as not to unnecessarily obscure the present invention.
The embodiments of the present invention will be described below with reference to the accompanying drawings.
Referring to fig. 1, an embodiment provided by the present invention includes the steps of:
The step of dividing the grid points, namely automatically acquiring and analyzing the weather grid point data, such as NC or Grib data, determining the spatial resolution, the initial longitude and the initial latitude of a two-dimensional matrix of the weather grid point data, and dividing the area corresponding to the weather grid point data into a plurality of grid points according to the initial longitude and the initial latitude;
the four-to-latitude calculation formula of the lattice point Z ij is as follows:
Minloni=lon+(i-1)×r
Maxloni=lon+i×r
Minlatj=lat+j×r
Maxlatj=lat+(j-1)×r
Where Min loni is the minimum longitude of grid point Z ij, max loni is the maximum longitude of grid point Z ij, min latj is the minimum latitude of grid point Z ij, max latj is the maximum latitude of grid point Z ij, i is the grid point Z ij grid point row number i, j is the grid point Z ij grid point column number j, r is the spatial resolution of the weather grid point data two-dimensional matrix, lon is the starting longitude, and lat is the starting latitude.
Generating a weather grid point space layer, namely taking each grid point in the weather grid point data as a space grid center point, generating a weather grid point space layer, wherein the grid is square, the side length is the resolution of the grid point data, and the weather grid point space layer consists of a plurality of space grids corresponding to the grid points one by one;
Each grid point is at the center point of the corresponding space grid, and each grid point is consistent with the size of the space grid, so that in order to make the center of the grid point be at the upper left corner point of the space grid, all grid points need to be offset by r/2 from the upper left corner, and a corrected four-to-longitude and latitude calculation formula is as follows:
RE-Minloni=lon+(i-1)×r+r/2
RE-Maxloni=lon+i×r+r/2
RE-Minlatj=lat+j×r+r/2
RE-Maxlatj=lat+(j-1)×r+r/2
Where RE-Min loni is the minimum longitude of corrected lattice point Z ij, RE-Max loni is the maximum longitude of corrected lattice point Z ij, RE-Min latj is the minimum latitude of corrected lattice point Z ij, RE-Max latj is the maximum latitude of corrected lattice point Z ij.
In the step of generating the weather lattice point space layer, the weather lattice point space layer is generated by using a GIS technology, and the specific steps are as follows:
Creating a space data set, wherein the space data set comprises a lattice index number field, a longitude field, a latitude field and a lattice data field;
Traversing the weather lattice point data according to the starting longitude and the starting latitude;
after 1 ten thousand weather lattice point data are read, storing the read weather lattice point data into the lattice point data field in the space data set;
a spatial index is created for the spatial dataset.
Constructing a map window, namely constructing a map window with a length L and a width W and used for visually loading the weather lattice map layer and the three-dimensional topographic map layer, fusing and rendering the weather lattice map layer and the three-dimensional topographic map layer;
and visually loading the weather lattice diagram layer and the three-dimensional topographic map layer by using a WebGL technology and a geographic information technology, wherein the weather lattice diagram layer is displayed above the three-dimensional topographic map layer, and rendering and loading are sequentially carried out from bottom to top.
Creating a drawing template according to a preset rule, and creating a preview container for displaying all object contents in the map window according to a set value of the drawing template, wherein the preset rule comprises a drawing size, a drawing scale, a drawing unit, a longitude and latitude net and a compass, and the drawing template is displayed;
acquiring pixel coordinates of the upper left corner and the lower right corner of the preview container, converting the pixel coordinates and longitude and latitude of the weather lattice point data, and converting the pixel coordinates into three-dimensional geographic coordinates, wherein the method comprises the following steps of:
x_geo=a×col+b×row+a×0.5+b×0.5+c
y_geo=d×col+e×row+d×0.5+e×0.5+f
wherein x_geo is a column coordinate of the three-dimensional geographic coordinate, x_geo is a row coordinate of the three-dimensional geographic coordinate, col is a column coordinate of the pixel coordinate, row is a row coordinate of the pixel coordinate, a, b, c, d, e and f are geographic conversion parameters.
After the coordinate transformation, a three-dimensional geographic coordinate range of the preview container that can be displayed is calculated, thereby forming a dynamically interactable preview view.
Generating a drawing preview window, namely generating a preview window according to the drawing template, adjusting the angle, the height, the direction, the map level and the scale of display content in the preview window according to the weather emergency scene requirement, and performing dynamic adjustment and visual preview;
and outputting a drawing result, namely confirming the final content in the preview window and outputting the final drawing result, as shown in fig. 2.
Referring to fig. 3, the invention also provides a weather data rapid drawing device, which comprises the following modules:
The grid dividing module is used for automatically acquiring and analyzing the weather grid data, determining the spatial resolution, the initial longitude and the initial latitude of the weather grid data two-dimensional matrix, and dividing the area corresponding to the weather grid data into a plurality of grid points according to the initial longitude and the initial latitude;
the weather grid point space layer generating module is used for generating a weather grid point space layer by taking each grid point in the weather grid point data as a space grid center point, wherein the grid is square, the side length is the resolution of the grid point data, and the weather grid point space layer consists of a plurality of space grids corresponding to the grid points one by one;
The map window construction module is used for constructing a map window with the length L and the width W and visually loading the weather lattice point space layer and the three-dimensional topographic layer, and fusing and rendering the weather lattice point space layer and the three-dimensional topographic layer;
the drawing template creating module is used for creating a drawing template according to a preset rule and creating a preview container for displaying all object contents in the map window according to a set value of the drawing template;
the drawing preview window generation module is used for generating a preview window according to the drawing template, adjusting the angle, the height, the direction, the map level and the scale of the display content in the preview window according to the weather emergency scene requirement, and performing dynamic adjustment and visual preview;
and the output drawing result module is used for confirming the final content in the preview window and outputting a final drawing result.
It is to be understood that the above-described embodiments of the present invention are merely illustrative of or explanation of the principles of the present invention and are in no way limiting of the invention. Accordingly, any modification, equivalent replacement, improvement, etc. made without departing from the spirit and scope of the present invention should be included in the scope of the present invention. Furthermore, the appended claims are intended to cover all such changes and modifications that fall within the scope and boundary of the appended claims, or equivalents of such scope and boundary.