Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art.
Therefore, the invention provides the WebGIS-based coal mine underground mine map visualization method, and the WebGIS-based coal mine underground mine map visualization method has the advantages of convenience in use, low implementation cost, improvement of user experience and application range.
The coal mine underground mine map visualization method based on the WebGIS comprises the following steps: step 1, identifying the boundary of the underground mine drawing: carrying out identification extraction on the effective area of the mine map; step 2, grid space coordinate calculation: performing space calculation on the effective area of the mine map obtained in the step 1, and outputting a coordinate set of a to-be-raster slice; step 3, grid slicing of mineral pictures: performing grid slicing on the mine drawing according to the grid slice coordinate set obtained in the step 2, and storing data into a data server; step 4, releasing raster data: transparentizing the grid slice data acquired in the step 3, and publishing the grid slice data as Web visualization data; step 5, WebGIS positioning and loading: and positioning a browser visualization area, and loading appropriate raster data from the data server for visualization.
The invention has the advantages that the defects that the existing mine drawing visualization scheme needs additional desktop end software and has high implementation cost are overcome, the technical support is provided for popularization, and the specific advantages are as follows: desktop end software or browser plug-ins do not need to be additionally installed, and the use is convenient; the AutoCAD software is not involved, so that a large amount of authorization cost does not need to be considered, and the implementation cost is low; nginx is adopted as raster data to be issued, so that the visual browsing speed is increased, and the user experience is improved; by adopting the WebGIS technology, no special requirements are required for the version and the model of the browser at the user end, and the application range is widened.
Further specifically, in the above technical solution, in the step 2, the specific steps are as follows:
step 2.1, obtaining an effective area and a zooming level of the mine drawing;
2.2, calculating the starting and ending serial numbers of the grids: sequentially and circularly calculating the starting sequence number and the ending sequence number of the grids under each zooming level according to the effective area of the mine map;
and 2.3, calculating grid space boundary coordinates: and sequentially calculating the grid space boundary coordinates corresponding to each sequence number according to the hierarchy and the starting and ending sequence numbers.
More specifically, in the above technical solution, the transparentizing in the raster data distribution in the step 4 is to remove a portion of the raster data having a pixel value of 0x000000 to form transparentized raster data.
Further specifically, in the above technical solution, the issue in the step 4 is a static issue of Nginx.
Further specifically, in the foregoing technical solution, the tile coding specification adopted by the WebGIS positioning and loading in the step 5 is google XYZ protocol, where the protocol specifies that Z represents a zoom level, an origin of XY is at an upper left corner, X is from left to right, and Y is from top to bottom.
Further specifically, in the above technical solution, in step 2.2, the formula for calculating the grid start and end sequence numbers is as follows:
wherein tileX represents an X serial number corresponding to the coding table; lng represents the longitude (coordinate value) of the mine drawing valid area; level represents a zoom Level.
Wherein tileY represents a Y serial number corresponding to the coding table; ln represents a natural logarithmic function in mathematical operation; tan represents a tangent function in a mathematical operation; lat represents the latitude of the effective area of the mine map; sec represents a secant function in mathematical operations; level represents a zoom Level.
Further specifically, in the above technical solution, in step 2.3, the equation for calculating the boundary coordinate of the single grid space is as follows:
wherein Lng represents X-direction coordinates of the raster data; tileX represents the sequence number in the X direction in the grid coding table; pixelX represents the pixel value in the X direction of the raster data, and since the invention adopts the 256 × 256 specification, it is 256 here; level represents a zoom Level.
Wherein Lat represents grid data Y-direction coordinates; arctan represents an arctangent function in mathematical operation; sinh represents a hyperbolic sine function in mathematical operation; tileY represents the serial number in the Y direction in the grid coding table; pixelY represents the pixel value in the Y direction of the raster data, which is 256 because the invention adopts the 256 × 256 specification; level represents a zoom Level.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects solved by the present invention more clearly apparent, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1 and fig. 2, the coal mine underground mine map visualization method based on the WebGIS of the invention comprises the following steps:
step 1, identifying the boundary of the underground mine drawing: the effective area of the mine map is identified and extracted, so that the operation speed of the subsequent steps is improved; it should be noted that the mine drawings herein are generic names of mine drawings, and do not refer to a certain kind of drawings, according to a coal mine management system, each professional department in a coal mine is responsible for maintaining drawings of various aspects of a mine, for example, a geodetic department is responsible for maintaining a mine excavation project plan, an electromechanical department is responsible for a communication substation deployment drawing, and a general defense department is responsible for a ventilation equipment deployment drawing, and in a project implementation process, each professional department is required to provide well-classified drawings. Manually distinguishing the mine drawings into an effective area and an invalid area, wherein if a client feels that a certain part in the drawings needs to be put into a web for display, the part is the effective area; the drawing is just like a canvas in a drawing tool, and it is often found in an application scene that a drawing maintainer can store a waste area in the drawing, so that the drawing simultaneously has the latest information (namely, a service effective area) and the waste information. The method comprises the following steps of identifying and extracting the effective area of the mine map by means of software, identifying the effective area of the mine map by a user through selecting an area function in the software, and specifically operating the following steps: when a user selects the left lower corner and the right upper corner of the drawing, software can form a rectangular area, and at the moment, the software can read the coordinate information of the area in the CAD, so that extraction is realized.
Step 2, grid space coordinate calculation: performing spatial calculation on the effective area of the mine map obtained in the step 1, and outputting a coordinate set of the slice to be gridded; the grid slice is divided into grid data and slices, the grid data is a data form which divides the space into regular grids, each grid is called a cell, and each cell is endowed with a corresponding attribute value to represent the entity; the position of each cell (pixel) is defined by its row and column number, the represented entity position is implicit in the grid row and column position, each datum in the data organization represents a non-aggregate attribute of a ground object or phenomenon or a pointer to its attribute; the method can be generally understood that one picture has spatial geographic attributes, so that raster data is formed; generally, the actual spatial geographic distance of a mineral picture is as high as about 20 kilometers, if all information of the 20 kilometers is stored into one raster data, a browser cannot browse due to too large data volume, and in addition, only information in a sight line range is concerned in terms of operation habits of people, so that data storage by only one raster data is meaningless, the original raster data needs to be sliced into N small data blocks, the browser can be loaded at the moment, meanwhile, the WebGIS method can realize that only raster data in the sight line range of people are loaded, the data display speed is accelerated, and the user experience is improved. In the step 2, the concrete steps are as follows:
step 2.1, obtaining an effective area and a zooming level of the mine drawing; it should be noted that the scaling hierarchy is manually specified by software.
2.2, calculating the starting and ending serial numbers of the grids: and sequentially and circularly calculating the starting sequence number and the ending sequence number of the grids under each scaling level according to the effective area of the mine map.
And 2.3, calculating grid space boundary coordinates: and sequentially calculating the grid space boundary coordinates corresponding to each sequence number according to the hierarchy and the starting and ending sequence numbers.
For the description of the grid space coordinate calculation algorithm (slicing algorithm), in civil map applications (such as a Baidu map and a Gaode map), the most intuitive experience is that the map is enlarged and reduced, after the map is enlarged, more detailed geographic information such as streets and stores can be seen, after the map is reduced and reduced, the originally seen streets and stores cannot be seen, but a larger area can be seen, and in the process of using the map, the map is perceived to be enlarged and reduced into a whole, which is generated according to the image pyramid theory. The image pyramid theory is to perform level segmentation on raster data. At the highest level (zoom ═ 0), the information required is minimal, and only the most important macroscopic information needs to be retained, so that the image can be represented by a picture of 256 × 256 pixels; at the next level (zoom ═ 1), the amount of information increases, and is represented by one picture of 512 × 512 pixels; by analogy, the lower the level, the higher the pixel, the next level of pixels is 4 times that of the current level; this forms a pyramid coordinate system from the highest level down to the lowest level, as shown in fig. 3. As can be seen from the above theory, the grid coordinate calculation method requires scaling level parameters, and requires calculating coordinate values of each grid data at each scaling level. Furthermore, there are two parameters that are critical in this theory: (1) the pixel value of each piece of raster data and the data carried by the pixel values with different specifications are different, which can cause the difference of coordinate calculation formulas, and the specification of 256 multiplied by 256 adopted by the invention is different; (2) the encoding mode of the raster data, the encoding modes of different specifications determine the origin of calculation and the direction of XY coordinates, thus leading to the difference of coordinate calculation formulas, the invention adopts the encoding mode of Google XYZ, which is defined as: z denotes a zoom level, Z ═ zoom; the origin of XY is in the upper left corner, X is from left to right and Y is from top to bottom. See fig. 4 for a coordinate encoding case with a scaling level equal to 2.
The specific implementation process of the grid space coordinate calculation algorithm (slicing algorithm) is as follows: according to manual configuration, an effective area of a mine drawing and a scaling level for displaying raster data can be obtained; and calculating the grid starting sequence number and the grid ending sequence number corresponding to the effective area of the mine map at a certain level. Referring to fig. 5, for example, with the scaling level equal to 2, the coordinates of the top left corner and the bottom right corner of the mine map are substituted into the following formula to obtain the corresponding start and end sequence numbers in the encoding table. Referring to fig. 5, top left corner of the mine map corresponds to tileX-1 and tileY-1; the lower right corner corresponds to tileX-3 and tileY-3.
Wherein tileX represents an X serial number corresponding to the coding table; lng represents the longitude (coordinate value) of the mine drawing valid area; level represents the zoom Level, which in this example is 2. The X sequence number is the result of the formula (1), and if the introduced lng parameter is the starting position, the X sequence number is the starting sequence number; if the incoming lng parameter is the end position, then the X sequence number is the end sequence number. From equation (1)See that the larger the zoom Level, i.e. 2LevelThe larger the value of (2) is, the larger the score of the final formula (1) is, and the formula (1) can be used to determine the number of the sequence numbers at a specific zoom level, so that the corresponding records can be found in the coding table according to the sequence numbers.
Wherein tileY represents a Y serial number corresponding to the coding table; ln represents a natural logarithmic function in mathematical operation; tan represents a tangent function in a mathematical operation; lat represents the latitude (coordinate value) of the effective area of the mine map; sec represents a secant function in mathematical operations; level represents the zoom Level, which in this example is 2. The Y sequence number is the result of formula (2), if the transmitted parameter is the starting position, the Y sequence number is the starting sequence number; if the incoming parameter is an end position, then the Y sequence number is an end sequence number. From the equation (2), the larger the zoom Level, i.e. 2LevelThe larger the value of (2), the larger the score of the final formula (2), and the formula (2) can be used to determine the number of the sequence numbers at a specific zoom level, and the corresponding record can be found in the coding table according to the sequence numbers.
After calculation by the grid start and end sequence number algorithm formulas (1) and (2), the grid start and end sequence numbers corresponding to the effective area can be obtained, and then the coordinate value corresponding to each grid in the range needs to be calculated. Substituting tileX and tileY in the grid coding table by the following formula to obtain corresponding coordinate values.
Wherein Lng represents X-direction coordinates of the raster data; tileX represents the sequence number in the X direction in the grid coding table; pixelX represents the pixel value in the X direction of the raster data, and since the invention adopts the 256 × 256 specification, it is 256 here; level represents a zoom Level. From the equation (3), the larger the zoom Level, i.e. 2LevelThe larger the numerical value of (A), the smaller the final figure of the formula (3), generallyThe X-direction coordinate value under a specific zoom level can be obtained through the formula (3), and the corresponding coordinate position can be found in the mine map according to the X-direction coordinate value.
Wherein Lat represents grid data Y-direction coordinates; arctan represents an arctangent function in mathematical operation; sinh represents a hyperbolic sine function in mathematical operation; tileY represents the serial number in the Y direction in the grid coding table;
pixelY represents the pixel value in the Y direction of the raster data, which is 256 because the invention adopts the 256 × 256 specification; level represents a zoom Level. From equation (4), the larger the zoom Level, i.e., 2LevelThe larger the value of (2), the smaller the final score of the formula (4), the Y-direction coordinate value at a specific zoom level can be obtained through the formula (4), and the corresponding coordinate position can be found in the mine map according to the Y-direction coordinate value.
After calculation through single grid space boundary coordinate formulas (3) and (4), coordinates of the upper left corner and the lower right corner corresponding to each piece of grid data can be obtained, a pile of coordinate sets are formed, and then the CAD graph is sliced into small grid data blocks for file storage according to the coordinate data.
Step 3, grid slicing of mineral pictures: and (3) performing grid slicing on the mine drawing according to the grid slice coordinate set obtained in the step 2, and storing data into a data server.
Step 4, releasing raster data: and (4) transparentizing the raster slice data acquired in the step (3) and publishing the data as Web visual data. In the transparency in the raster data distribution, the transparency is formed by removing a portion of the raster data having a pixel value of 0x 000000. The issue is Nginx static issue.
Step 5, WebGIS positioning and loading: and positioning a browser visualization area, and loading appropriate raster data from the data server for visualization. WebGIS issues and applies geographic spatial data through the Internet to achieve sharing and interoperation of the spatial data, is a new technology for expanding and perfecting the GIS by utilizing the Internet technology, and is mainly used for issuing the spatial data, inquiring and retrieving the space, serving a space model, organizing Web resources and the like. The tile coding specification adopted by WebGIS positioning and loading is Google XYZ protocol, and the protocol specifies that Z represents a scaling level; the origin of XY is in the upper left corner, X is from left to right and Y is from top to bottom.
2 in the above formulas (1) to (4)LevelIs a standard formula, see fig. 4 and 5, the zoom Level is equal to 2, i.e. Level is 2, according to standard formula 2LevelTo obtain 224 (the X-direction sequence numbers in figures 4 and 5 are 0-3, and 4 lattices are formed in total).
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art should be considered to be within the technical scope of the present invention, and the technical solutions and the inventive concepts thereof according to the present invention are equivalent to or changed within the technical scope of the present invention.