The content of the invention
The problem of present invention is solved is to provide a kind of map-indication method, can be using the arbitrfary point on screen as current parking stall
Position, and can quickly redefine the screen for respectively wanting vegetarian refreshments on navigation map after current parking stall position is changed and sit
Mark, the computing resource saved in guider.
To solve the above problems, the embodiments of the invention provide a kind of map-indication method, including:Obtain map basic point
Screen coordinate and map reference;Determine the anglec of rotation of map;The anglec of rotation and map scale coefficient based on the map are true
Determine transformation parameter;Determine the coordinate offset parameter of map reference of the map reference relative to map basic point of map object;It is based on
The screen coordinate of the map basic point, the coordinate offset parameter and the transformation parameter sit the map of the map object
Mark is converted into the screen coordinate of corresponding map object;Screen coordinate based on map object is shown in screen comprising describedly
The map of figure object.
Alternatively, the anglec of rotation and map scale coefficient based on the map determine that transformation parameter includes:Calculate
The sine value and cosine value of the anglec of rotation;First change is determined according to the ratio of the sine value and the map scale coefficient
Change parameter;Second transformation parameter is determined according to the ratio of the cosine value and the map scale coefficient.
Alternatively, the map reference of the map reference of the map object and the map basic point all include latitude coordinate and
Longitude coordinate;The coordinate offset parameter bag of the map reference of the map reference relative to map basic point for determining map object
Include:Determined according to the longitude coordinate of the longitude coordinate of the map reference of the map basic point and the map reference of the map object
Abscissa offset in the coordinate offset parameter;According to the latitude coordinate of the map reference of the map basic point and described
The latitude coordinate of the map reference of figure object determines the ordinate offset in the coordinate offset parameter.
Alternatively, the screen coordinate of the screen coordinate of the map basic point and the map object all includes abscissa and vertical
Coordinate;Screen coordinate based on the map basic point, the coordinate offset parameter and the transformation parameter are by the map pair
The screen coordinate that the map reference of elephant is converted into corresponding map object includes:
According to the abscissa of the screen coordinate of the map basic point, the abscissa offset and second transformation parameter
Product and the ordinate offset and first transformation parameter product by the map reference of the map object
Abscissa is converted into the abscissa of the screen coordinate of the map object;
According to the ordinate of the screen coordinate of the map basic point, the ordinate offset and second transformation parameter
Product and the abscissa offset and first transformation parameter product by the map reference of the map object
Ordinate is converted into the ordinate of the screen coordinate of the map object.
Alternatively, the map is navigation map.
The embodiment of the present invention additionally provides a kind of device of control map denotation, including:Coordinate acquiring unit, for obtaining
The screen coordinate and map reference of map basic point;Angle determination unit, the anglec of rotation for determining map;Transformation parameter is determined
Unit, the anglec of rotation of map and map scale coefficient for being determined based on the angle determination unit determine transformation parameter;
Offset parameter determining unit, for determining the map reference of map object relative to the map base that the coordinate acquiring unit is obtained
The coordinate offset parameter of the map reference of point;Coordinate transformation unit, for the map base obtained based on the coordinate acquiring unit
What the coordinate offset parameter and the transformation parameter unit that the screen coordinate of point, the offset parameter determining unit are determined were determined
The map reference of the map object is converted into the screen coordinate of corresponding map object by transformation parameter;Drawing unit, is used for
The screen coordinate of the map object determined based on the coordinate transformation unit shows the ground for including the map object in screen
Figure.
Alternatively, the transformation parameter determining unit includes:Computing unit, the sine value for determining the anglec of rotation
And cosine value;First transformation parameter determining unit, for being determined according to the ratio of the sine value and the map scale coefficient
First transformation parameter;Second transformation parameter determining unit, for the ratio according to the cosine value and the map scale coefficient
Determine the second transformation parameter.
Alternatively, the map reference of the map reference of the map object and the map basic point all include latitude coordinate and
Longitude coordinate;The offset parameter determining unit includes:First offset parameter determining unit, for according to the map basic point
The longitude coordinate of the map reference of the longitude coordinate of map reference and the map object is determined in the coordinate offset parameter
Abscissa offset;Second offset parameter determining unit, for the map reference according to the map basic point latitude coordinate and
The latitude coordinate of the map reference of the map object determines the ordinate offset in the coordinate offset parameter.
Alternatively, the screen coordinate of the screen coordinate of the map basic point and the map object all includes abscissa and vertical
Coordinate;The coordinate transformation unit includes:
First converting unit, abscissa, the abscissa offset for the screen coordinate according to the map basic point
Will be described with the product and the ordinate offset of second transformation parameter and the product of first transformation parameter
The abscissa of the map reference of figure object is converted into the abscissa of the screen coordinate of the map object;
Second converting unit, ordinate, the ordinate offset for the screen coordinate according to the map basic point
Will be described with the product and the ordinate offset of second transformation parameter and the product of first transformation parameter
The ordinate of the map reference of figure object is converted into the ordinate of the screen coordinate of the map object.
Alternatively, the map is navigation map.
The embodiment of the present invention additionally provides a kind of guider, includes the device of above-mentioned control map denotation.
Compared with prior art, technical solution of the present invention has the advantages that:
The map-indication method that the present invention is provided, can using the arbitrfary point on screen as the position of current parking stall, and
Change behind current parking stall position, the map reference of screen coordinate, map object based on former parking stall (map basic point) is relative to ground
The conversion ginseng that the coordinate offset parameter of the map reference of figure basic point and the according to the map anglec of rotation and map scale coefficient are determined
The map reference of the map object is converted into corresponding screen coordinate by number, so as to quickly repaint navigation map,
The computing resource saved in guider.
Embodiment
For problem of the prior art, inventor shows by research there is provided a kind of map-indication method and control map
The device shown, can be using the arbitrfary point on screen as the position of current parking stall, and after current parking stall position is changed, based on original
The coordinate offset of the screen coordinate of parking stall (map basic point), map reference of the map reference relative to map basic point of map object
The transformation parameter that parameter and the according to the map anglec of rotation and map scale coefficient are determined is by the map reference of the map object
Corresponding screen coordinate is converted into, so as to quickly repaint navigation map, the computing resource saved in guider.
It is understandable to enable the above objects, features and advantages of the present invention to become apparent, below in conjunction with the accompanying drawings to the present invention
Embodiment be described in detail.
Detail is elaborated in the following description to fully understand the present invention.But the present invention can with it is a variety of not
It is same as other manner described here to implement, those skilled in the art can do class in the case of without prejudice to intension of the present invention
Like popularization.Therefore the present invention is not limited by following public embodiment.
As shown in Fig. 2 a kind of schematic flow sheet of the embodiment of map-indication method of the invention.Ginseng
Fig. 2 is examined, the map-indication method includes:
Step S1:Obtain the screen coordinate and map reference of map basic point;
Step S2:Determine the anglec of rotation of map;
Step S3:The anglec of rotation and map scale coefficient based on the map determine transformation parameter;
Step S4:Determine the coordinate offset parameter of map reference of the map reference relative to map basic point of map object;
Step S5:Screen coordinate based on the map basic point, the coordinate offset parameter and the transformation parameter will
The map reference of the map object is converted into the screen coordinate of corresponding map object;
Step S6:Screen coordinate based on map object shows the map for including the map object in screen.
The embodiment of map-indication method described in Fig. 2 is described with reference to specific embodiment.With reference to reference
A kind of design sketch of the specific embodiment of map-indication method of the invention shown in Fig. 3 a and Fig. 3 b.It should be noted that this
In embodiment, the map is navigation map, and the navigation object is automobile.
Specifically, as described in step S1, the screen coordinate and map reference of map basic point are obtained.
In the present embodiment, as shown in Figure 3 a be that point-rendering navigates centered on position 2 of the current parking stall on screen
The design sketch of map, map basic point in addition to many is used as in the navigation map 1 using the position 2 where current parking stall
Bar road and multiple points of interest (such as point of interest A).
Those skilled in the art know that the position 2 (i.e. map basic point) has two coordinate values, respectively screen coordinate
And map reference.Wherein, as shown in Figure 3 a, screen coordinate system is that, using the upper left corner as origin O, the X axis right side is positive direction, Y-axis
It is positive direction down;Map coordinates system (not shown) is that, using the lower left corner as origin, it is square in positive direction, Y-axis that the X axis right side, which is,
To.
Generally in the map data base of guider, the coordinate (i.e. map reference) of vegetarian refreshments is each wanted on navigation map
It is to determine, it is assumed that the map reference of the position 2 (i.e. map basic point) includes latitude coordinate and longitude coordinate, generally navigation dress
Put needs and the gps coordinate (including latitude and longitude coordinates) got by gps receiver is converted into Gauss plane coordinate, to realize
In correct matching of the gps coordinate in navigation map, the present embodiment, longitude coordinate and latitude coordinate correspond respectively to abscissa
MapBaseX and ordinate mapBaseY.When need by navigation map include on screen when, it is necessary to by navigation map each
The map reference of vegetarian refreshments is wanted to be converted into screen coordinate, the way that those skilled in the art commonly use is " phase described in the prior art
Like than " basic thought map reference is converted into screen coordinate, therefore not to repeat here.
In the present embodiment, it is assumed that the screen upper left corner (i.e. origin O) coordinate is (left, top), bottom right angular coordinate is
(right, bottom), may thereby determine that the size of screen:A length of (right-left), a width of (bottom-top) square
Shape.Therefore, the screen coordinate of the position 2 (i.e. map basic point) can be determined by two ways:
1) assume that the coordinate of the position 2 and the distance in the upper left corner are dx and dy, then the screen coordinate of map basic point is:
ScrBaseX (abscissa)=left+dx, scrBaseY (ordinate)=top+dy.
2) assume that the coordinate of the position 2 and the distance in the lower right corner are dx ' and dy ', then the screen coordinate of map basic point is:
ScrBaseX (abscissa)=right-dx ', scrBaseY (ordinate)=bottom-dy.
Those skilled in the art can be arbitrarily to select any of the above-described kind of mode to determine the screen coordinate of the map basic point.
As described in step S2, the anglec of rotation of map is determined.
Those skilled in the art know, generally on the screen of guider, the direction of current parking stall (position 2 as described)
Straight up always, the position that so can observe current parking stall in order to user.But, the side of each bar road in navigation way
To then not necessarily straight up, therefore, when driving, if the direction of road is not straight up where current parking stall
When, then need to rotate map so that the direction of road where current parking stall straight up so that all on navigation map
Vegetarian refreshments is wanted all to produce an anglec of rotation.The occurrence of the anglec of rotation be that road for being gone to according to current parking stall and
The angle between road is previously located to determine.
As described in step S3, the anglec of rotation and map scale coefficient based on the map determine transformation parameter.
In the present embodiment, this step includes:
First, the sine value and cosine value of the anglec of rotation are calculated.
Assuming that the anglec of rotation is a, then the sine value of the anglec of rotation is:Sin (a)=m_sinAngle;It is described
The cosine value of the anglec of rotation is:Cos (a)=m_cosAngle.Further, if the proportionality coefficient of current map is scalVal.
Then, the first transformation parameter is determined according to the ratio of the sine value and the map scale coefficient.
Specifically, first transformation parameter is:M_sinDivScale=m_sinAngle/scalVal.
Second transformation parameter is determined according to the ratio of the cosine value and the map scale coefficient.
Specifically, second transformation parameter is:M_cosDivScale=m_cosAngle/scalVal.
Above-mentioned first transformation parameter and the second transformation parameter subsequently will carry out making when map reference is changed with screen coordinate
With.
As described in step S4, the coordinate offset of map reference of the map reference relative to map basic point of map object is determined
Parameter.
Specifically, the premise of this step implementation is:Position where user changes current parking stall on screen, as will be described
Current parking stall has been moved to the position 2 ' in Fig. 3 b from the position 2 in Fig. 3 a, and guider can be directly obtained the position 2 '
Screen coordinate.
Further, as shown in Figure 3 b, it is thus necessary to determine that other in the navigation map 1 ' each want the screen coordinate of vegetarian refreshments.
In this step, it is first determined map reference of the map reference relative to map basic point of map object (including each wants vegetarian refreshments)
Coordinate offset parameter.For example, by taking the point of interest B in the navigation map 1 ' as an example, it is assumed that the point of interest B (map object)
Map reference include longitude coordinate and latitude coordinate, correspond respectively to abscissa mapX and ordinate mapY.
This step is specifically included:
1) according to the longitude coordinate of the map reference of the map basic point and the longitude of the map reference of the map object
Coordinate determines the abscissa offset in the coordinate offset parameter.
Specifically, wherein it is mapBaseX, institute that the longitude coordinate of the map reference of the map basic point, which corresponds to abscissa,
The longitude coordinate for stating the map reference of map object corresponds to abscissa for mapX, therefore, the horizontal stroke in the coordinate offset parameter
Coordinate offset amount is offsetX=mapX-mapBaseX.
2) according to the latitude coordinate of the map reference of the map basic point and the latitude of the map reference of the map object
Coordinate determines the ordinate offset in the coordinate offset parameter.
Specifically, wherein it is mapBaseY, institute that the latitude coordinate of the map reference of the map basic point, which corresponds to ordinate,
The latitude coordinate for stating the map reference of map object corresponds to ordinate for mapY, therefore, vertical in the coordinate offset parameter
Coordinate offset amount is offsetY=mapY-mapBaseY.
As described in step S5, the screen coordinate based on the map basic point, the coordinate offset parameter and the conversion
The map reference of the map object is converted into the screen coordinate of corresponding map object by parameter.
In the present embodiment, this step is specifically included:
1) joined according to the abscissa of the screen coordinate of the map basic point, the abscissa offset and the described second conversion
The product of several products and the ordinate offset and first transformation parameter is by the map reference of the map object
Abscissa be converted into the map object screen coordinate abscissa.
Specifically, wherein the abscissa of the screen coordinate of the map basic point is scrBaseX, the abscissa offset
It is that offsetY, first transformation parameter are m_sinDivScale, described second for offsetX, the ordinate offset
Transformation parameter is m_cosDivScale, therefore, and the abscissa of the screen coordinate of the map object is:
ScrX=scrBaseX+ (offsetX*m_cosDivScale-offsetY*m_sinDivScale).
2) joined according to the ordinate of the screen coordinate of the map basic point, the ordinate offset and the described second conversion
The product of several products and the abscissa offset and first transformation parameter is by the map reference of the map object
Ordinate be converted into the map object screen coordinate ordinate.
Specifically, wherein the ordinate of the screen coordinate of the map basic point is scrBaseY, the abscissa offset
It is that offsetY, first transformation parameter are m_sinDivScale, described second for offsetX, the ordinate offset
Transformation parameter is m_cosDivScale, therefore, and the ordinate of the screen coordinate of the map object is:
ScrY=scrBaseY- (offsetY*m_cosDivScale+offsetX*m_sinDivScale).
Above-mentioned is that by taking the point of interest B in the navigation map 1 ' as an example, the map reference of the point of interest B is converted into screen
Map reference can also be converted into screen coordinate by curtain coordinate, analogously, other each map objects according to the above method.
As described in step S6, the screen coordinate based on map object shows the ground for including the map object in screen
Figure.
Specifically, as shown in Figure 3 b, the navigation for current parking stall position with the position 2 ' is shown on screen
Fig. 1 '.Each in the navigation map 1 ' wants the screen coordinate of vegetarian refreshments (map object) to be calculated according to above-mentioned steps S5
Arrive.Further, because in the screen coordinate system, the screen coordinate of each map object subtracts origin O screen coordinate
Obtained difference (including abscissa difference and ordinate difference) is all on the occasion of therefore when above-mentioned steps S5 calculates obtained map
The difference that the screen coordinate that the screen coordinate of object subtracts origin O is obtained is negative value, then it represents that should during moving map
Map object is out of screen ranges.
For example, with continued reference to Fig. 3 a, using the navigation map that the position 2 is current parking stall (being used as map basic point)
Point of interest A in 1 is located in the range of current screen, but in fig 3b, is led with the position 2 ' for the described of current parking stall
In boat ground Fig. 1 ', the point of interest A has been moved out of screen ranges.That is, what the map reference of the point of interest A was converted into
The difference that the screen coordinate that screen coordinate subtracts origin O is obtained is negative value, therefore in the screen ranges of the navigation map 1 '
Not comprising the point of interest A.
In another example, with continued reference to Fig. 3 b, contained in the position 2 ' for the navigation map 1 ' of current parking stall
The point of interest B not included described in Fig. 3 a in navigation map 1, with the navigation map of the position 2 ' for current parking stall
In 1 ', the point of interest B is moved into screen ranges.That is, the screen that the map reference of the point of interest B is changed into is sat
It is on the occasion of and the screen coordinate value is in the screen ranges, i.e., described emerging that mark, which subtracts the difference that origin O screen coordinate obtains,
Interesting point B screen coordinate is in the range of screen size determined by above-mentioned steps S1.
With reference to Fig. 3 a and Fig. 3 b are referred to, user has been moved to current parking stall position in Fig. 3 b from the position 2 in Fig. 3 a
Position 2 ', it will be seen that more road informations at the upper right angular range of current parking stall.Carry according to embodiments of the present invention
The map-indication method of confession, user can be using arbitrfary point on screen as current parking stall position, so as to as needed
Adjust the range of observation and observation visual angle on navigation map.Further, can according to the map-indication method of the technical program
To save the computing resource in guider.
Based on above-mentioned map-indication method, the embodiment of the present invention additionally provides a kind of device of control map denotation.Such as Fig. 4
Shown is a kind of structural representation of the specific embodiment of the device of control map denotation of the present invention.With reference to Fig. 4, the control
The device 3 of map denotation processed includes:Coordinate acquiring unit 31, screen coordinate and map reference for obtaining map basic point;Angle
Spend determining unit 32, the anglec of rotation for determining map;Transformation parameter determining unit 33, for based on the angle-determining list
The anglec of rotation and map scale coefficient for the map that member 32 is determined determine transformation parameter;Offset parameter determining unit 34, for true
The coordinate for determining map reference of the map reference relative to the map basic point that the coordinate acquiring unit 31 is obtained of map object is inclined
Shifting parameter;Coordinate transformation unit 35, it is screen coordinate for the map basic point that is obtained based on the coordinate acquiring unit 31, described
The transformation parameter that the coordinate offset parameter and the transformation parameter unit 33 that offset parameter determining unit 34 is determined are determined is by institute
The map reference for stating map object is converted into the screen coordinate of corresponding map object;And drawing unit 36, for based on institute
The screen coordinate for stating the map object of the determination of coordinate transformation unit 35 shows the map for including the map object in screen.
In the present embodiment, the map is navigation map, and the navigation object is automobile.
Specifically, the transformation parameter determining unit 33 includes:Order member (not shown) is calculated, for determining the rotation
The sine value and cosine value of angle;First transformation parameter determining unit (not shown), for according to the sine value and described
The ratio of figure proportionality coefficient determines the first transformation parameter;Second transformation parameter determining unit (not shown), for according to described remaining
The ratio of string value and the map scale coefficient determines the second transformation parameter.
The map reference of the map reference of the map object and the map basic point all includes latitude coordinate and longitude is sat
Mark.The offset parameter determining unit 34 includes:First offset parameter determining unit (not shown), for according to the map base
The longitude coordinate of the longitude coordinate of the map reference of point and the map reference of the map object determines the coordinate offset parameter
In abscissa offset;Second offset parameter determining unit (not shown), for the map reference according to the map basic point
Latitude coordinate and the latitude coordinate of map reference of the map object determine that the ordinate in the coordinate offset parameter is inclined
Shifting amount.
The screen coordinate of the map basic point and the screen coordinate of the map object all include abscissa and ordinate.Institute
Stating coordinate transformation unit 35 includes:First converting unit (not shown), the horizontal stroke for the screen coordinate according to the map basic point
The product and the ordinate offset of coordinate, the abscissa offset and second transformation parameter become with described first
Change parameter product the abscissa of the map reference of the map object is converted into the map object screen coordinate horizontal stroke
Coordinate;Second converting unit (not shown), the ordinate, the ordinate for the screen coordinate according to the map basic point is inclined
The product and the ordinate offset of shifting amount and second transformation parameter and the product of first transformation parameter are by institute
State the map reference of map object ordinate be converted into the map object screen coordinate ordinate.
Further, the embodiment of the present invention additionally provides a kind of guider, including a kind of control map as shown in Figure 4
The device of display.
In summary, the map-indication method provided according to the technical program, can be current using the arbitrfary point on screen
The position of parking stall, and after current parking stall position is changed, screen coordinate, map object based on former parking stall (map basic point)
Coordinate offset parameter and the according to the map anglec of rotation and map scale of the map reference relative to the map reference of map basic point
The map reference of the map object is converted into corresponding screen coordinate by the transformation parameter that coefficient is determined, so as to quickly weigh
Computing resource that is new to draw navigation map, saving in guider.
Although the present invention is disclosed as above with preferred embodiment, it is not for limiting the present invention, any this area
Technical staff without departing from the spirit and scope of the present invention, may be by the methods and techniques content of the disclosure above to this hair
Bright technical scheme makes possible variation and modification, therefore, every content without departing from technical solution of the present invention, according to the present invention
Any simple modifications, equivalents, and modifications made to above example of technical spirit, belong to technical solution of the present invention
Protection domain.