A kind of multi-source map data processing method
Technical field
The invention belongs to the technical field of graphic processing data in Geographic Information System, particularly a kind of multi-source map data processing method.
Background technology
Enforcement along with State Grid Corporation of China " SG186 " engineering, expedited the emergence of power grid GIS platform, it be structured in " SG186 " engineering unified platform within, realize structured management and the graphic exhibition of power network resources, the Enterprise SOA of take provides the enterprise-level electrical network spatial Information Service platform of grid graph and Analysis Service as all kinds of service application.Within " SG186 " unified platform (comprising enterprise portal, data center, application integration and exchanges data etc.), build the electrical network spatial Information Service platform of opening, act on service-oriented architectural framework standard, the application of To enterprises level, realize the unified structureization management of all kinds of power network resources, for all kinds of service application provide electric network information and Analysis Service; Integrated by with each service application, effectively promotes the fine-grained management level of electrical network.
Because the integrated scope of power grid GIS platform first stage has only included integrated with unified platform, production management system, for marketing management system, communication resource management system, dispatching management information system, emergency commading system, vehicle dispatch system, Electric Power Network Planning system, and the integrated of real-time system etc. not yet realized.For this reason, how fast above-mentioned each business application system of realization based on power grid GIS platform is integrated, to be a problem that assistant officer is to be solved, wherein how the business figure of each business application system carries out a seamless integration difficult problem especially with the geographic map that power grid GIS platform provides.
Summary of the invention
The object of the invention is to for the deficiencies in the prior art, a kind of multi-source map data processing method is provided.
The present invention solves its technical matters and takes following technical scheme to realize:
A multi-source map data processing method, comprises that step is as follows:
(1) by splicing parameter, form such map requests path; Comprise token, body of a map or chart, multi-source map parameter, dimension of picture and picture format parameter value;
(2) calculate the ground resolution that comprises section or striograph, in conjunction with dimension of picture parameter, determine the geographic range coordinate that finally returns to map, and add the business figure generating after processing to multi-source map set;
(3) travel through and merge all pictures in the set of multi-source map picture total business figure picture for finally returning.
And the concrete grammar step of described step (2) is:
If 1. do not comprise section or the static map such as image in the multi-source map parameter of request, the geographic coordinate scope that only need can calculate final business figure by the scope coordinate that obtains and dimension of picture parameter,
A, Parametric Representation is as follows:
Body of a map or chart bbox:x axle lower left corner coordinate figure xmin, y axle lower left corner coordinate figure ymin, x axle upper right corner coordinate figure xmax, y axle upper right corner coordinate figure ymax;
Dimension of picture size: picture width width, picture height height;
Geographical length Δ x=xmax-xmin;
Geographical width Delta y=ymax-ymin;
B, when drawing frame to zoom in or out current map, for the body of a map or chart of finally returning, there is individual default logic, take that to change larger value in geographical length Δ x, geographical width Delta y be variation standard, in conjunction with drawing center point coordinate and the dimension of picture parameter of frame to calculate the geographic distance that this direction changes, and calculate the geographic distance that changes less edge direction;
C, the geographical width Delta y of the geographical length Δ x> of take is example, x axle lower left corner coordinate figure xmin, x axle upper right corner coordinate figure xmax will can not change,
Geographical width Delta yT=Δ x* (height/width) after variation
Y axle lower left corner coordinate figure yminT-=after variation (Δ yT/2-Δ y);
Y axle upper right corner coordinate figure ymaxT+=after variation (Δ yT/2-Δ y);
Therefore, the geographic range coordinate figure of the body of a map or chart bbox finally returning is x axle lower left corner coordinate figure xmin, the y axle lower left corner coordinate figure yminT after variation, x axle upper right corner coordinate figure xmax, the y axle upper right corner coordinate figure ymaxT after variation;
If 2. comprise the static maps such as section or image in the multi-source map parameter of request, due to section or striograph be static images, there is fixing engineer's scale level attribute, stretching dislocation to section or image in order to prevent from merging map, the geographic coordinate scope that need to calculate in 1. with step is difference to some extent;
A, in conjunction with section or striograph information, determines final ground resolution lastDPI
Initial ground resolution startDPI=Δ x/width;
Final ground resolution lastDPI is that resolution of the ground resolution under section or striograph all proportions chi and initial ground resolution startDPI difference minimum;
B, correlation parameter is expressed as follows
Draw the x axial coordinate x of frame central point point(central point, the y axial coordinate y of central point):
The x axial coordinate x=xmin+ (xmax-xmin)/2 of central point;
The y axial coordinate y=ymin+ (ymax-ymin)/2 of central point);
With central point, calculate scope coordinate:
X axle lower left corner coordinate figure xminT=x-lastDPI*width/2 after variation;
Y axle lower left corner coordinate figure yminT=y-lastDPI*length/2 after variation;
X axle upper right corner coordinate figure xmaxT=x+lastDPI*width/2 after variation;
Y axle upper right corner coordinate figure ymaxT=y+lastDPI*length/2 after variation;
The geographic range value of the body of a map or chart bbox finally returning is the x axle lower left corner coordinate figure xminT after changing, the y axle lower left corner coordinate figure yminT after variation, the x axle upper right corner coordinate figure xmaxT after variation, the y axle upper right corner coordinate figure ymaxT after variation.
And the concrete grammar step of described step (3) is:
1. process the static images such as section or image, be fused to bottom geographical background figure and add in the set of multi-source map picture;
A, can determine the information such as section under corresponding proportion chi or striograph and ranks thereof number according to final ground resolution lastDPI, body of a map or chart bbox parameter value;
B, adopts multithreading to obtain relevant all sections or striograph from section or striograph server, and adds in the set of multi-source map picture;
C, splices section or striograph in interim picture set, forms a spliced map;
D, shears spliced map according to final geographic range, and final figure is added in the set of multi-source map picture;
2. by correlation parameter and other Dynamic Graph servers, obtain the map picture of final geographic range, dimension of picture, picture format etc., be put in the set of multi-source map picture; Concrete steps are:
A, according to final geographic range, dimension of picture, figure layer id, picture format etc., is spliced into the services request path that statement sexual state shifts REST standard;
B, shifts REST request path by statement sexual state and obtains Dynamic Graph, and add in the set of multi-source map picture;
C, or parameter is spliced into the services request path of the open geospatial information OGC of alliance standard, by calling the open geospatial information OGC of alliance generation figure service acquisition Dynamic Graph and adding in the set of multi-source map picture;
3., the set of traversal multi-source map picture, and to merge all pictures be a pictures, the map picture finally returning;
A, similar with section or striograph splicing logic, according to the wide and high establishment painting canvas of picture;
B, travels through final multi-source map picture set, and each picture is plotted in painting canvas, obtains the business figure finally returning.
And the concrete steps of described step (3) the 1. concrete grammar step of middle B step are:
I, definition record loads the state value (variable outside thread) of section or image, and each loads successfully section or striograph number accumulative total, revises the state value outside thread in thread, and to guarantee after all section loadeds, main thread is down carried out again;
II, section of every traversal or striograph all obtain thread of startup from server, and are put in interim picture set, in order to splicing.
And the concrete steps of described step (3) the 1. concrete grammar step of middle C step are:
I, calculates the width and the height that splice rear picture
The width of width=((row number of the row of last section number-first section)+1) * single section;
The width of * single section highly=((line number of the line number of last section-first section)+1);
II, take the spliced map width that obtains and be highly parameter, establishment internal memory picture painting canvas;
III, traversal section or striograph are also plotted to every figure on internal memory painting canvas, and record the section in the upper left corner and the lower right corner or the geographic coordinate values of striograph, in order to shearing.
Advantage of the present invention and good effect are
1, realized the integrated of multi-source geographic map or business diagram data.
2, isolation bottom space data structure, directly carries out fusion treatment to various figure.
3, realized the accurate fusion of static map (section, image etc.) with Dynamic Graph (joining the business figure of calling graph service acquisition by biography).
4, effect has met the demand of service application project completely.
Embodiment
Below the embodiment of the present invention is further described, following examples are descriptive, are not determinate, can not limit protection scope of the present invention with this.
A multi-source map data processing method, comprises that step is as follows:
(1) by splicing parameter, form such map requests path; Comprise the parameter values such as token token, body of a map or chart bbox, multi-source map parameter m aps, dimension of picture size, picture format format;
(2) calculate the ground resolution (if comprising the static maps such as section or image) that comprises section or striograph, in conjunction with dimension of picture parameter, determine the geographic range coordinate that finally returns to map, and the business figure generating after processing adds multi-source map set to;
Concrete steps are:
If 1. do not comprise section or the static map such as image in the multi-source map parameter of request, the geographic coordinate scope that only need can calculate final business figure by the scope coordinate that obtains and dimension of picture parameter,
A, Parametric Representation is as follows
Body of a map or chart bbox:x axle lower left corner coordinate figure xmin, y axle lower left corner coordinate figure ymin, x axle upper right corner coordinate figure xmax, y axle upper right corner coordinate figure ymax;
Dimension of picture size: picture width width, picture height height;
Geographical length Δ x=xmax-xmin;
Geographical width Delta y=ymax-ymin;
B, when drawing frame to zoom in or out current map, for the body of a map or chart of finally returning, there is individual default logic, take that to change larger value in geographical length Δ x, geographical width Delta y be variation standard, in conjunction with drawing center point coordinate and the dimension of picture parameter of frame to calculate the geographic distance that this direction changes, and calculate the geographic distance that changes less edge direction;
C, below and follow-up use-case all to take the geographical width Delta y of geographical length Δ x> be example (x direction of principal axis changes greatly):
X axle lower left corner coordinate figure xmin, x axle upper right corner coordinate figure xmax will can not change, and geographical width Delta yT=Δ x* (height/width) after changing
Y axle lower left corner coordinate figure yminT-=after variation (Δ yT/2-Δ y);
Y axle upper right corner coordinate figure ymaxT+=after variation (Δ yT/2-Δ y);
Therefore, the geographic range coordinate figure of the body of a map or chart bbox finally returning is x axle lower left corner coordinate figure xmin, the y axle lower left corner coordinate figure yminT after variation, x axle upper right corner coordinate figure xmax, the y axle upper right corner coordinate figure ymaxT after variation;
If 2. comprise the static maps such as section or image in the multi-source map parameter of request, due to section or striograph be static images, there is fixing engineer's scale level attribute, stretching dislocation to section or image in order to prevent from merging map, the geographic coordinate scope that need to calculate in 1. with step is difference to some extent;
A, in conjunction with section or striograph information, determines final ground resolution lastDPI
Initial ground resolution startDPI=Δ x/width;
Final ground resolution lastDPI for the ground resolution under section or striograph all proportions chi with that resolution of initial ground resolution startDPI difference minimum (because the lucky probability equating of two values is less, also be the crucial part of geographic range fine setting herein, otherwise will occur the problems such as stretching of section or image);
B, correlation parameter is expressed as follows:
Draw the x axial coordinate x of frame central point point(central point, the y axial coordinate y of central point):
The x axial coordinate x=xmin+ (xmax-xmin)/2 of central point;
The y axial coordinate y=ymin+ (ymax-ymin)/2 of central point);
With central point, calculate scope coordinate:
X axle lower left corner coordinate figure xminT=x-lastDPI*width/2 after variation;
Y axle lower left corner coordinate figure yminT=y-lastDPI*length/2 after variation;
X axle upper right corner coordinate figure xmaxT=x+lastDPI*width/2 after variation;
Y axle upper right corner coordinate figure ymaxT=y+lastDPI*length/2 after variation;
The geographic range value of the body of a map or chart bbox finally returning is the x axle lower left corner coordinate figure xminT after changing, the y axle lower left corner coordinate figure yminT after variation, the x axle upper right corner coordinate figure xmaxT after variation, the y axle upper right corner coordinate figure ymaxT after variation;
(3) travel through and merge all pictures in the set of multi-source map picture total business figure picture for finally returning; Concrete steps are:
1., process the static images such as section or image, be fused to bottom geographical background figure and add in the set of multi-source map picture;
A, can determine the information such as section under corresponding proportion chi or striograph and ranks thereof number according to final ground resolution lastDPI, body of a map or chart bbox parameter value.
B, adopts multithreading to obtain relevant all sections or striograph from section or striograph server, and adds in the set of multi-source map picture; Concrete steps are:
I, definition record loads the state value (variable outside thread) of section or image, and each loads successfully section or striograph number accumulative total, revises the state value outside thread in thread, and to guarantee after all section loadeds, main thread is down carried out again;
II, section of every traversal or striograph all obtain thread of startup from server, and are put in interim picture set, in order to splicing;
C, splices section or striograph in interim picture set, forms a spliced map;
I, calculates the width and the height that splice rear picture
The width of width=((row number of the row of last section number-first section)+1) single section of *;
The width of the single section of * highly=((line number of the line number of last section-first section)+1);
II, take the spliced map width that obtains and be highly parameter, establishment internal memory picture painting canvas;
III, traversal section or striograph are also plotted to every figure on internal memory painting canvas, and record the section in the upper left corner and the lower right corner or the geographic coordinate values of striograph, in order to shearing;
D, shears spliced map according to final geographic range, and final figure is added in the set of multi-source map picture;
2., by correlation parameter and other Dynamic Graph servers, obtain the map picture of final geographic range, dimension of picture, picture format etc., be put in the set of multi-source map picture; Concrete steps are:
A, according to final geographic range, dimension of picture, figure layer id, picture format etc., is spliced into the services request path that statement sexual state shifts REST standard;
B, shifts REST request path by statement sexual state and obtains Dynamic Graph, and add in the set of multi-source map picture;
C, or parameter is spliced into the services request path of the open geospatial information OGC of alliance standard, by calling the open geospatial information OGC of alliance generation figure service acquisition Dynamic Graph and adding in the set of multi-source map picture;
3., the set of traversal multi-source map picture, and to merge all pictures be a pictures, the map picture finally returning;
A, similar with section or striograph splicing logic, according to the wide and high establishment painting canvas of picture;
B, travels through final multi-source map picture set, and each picture is plotted in painting canvas, obtains the business figure finally returning.