Disclosure of Invention
The invention aims to at least solve the technical problems in the prior art, and particularly provides a method for organizing and managing space-time map tile data, which is characterized by comprising the following steps of:
s1, during tile generation, specifically comprising:
s11, acquiring a map initial image, and generating or setting map parameter information, wherein the parameter information comprises tile levels, columns, rows, shooting time, a spatial range, a scale, a slicing specification, a color mode, a slicing service instance number and version information in a pyramid model, and the spatial range is a coordinate sequence formed by an abscissa X and an ordinate Y of the space-time map;
s12, correcting the image range of each layer in the pyramid model according to the tile level and the scale of each layer;
s13, creating a database index for the parameter information, wherein the database index comprises a tile level, shooting time and a space range;
s14, storing tile data, including tile levels, shooting time and space ranges, and establishing mirror image versions of corresponding time nodes;
s15, providing an access interface;
when the method further comprises the step S2 and the tile data are updated, the method specifically comprises the following steps:
s21, reading shooting time;
s22, searching the time node mirror image version at the previous moment;
s23, generating a time node mirror image version of the range to be updated at the current moment according to the space range and the tile level;
and S24, updating the data, generating and storing the time node mirror image version at the current time.
The method is based on the timeliness of the tiles, increases the data information, the spatial range and the version information, creatively creates the index according to the tile levels, the shooting time and the spatial range, improves the execution efficiency when data reading and inquiring are carried out through parameter setting, enables the graph cutting work during creating or updating to be faster on the basis of accuracy, supports the mainstream tile international standard format, and does not need to be updated in a specific row mode, a specific column mode and a specific layer mode.
In a preferred embodiment of the present invention, the time-space map is corrected in step S2, when there is a difference in spatial ranges of a plurality of tile data sets, the tile levels to which the different images belong in the pyramid model are determined according to the scales of the different images, the spatial range of the image is divided into one or more tiles according to the tile specification of the level in which the spatial range belongs, and if an area where a boundary line of the spatial range is located does not include a complete tile, the tile edge of the tile level in the latest time phase is extended and expanded into the complete tile. The method ensures the logical relationship among all tile levels in the pyramid tile model, enables adjacent tile elements to be in smooth transition, effectively solves the problem that boundary gaps are formed at the edges due to simple combination among tile levels before correction, does not need to start from the same initial coordinate during correction, and can be selected randomly according to needs.
In a preferred embodiment of the present invention, in step S2, the range of the tile data at the time of updating is a set spatial range, that is, a closed region in which a coordinate sequence formed by an arbitrary abscissa X and an arbitrary ordinate Y of the space-time map is formed as each inflection point of the update range and is connected in sequence. The flexibility of updating the tile data is realized, the whole map does not need to be updated during updating, only the updating needs to be performed in a local range, namely, the initial coordinate of the range needing to be updated each time is not limited to the same coordinate, and a large amount of redundant data is reduced. And the abscissa X and the ordinate Y are international universal geographic coordinates, so that the tile data support a mainstream tile tool, and the defect that row and column data of tiles need to be filled independently according to a specific rule is overcome.
In a preferred embodiment of the present invention, the range of the tile data at the time of updating is set to one or more spatial ranges, and the inflection points of each spatial range are connected in a straight line in turn to form one or more polygon areas and update them at the same time. The method allows simultaneous updating when the updating areas are different closed ranges, and the straight line connection can make the updating areas smaller and reduce redundant data.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
In the description of the present invention, unless otherwise specified and limited, it is to be noted that the terms "mounted," "connected," and "connected" are to be interpreted broadly, and may be, for example, a mechanical connection or an electrical connection, a communication between two elements, a direct connection, or an indirect connection via an intermediate medium, and specific meanings of the terms may be understood by those skilled in the art according to specific situations.
The invention provides an organization management method of space-time map tile data, which comprises the steps of obtaining a map initial image, and generating or setting map parameter information as shown in figure 1, wherein the parameter information comprises tile levels, initial row numbers, initial column numbers, end row numbers, end column numbers, shooting time, a space range, a scale, a slice specification, a color mode, a slice service instance number and version information in a pyramid model, and the space range is a coordinate sequence formed by an abscissa X and an ordinate Y of a space-time map.
Map cutting mode: this embodiment takes the form of a cartoonish projection, which intercepts the earth between latitudes (about 85.0511 ° S, about 85.0511 ° N) so that the projected plan map is of equal horizontal and vertical lengths. Taking the upper left corner of the ink card support projection map as a tile coordinate system starting point, taking the left direction as an X axis, and enabling the X axis to be overlapped with the north latitude 85.0511 degrees and to be in the left direction; the downward direction is the Y-axis, which coincides with the east longitude 180 (also the west longitude 180) and is directed downward. The tile coordinate minimum level is 0 level, and the plane map is a tile with 256 × 256 pixels. Under a certain tile Level, the X axis and the Y axis of a tile coordinate respectively have 2^ Level tile numbers, and the total number of the tiles on the tile map is 2^ Level X2 ^ Level. A map is composed of 4^ n squares of 256 × 256 pixels, n being an integer not less than 0, at the tile level. For example: the 0 th level is 4^0, i.e. the hierarchical map is represented by a 256 × 256 tile. The nth level world map should be composed of (4^ n) 4 tiles 256 × 256, that is, each tile of a tile level (n-1 level) on the map is equally divided into 4 blocks of 256 × 256 pictures.
TABLE 1 Tile version metadata Table
TABLE 2 Tile level metadata Table
As shown in fig. 2, when a plurality of tile data sets have different map spatial ranges, the tile levels of the different images in the pyramid model are determined according to the scales of the different images, the spatial range of the image is divided into one or more tiles according to the tile specification of the level where the spatial range is located, and if the area where the boundary connecting line of the spatial range is located does not include a complete tile, the tile edge of the tile level at the latest time phase is extended and expanded into the complete tile. As shown in fig. 2, an image A, B, C of a certain time phase with a scale being a, B, and c respectively corresponds to corresponding picture levels 1, 2, and 3, an image D of another time phase with a scale being B, the images B and D belong to the same picture level, the images B and D are integrated, a space range is corrected as a polygonal closed area shown in fig. 3, the space range formed by the polygonal area is divided into one or more tiles according to the tile specification of the level 2, since the image D is shot after the image B, when correcting, the tiles where the space range boundaries are connected are extended and expanded as the edges of the tiles of the image D tile level are extended and expanded into complete tiles, and the corrected range is shown as the shaded portion in fig. 3. The levels 1 and 3 image a and image C are then corrected accordingly, thereby eliminating the technical problem of gaps between the tile datasets at certain levels. And after the correction is finished, taking the tile level, the shooting time and the space range as database indexes, finally storing tile data, including the tile level, the shooting time and the space range, and establishing a mirror image version of corresponding time. The history tile metadata base adopts an SQLite database, one service corresponds to the SQLite database, the SQLite database is stored in a service tile folder root directory, and an access interface is provided.
FIG. 4 illustrates a tile data update process, which includes: reading the shooting time of the latest loaded picture or manually setting the time of generating a new map; searching a time node mirror image version at the previous moment, wherein the time node mirror image version is the mirror image version which is stored in a database and is closest to the current updating time, and comprises an image level and version information; generating a time node mirror image version of which the range needs to be replaced at the current moment according to the space range and the tile level; updating data, and storing the mirror version of the time node at the current time, which is specifically: finding a time node mirror image version at the previous moment according to the index, and setting a space range needing to be updated in the version, as shown in fig. 5, namely, a coordinate sequence formed by an abscissa X and an ordinate Y of the space-time map is taken as each inflection point of the updating range and is sequentially connected to form two polygonal areas E, F, wherein E is formed by sequentially connecting an inflection point 4, an inflection point 5, an inflection point 6, an inflection point 7 and an inflection point 8 to form a closed area, and F is formed by sequentially connecting an inflection point 9, an inflection point 10 and an inflection point 11 to form a closed area; the horizontal coordinate and the vertical coordinate comprise a pixel coordinate, a longitude and latitude coordinate and a tile coordinate, and a conversion formula between the coordinates is as follows:
longitude and latitude coordinates (lng, lat) to tile coordinates (tileX, tileY):
wherein n is a tile level and is an integer not less than 0;
longitude and latitude coordinates (lng, lat) to pixel coordinates (pixelX, pixelY):
wherein n is a tile level and is an integer not less than 0;
pixel coordinates (pixelX, pixelY) of a tile (tile ) are translated into longitude and latitude coordinates (lng, lat):
wherein n is a tile level and is an integer not less than 0;
generating a time node mirror image version needing to be updated at the current moment from the current moment, a tile hierarchy and a corresponding space range in an image needing to be updated, replacing a space range needing to be updated in a time node mirror image version at the previous moment, namely one or more closed areas, by using the space range in the version, correcting, namely replacing tiles on contour connecting lines of all updating areas with tiles of the time node mirror image version needing to be updated at the current moment, updating the changing areas layer by layer, adding version information, and simultaneously generating and storing a latest mirror image version comprising the tile hierarchy, the space range and shooting time.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.