Summary of the invention
The technical problem to be solved in the present invention provides a kind of map data processing method and device, can be under all proportions chi map to play up speed fast, display effect is good.
For solving the problems of the technologies described above, embodiments of the invention provide a kind of map data processing method, comprising:
Obtain map datum;
Described map datum is divided into two-layer at least;
Ground floor map datum in the described two-layer at least map datum is adopted the storage of raster data form;
Other second layer map datum except described ground floor map datum in the described two-layer at least map datum is adopted the storage of vector data form, perhaps adopt the storage of raster data form and vector data form.
Wherein, the engineer's scale of described ground floor map datum is less than the engineer's scale of described second layer map datum.
Wherein, the described step that adopts raster data form and vector data form to store other second layer map datum except described ground floor map datum in the described two-layer at least map datum comprises:
With the first's The data raster data form storage in the described second layer map datum, the second portion The data vector data form storage except described first data in the described second layer map datum.
Data volume when the data volume when wherein, described first data are played up by the map render engine is played up by engine map greater than described second portion data.
Wherein, said method also comprises:
Adopt the first map render engine module that the described ground floor map datum of raster data form is played up to the display screen of terminal.
Wherein, said method also comprises:
Adopt the second map render engine module that the described second layer map datum of vector data form is played up to the display screen of terminal; Perhaps
Adopt the first map render engine module that first's data of described raster data form are played up to the display screen of terminal, when the second portion data except described first data played up to described second layer map datum, switch to the second map render engine module, and adopt the described second map render engine module that the described second portion data of vector data form are played up to the display screen of terminal.
Embodiments of the invention also provide a kind of map data processing device, comprising:
Obtain module, be used for obtaining map datum;
Divide module, be used for described map datum is divided into two-layer at least;
First memory module is used for the ground floor map datum of described two-layer at least map datum is adopted the storage of raster data form;
Second memory module is used for described two-layer at least map datum other second layer map datum except described ground floor map datum is adopted the storage of vector data form, perhaps adopts the storage of raster data form and vector data form.
Wherein, the engineer's scale of described ground floor map datum is less than the engineer's scale of described second layer map datum.
Wherein, described second memory module specifically is used for described second layer map datum is adopted the storage of vector data form; Perhaps
With the first's The data raster data form storage in the described second layer map datum, the second portion The data vector data form storage except described first data in the described second layer map datum.
Data volume when the data volume when wherein, described first data are played up by the map render engine is played up by engine map greater than described second portion data.
Wherein, said apparatus also comprises:
The first map render engine module is for the display screen of the described ground floor map datum of raster data form being played up to terminal.
Wherein, said apparatus also comprises:
The second map render engine module is for the display screen of the described second layer map datum of vector data form being played up to terminal; Wherein, the described first map render engine module is played up first's data of raster data form to the display screen of terminal, when the second portion data except described first data played up to described second layer map datum, switch to the second map render engine module, and adopt the described second map render engine module that the described second portion data of vector data form are played up to the display screen of terminal.
The beneficial effect of technique scheme of the present invention is as follows:
In the such scheme, by map datum being divided into several layers, and layering storage, can be under all engineer's scales, can be to play up speed faster, realize good map effect, play up key element or to reduce rendering effect and need not to reduce (grade separation, zone such as overhead are arranged) in the many zones of atural object key element and can also use abundant map styles to play up map.
Embodiment
For making the technical problem to be solved in the present invention, technical scheme and advantage clearer, be described in detail below in conjunction with the accompanying drawings and the specific embodiments.
As shown in Figure 1, a kind of map data processing method of embodiments of the invention comprises:
Step 11 obtains map datum;
Step 12 is divided into described map datum two-layer at least;
Step 13 adopts the storage of raster data form with the ground floor map datum in the described two-layer at least map datum;
Step 14 adopts the storage of vector data form with other second layer map datum except described ground floor map datum in the described two-layer at least map datum, perhaps adopts the storage of raster data form and vector data form.
This embodiment of the present invention, by map datum being divided into several layers, and layering storage, can be under all engineer's scales, can be to play up speed faster, realize good map effect, play up key element or to reduce rendering effect and need not to reduce (grade separation, zone such as overhead are arranged) in the many zones of atural object key element and can also use abundant map styles to play up map.
Wherein, in said method, the engineer's scale of described ground floor map datum is less than the engineer's scale of described second layer map datum.
Preferably, in another embodiment of the present invention, above-mentioned steps 14 specifically can comprise:
Step 141 adopts the storage of vector data form with described second layer map datum; Perhaps
Step 142, with the first's The data raster data form storage in the described second layer map datum, the second portion The data vector data form storage except described first data in the described second layer map datum.
Data volume when the data volume when wherein, described first data are played up by the map render engine is played up by engine map greater than described second portion data.
As shown in Figure 3, map datum is divided into multilayer, as is respectively ground floor map datum 31,33, the four layers of map datum 34 of 32, the three layers of map datum of second layer map datum etc.; The map that high-rise data (as above-mentioned ground floor map datum) are used for showing small scale all uses the raster data form; The data of low layer (as above-mentioned the 4th layer of map datum) are used for showing large-scale map, mainly use the vector data form, and mix the raster data form.Wherein, two-layer as map datum being divided into, wherein, have 18 engineer's scales, then can be that 0~11 map is as the ground floor map datum with engineer's scale, this ground floor map datum can be understood as high-rise map datum, and engineer's scale is that 12~17 map is second layer map datum, and this second layer map datum can be understood as the low layer map datum; Certainly map datum can also be divided into three layers, four layers, five layers ...; As with engineer's scale be 0~5 map as the ground floor map datum, engineer's scale is that 6~11 map is second layer map datum, engineer's scale is that 12~15 map is the 3rd layer of map datum, engineer's scale is that 16~17 map is the 3rd layer of map datum etc.; The engineer's scale of the map datum of the high level here is less than the engineer's scale of the map datum of low layer.
As shown in Figure 4, for multilayer map datum shown in Figure 3 in when storage, carry out the structural representation that stacked mode is stored, be the effect that four layer data among Fig. 3 are superimposed; Wherein, the data of the raster data form in the embodiments of the invention are a pictures in essence, the picture of PNG or jpeg format, but picture itself has coordinate information, explains corresponding which coordinate range of map that this picture shows; Coordinate information is represented by picture name usually, such as the picture of called after X_Y_Z.png, is illustrated under Z the engineer's scale, and coordinate is X, the map of Y.
And the data recording of the vector data form data layout of object location and shape thereof truly generally is divided into point-like (market, mansion), wire (road), planar (water body, greenery patches) three types; Use coordinate to represent position and the shape of atural object, as point data be expressed as POINT (X, Y), the wire data be expressed as LINESTRING (Point1, Point2...) etc., but in the store vector data formatted data, the general binary format that adopts is to reach the purpose of efficient storage.
In another embodiment of the present invention, comprise can also comprising on the basis of above-mentioned steps 11-14:
Step 15 adopts the first map render engine module that the described ground floor map datum of raster data form is played up to the display screen of terminal.
Step 16 adopts the second map render engine module that the described second layer map datum of vector data form is played up to the display screen of terminal; Perhaps adopt the first map render engine module that first's data of described raster data form are played up to the display screen of terminal, when the second portion data except described first data played up to described second layer map datum, switch to the second map render engine module, and adopt the described second map render engine module that the described second portion data of vector data form are played up to the display screen of terminal.Wherein, this terminal can be navigation terminal, cell phone apparatus or general-purpose built-in type equipment (as WinCE equipment).
As shown in Figure 5, a specific implementation example of realizing for above-mentioned steps 15 and step 16:
Adopt the mode of piecemeal to organize the low layer map datum of a map datum, be about to a map form and be divided into 12 block map datas, wherein, system is when playing up, analyze piece 2, comprised complicated highway sections such as viaduct in the map of 5,6 representatives, so the data volume of this part when playing up is bigger, therefore, piece 2,5,6 adopt the data of raster data form to compile, other piece is (as piece 0,3,4,7,8,9,10 and 11) mainly use the compiling of vector data form, other graticule mesh are used the data compilation of vector data form.
When the map datum of these piecemeals is played up to the display screen of terminal, need the first map render engine module with the map datum of raster data form on the plotting equipment (as the video card on the PC, the operating system drawing interface), template (the Show Styles of map according to the map, color as the road demonstration, width etc.), drawing is to display device; On plotting equipment, paint on the display device according to the map by template with the map datum of vector data form for the second map render engine module; Wherein, as following shown in Figure 5, the second map render engine module is after playing up piece 0,1, when playing up piece 2, because the data layout of piece 2 is raster data forms, therefore, need switch to the first map render engine module and play up, same, after piece 2 has been played up, when carrying out the playing up of piece 3 again, switch to the second map render engine module again and play up;
Render engine generally uses artist's render mode, i.e. layering drawing, the background colour of painting earlier on plotting equipment, the background of painting again (water body, greenery patches etc.), the road of painting then, POI point (market, hospital etc.), drawing mark literal at last.
The above embodiment of the present invention, map data structure design at a plurality of engineer's scale mixing raster data formatted data layers and vector data formatted data layer, and chi compiles the map datum that mixes raster data form and vector data form in same ratio, and at a plurality of engineer's scale mixing raster data formatted data layers and vector data formatted data layer, and the compound map data structure that in same engineer's scale, compiles mixing raster data form and vector data form, and on the different proportion chi, dynamically switch the map render engine that uses grid or vector data form according to type of data format, and in the same ratio chi, dynamically switch the map render engine that uses raster data form or vector data form according to type of data format; And on the different proportion chi, dynamically switch use raster data form or vector data form according to type of data format, and in the same ratio chi, dynamically switching the compound map render engine that uses raster data form or vector data form according to type of data format; Can be under all engineer's scales, in all geographic areas, can be to play up speed faster, realize good map effect, play up key element or to reduce rendering effect and need not to reduce, (grade separation, zone such as overhead to be arranged) in the many zones of atural object key element and can also use abundant map styles to play up map.Simultaneously, data layout of the present invention does not need to satisfy performance requirement by taking a large amount of storage spaces, can satisfy the requirement that shows map on mobile embedded type equipment, in-vehicle navigation apparatus and common PC equipment fast.
As shown in Figure 6, embodiments of the invention also provide a kind of map data processing device, comprising:
Obtain module 61, be used for obtaining map datum;
Divide module 62, be used for described map datum is divided into two-layer at least;
First memory module 63 is used for the ground floor map datum of described two-layer at least map datum is adopted the storage of raster data form;
Second memory module 64 is used for described two-layer at least map datum other second layer map datum except described ground floor map datum is adopted the storage of vector data form, perhaps adopts the storage of raster data form and vector data form.
Wherein, the engineer's scale of described ground floor map datum is less than the engineer's scale of described second layer map datum.
Wherein, described second memory module specifically is used for described second layer map datum is adopted the storage of vector data form; Perhaps
With the first's The data raster data form storage in the described second layer map datum, the second portion The data vector data form storage except described first data in the described second layer map datum.
Data volume when the data volume when wherein, described first data are played up by the map render engine is played up by engine map greater than described second portion data.
Wherein, said apparatus can also comprise:
The first map render engine module 65 is for the display screen of the described ground floor map datum of raster data form being played up to terminal.
Wherein, said apparatus can also comprise:
The second map render engine module 66 is for the display screen of the described second layer map datum of vector data form being played up to terminal; Wherein, the described first map render engine module is played up first's data of raster data form to the display screen of terminal, when the second portion data except described first data played up to described second layer map datum, switch to the second map render engine module, and adopt the described second map render engine module that the described second portion data of vector data form are played up to the display screen of terminal.
Need to prove: this device embodiment of the present invention is corresponding with said method embodiment, and therefore, all implementations among the said method embodiment all are applicable to also can reach identical technique effect among the embodiment of this device, does not repeat them here.
The above is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from principle of the present invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.