A kind of precipitation isohyetal line service creation method easy of integration
Technical field
The invention discloses a kind of precipitation isohyetal line service creation methods easy of integration, belong to Water Conservancy Information field.
Background technique
The automation of the development experience of Water Conservancy Information and digitized process, the rank of wisdom of just gradually marching toward at present
Section.Information technology all plays an important role in the acquisition of water conservancy data, transmission, storage and business development, it may be said that water conservancy
Each stage of Informatization Development be unable to do without the support of information technology.The development of information technology itself is maked rapid progress, GIS, distant
The emerging technologies such as sense, internet, Internet of Things, visualization emerge one after another, and the extensive use of information technology can greatly improve water
Stability, ease for use and the effect of visualization of sharp information system.
The provider of information technology service is generally divided into two kinds of forms of commercial company and open source community, business software is stable,
It is easy-to-use, but economic cost is high, and often provides integrated suite, needs bulk/volume buying;Open source software is free and code discloses,
But software granularity is small, the degree of modularity is low, Integrated Development tool acquires a certain degree of difficulty.Such as isopleth generation technique, the technology exist
It is widely used in Water Information System, especially the isopleth of rainfall data generates.Because rainfall data is the weight of water conservancy data
Component part is wanted, it is very huge to the visualization requirement of the data.There is mentioning for isopleth generation technique generally in GIS software
For, the price of business GIS software is high, and the module will not be provided separately, and open source community also has respective algorithms code, but easily
It is extremely low with property.
Therefore, a kind of generation of free, easy-to-use isopleth and service integration method newly how is developed, so that water conservancy is believed
It ceases system development and the technical problem that isopleth service be urgent need to resolve can be integrated by simple mode in.
Summary of the invention
The problem excessively high, not easy-to-use with cost existing for service integration method is generated for current isopleth, the present invention mentions
Go out a kind of precipitation isohyetal line service creation method easy of integration, using GIS visualization technique, open source software technology, realizes rain
Isopleth visualization and the corresponding Web service for measuring data are integrated.
In order to solve the above technical problems, one technical scheme adopted by the invention is that:
A kind of precipitation isohyetal line service creation method easy of integration, including rainfall data tissue, precipitation isohyetal line service creation and
Precipitation isohyetal line Services Integration, is specifically divided into following steps:
S1, numberical range and geographical coordinate set type according to rainfall data, tissue generate rainfall data input file.
S2, certainty equivalents line generate the parameter needed, and organize to generate parameter configuration files.
S3, interpolating function, rendering function, drafting function and labelling function are successively called, generates precipitation isohyetal line result text
Part.
S4, it is based on Web server release process, data file needed for isopleth will be generated using Web service technology, ginseng
Number file and destination file serviceization are integrated.
Further, the rainfall data file is csv formatted file, including rainfall point coordinate and rainfall value, rainfall
Point coordinate indicates that rainfall value is indicated with z with (x, y).
Further, parameter described in step S2 includes interpolation parameter, rendering parameter, spacing parameter and label parameters,
Spacing parameter is string format, and string value is the spacing size of isopleth.The parameter configuration files include interpolation ginseng
Number configuration file, rendering parameter configuration file and label parameters configuration file;Interpolation parameter configuration file format is vrt format,
Content includes rainfall data input file address, rainfall data coordinate system and rainfall data format;Rendering parameter configuration file lattice
Formula is txt format, and content includes rainfall value and the corresponding rgb color numerical value of rainfall value;Label parameters configuration file format is xml
Format, content include the contents such as geographic coordinate system, dimension style, the type of output file and output address.
Further, the interpolating function in step S3 is the gdal_grid function in the library GDAL, and rendering function is the library GDAL
Gdal_dem function, drafting function are the gdal_contour function in the library GDAL, and labelling function is the library Mapnik
Nik2img.py function;Step S3 is realized especially by following steps:
S31, gdal_grid interpolating function is called, is input parameter with rainfall data file, obtains rainfall contour surface grayscale image,
Rainfall contour surface grayscale image is tiff format.
S32, it calls gdal_dem to render function, is input parameter with rainfall contour surface grayscale image, rendering colour band, obtains rain
Contour surface cromogram is measured, rainfall contour surface cromogram is tiff format.
S33, gdal_contour drafting function is called to obtain using rainfall contour surface grayscale image, contour interval value as parameter
To precipitation isohyetal line polar plot, precipitation isohyetal line polar plot is shp format.
S34, nik2img.py function is called, is input parameter with precipitation isohyetal line polar plot, label parameters configuration file,
The isopleth rendering figure with mark is obtained, isopleth rendering figure is png format.
Further, Web server release process is IIS program in step S4, and Web service technology is ASP.NET Web
API technology, serviceization are integrated using ApiController method.
Following advantage can be obtained by the above technological means:
The present invention provides a kind of precipitation isohyetal line service creation methods easy of integration, being capable of opening in all kinds of Water Information Systems
Free isopleth is integrated in hair and generates service, realizes precipitation isohyetal line effect of visualization.The method of the present invention is visualized using GIS
Technology and open source software technology, method is relatively simple, cost is relatively low, and is easily achieved, and is meeting Water Information System to rain
While measuring the demand that isopleth generates, greatly reduce Water Information System develop the technology of integrated precipitation isohyetal line service at
Sheet and economic cost, are conducive to promote the use of.
Detailed description of the invention
Fig. 1 is the flow chart of the method for the present invention medium value line generation method.
Fig. 2 is the rainfall data input file in the method for the present invention.
Fig. 3 is the interpolation parameter configuration file in the method for the present invention.
Fig. 4 is the rendering parameter configuration file in the method for the present invention.
Fig. 5 is the label parameters configuration file in the method for the present invention.
Fig. 6 is the rainfall contour surface grayscale image of the method for the present invention.
Fig. 7 is the rainfall contour surface cromogram of the method for the present invention.
Fig. 8 is the precipitation isohyetal line polar plot of the method for the present invention.
Fig. 9 is the isopleth rendering figure with mark of the method for the present invention.
Specific embodiment
Technological means of the invention is described in detail with reference to the accompanying drawing, so that advantages and features of the invention can be more
It is easy to be readily appreciated by one skilled in the art, so as to make a clearer definition of the protection scope of the present invention.
The invention proposes a kind of precipitation isohyetal line service creation methods easy of integration, can be realized the life of precipitation isohyetal line
At and Services Integration, including rainfall data tissue, precipitation isohyetal line service creation, precipitation isohyetal line Services Integration are specific to walk
It is rapid as follows:
S1, the numberical range according to rainfall data, geographical coordinate set type, tissue generate the input file of rainfall data;Rainfall
Data file is csv formatted file, including rainfall point coordinate and rainfall value.
S2, certainty equivalents line generate the parameter needed, and tissue generates parameter configuration files.Spacing parameter is that isopleth generates
A required important parameter, is string format, and the value of character string is exactly the spacing size of isopleth;Parameter configuration files packet
Include interpolation parameter configuration file, rendering parameter configuration file and label parameters configuration file, the file of interpolation parameter configuration file
Format is vrt format, and address, rainfall data coordinate system and the rainfall data lattice of rainfall data input file are provided in file
Formula;The file format of rendering parameter configuration file is txt format, is provided with rainfall value and the corresponding RGB color of rainfall value in file
Color numerical value;The file format of label parameters configuration file is xml format, and geographic coordinate system, dimension style, defeated is provided in file
The contents such as type and output address of file out.
S3, interpolating function, rendering function, drafting function and labelling function are successively called, generates precipitation isohyetal line result text
Part;Interpolating function is the gdal_grid function in the library GDAL, and rendering function is the gdal_dem function in the library GDAL, and drafting function is
The gdal_contour function in the library GDAL, labelling function are the nik2img.py function in the library Mapnik;As shown in Figure 1, step S3
It is realized especially by following steps:
S31, gdal_grid interpolating function is called, is input parameter with rainfall data file, obtains rainfall contour surface grayscale image,
Rainfall contour surface grayscale image is tiff format.
S32, it calls gdal_dem to render function, is input parameter with rainfall contour surface grayscale image, rendering colour band, obtains rain
Contour surface cromogram is measured, rainfall contour surface cromogram is tiff format.
S33, gdal_contour drafting function is called to obtain using rainfall contour surface grayscale image, contour interval value as parameter
To precipitation isohyetal line polar plot, precipitation isohyetal line polar plot is shp format.
S34, nik2img.py function is called, is input parameter with precipitation isohyetal line polar plot, label parameters configuration file,
The isopleth rendering figure with mark is obtained, isopleth rendering figure is png format.
S4, it is based on Web server release process, data file needed for isopleth will be generated using Web service technology, ginseng
Number file and destination file serviceization are integrated, and wherein Web server release process is IIS program, and Web service technology is
ASP.NET Web API technology, serviceization are integrated using ApiController method.
In the present embodiment, the numberical range of rainfall data is -180 ~ 180, and geographical coordinate set type is WGS84, (x, y)
Indicate that the coordinate of rainfall point, z indicate rainfall value, the rainfall data input file of formation is as shown in Figure 2.Spacing parameter is " 50 ".
Fig. 3 is interpolation parameter configuration file, and address, rainfall data coordinate system and the rainfall of rainfall data input file are provided in file
The contents such as data format, rainfall data coordinate system select WGS84.Fig. 4 is rendering parameter configuration file, in file respectively to 0,
10,25,50,100,250 these rainfall values set corresponding rgb color numerical value.Fig. 5 is label parameters configuration file, text
The contents such as geographic coordinate system, dimension style, the type of output file and output address are provided in part, coordinate system selects WGS84,
Dimension style includes font, font size, color etc..
Fig. 6 is the rainfall contour surface grayscale image that step S31 is obtained, and Fig. 7 is that the rainfall contour surface that step S32 is obtained is colored
Figure, Fig. 8 are the precipitation isohyetal line polar plots that step S33 is obtained, and Fig. 9 is the isopleth rendering figure that step S34 is obtained.Side of the present invention
Method can obtain clear precipitation isohyetal line file, meet the demand that Water Information System generates precipitation isohyetal line,
Meanwhile the method for the present invention uses open source software technology, cost is relatively low, it is easy to accomplish and promote.
Embodiments of the present invention are explained in detail above in conjunction with attached drawing, but the invention is not limited to above-mentioned
Embodiment within the knowledge of a person skilled in the art can also be before not departing from present inventive concept
It puts and makes a variety of changes.