[go: up one dir, main page]

HK1204043B - Method and device for providing location services - Google Patents

Method and device for providing location services Download PDF

Info

Publication number
HK1204043B
HK1204043B HK15104740.8A HK15104740A HK1204043B HK 1204043 B HK1204043 B HK 1204043B HK 15104740 A HK15104740 A HK 15104740A HK 1204043 B HK1204043 B HK 1204043B
Authority
HK
Hong Kong
Prior art keywords
marker
point
offset value
points
set plane
Prior art date
Application number
HK15104740.8A
Other languages
Chinese (zh)
Other versions
HK1204043A1 (en
Inventor
麻华峰
娟 李
杨少博
刘南江
曼 刘
瑾 林
马晓东
占方建
Original Assignee
腾讯科技(深圳)有限公司
Filing date
Publication date
Priority claimed from CN201310430953.7A external-priority patent/CN104457767B/en
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of HK1204043A1 publication Critical patent/HK1204043A1/en
Publication of HK1204043B publication Critical patent/HK1204043B/en

Links

Description

实现位置服务的方法和装置Method and device for implementing location-based services

技术领域Technical Field

本发明涉及移动互联网应用技术,特别是涉及一种实现位置服务的方法和装置。The present invention relates to mobile Internet application technology, and in particular to a method and device for implementing location services.

背景技术Background Art

用户常常通过下载电子地图并浏览下载的电子地图来获知当前所在位置以及周围环境,例如,可通过电子地图中标识的当前的在位置获知当前用户在哪一条街道上,进而根据电子地图中标记的地名获知周围所拥有的商场或酒店等信息;对于浏览景区的用户而言,也将通过加载电子地图实现景区中的定位和导航。Users often download and browse electronic maps to know their current location and surrounding environment. For example, they can know which street the current user is on through the current location marked on the electronic map, and then know the surrounding shopping malls or hotels and other information based on the place names marked on the electronic map. For users browsing scenic spots, positioning and navigation in the scenic spots can also be achieved by loading electronic maps.

由于通过电子地图只能获知当前所在位置以及标记于电子地图上的其它地名,无法识别用户当前所在的方位,进而无法根据用户当前所在的方位进行准确导航。Since only the current location and other place names marked on the electronic map can be obtained through the electronic map, the user's current location cannot be identified, and accurate navigation cannot be performed based on the user's current location.

发明内容Summary of the Invention

基于此,有必要针对无法识别用户当前所在的方位的技术问题,提供一种能识别用户当前所在的方位,进而根据用户当前所在的方位进行准确导航的实现位置服务的方法。Based on this, it is necessary to address the technical problem of being unable to identify the user's current location and provide a method for implementing location services that can identify the user's current location and then accurately navigate based on the user's current location.

此外,还有必要提供一种能识别用户当前所在的方位,进而根据用户当前所在的方位进行准确导航的实现位置服务的装置。In addition, it is also necessary to provide a device for implementing location services that can identify the current location of the user and then accurately navigate based on the current location of the user.

一种实现位置服务的方法,包括如下步骤:A method for implementing location-based services comprises the following steps:

定位当前所在位置和磁北角;Locate current location and magnetic north angle;

根据当前所在位置获取对应的地理数据;Get the corresponding geographic data based on the current location;

在地理数据中根据所述磁北角提取视野的标记点和所述标记点的位置;Extracting a mark point of the visual field and a position of the mark point in the geographic data according to the magnetic north angle;

处理所述提取的标记点和所述标记点的位置,以将所述标记点显示于屏幕中。The extracted marker points and positions of the marker points are processed to display the marker points on a screen.

一种实现位置服务的装置,包括:A device for implementing location-based services, comprising:

定位模块,用于定位当前所在位置和磁北角;Positioning module, used to locate the current location and magnetic north angle;

数据获取模块,用于根据当前所在位置获取对应的地理数据;A data acquisition module is used to obtain corresponding geographic data according to the current location;

提取模块,用于在地理数据中根据所述磁北角提取视野的标记点和所述标记点的位置;an extraction module, configured to extract, from the geographic data, a marked point of the visual field and a position of the marked point according to the magnetic north angle;

处理模块,用于处理所述提取的标记点和所述标记点的位置,以将所述标记点显示于屏幕中。A processing module is used to process the extracted marking points and the positions of the marking points so as to display the marking points on a screen.

上述实现位置服务的方法和装置,定位当前所在位置和磁北角,根据当前所在位置获取对应的地理数据,在地理数据中提取处于磁北角对应的角度范围的标记点和标记点的位置,处理提取的标记点和标记点的位置,以将标记点显示于屏幕中,由于用户当前所在的方位进行了定位以得到相应的磁北角,并且显示于屏幕中的标记点也是根据磁北角进行提取得到的,因此,实现了用户当前所在的方位的识别,进而根据用户当前所在的方位进行了准确导航。The above-mentioned method and device for implementing location services locate the current location and the magnetic north angle, obtain corresponding geographic data based on the current location, extract markers and the positions of the markers within the angle range corresponding to the magnetic north angle from the geographic data, process the extracted markers and the positions of the markers to display the markers on the screen. Since the user's current location is located to obtain the corresponding magnetic north angle, and the markers displayed on the screen are also extracted based on the magnetic north angle, the user's current location is identified, and accurate navigation is then performed based on the user's current location.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为一个实施例中实现位置服务的方法流程图;FIG1 is a flow chart of a method for implementing location services in one embodiment;

图2为图1中在地理数据中根据磁北角提取视野的标记点和标记点的位置的方法流程图;FIG2 is a flow chart of a method for extracting a visual field marker and the position of the marker in geographic data according to the magnetic north angle in FIG1 ;

图3为一个实施例中方位角的示意图;FIG3 is a schematic diagram of azimuth angles in one embodiment;

图4为一个实施例中磁北角的示意图;FIG4 is a schematic diagram of the magnetic north angle in one embodiment;

图5为一个实施例中第一角度状态的示意图;FIG5 is a schematic diagram of a first angle state in one embodiment;

图6为一个实施例中第二角度状态的示意图;FIG6 is a schematic diagram of a second angle state in one embodiment;

图7为一个实施例中第三角度状态的示意图;FIG7 is a schematic diagram of a third angle state in one embodiment;

图8为图1中处理提取的标记点和标记点的位置,以将标记点显示于屏幕中的方法流程图;FIG8 is a flow chart of a method for processing the extracted marker points and the positions of the marker points in FIG1 to display the marker points on a screen;

图9为一个实施例中方位状态1的示意图;FIG9 is a schematic diagram of orientation state 1 according to an embodiment;

图10为一个实施例中方位状态2的示意图;FIG10 is a schematic diagram of orientation state 2 according to an embodiment;

图11为一个实施例中方位状态3的示意图;FIG11 is a schematic diagram of orientation state 3 according to an embodiment;

图12为一个实施例中方位状态4的示意图;FIG12 is a schematic diagram of orientation state 4 according to one embodiment;

图13为另一个实施例中实现位置服务的方法流程图;FIG13 is a flow chart of a method for implementing location services in another embodiment;

图14为图13中将标记点映射到设定平面的方法流程图;FIG14 is a flow chart of a method for mapping a marking point to a set plane in FIG13;

图15为一个实施例中设定平面和屏幕的示意图;FIG15 is a schematic diagram of setting a plane and a screen in one embodiment;

图16为图13中根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布的方法流程图;FIG16 is a flow chart of a method for displaying the distribution of marker points on a set plane on a screen according to the mapping of the marker points on the set plane in FIG13;

图17为另一个实施例中根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布的方法流程图;FIG17 is a flow chart of a method for displaying the distribution of marker points on a set plane on a screen according to the mapping of the marker points on the set plane in another embodiment;

图18为一个实施例中实现位置服务的方法的应用示意图;FIG18 is a schematic diagram of an application of a method for implementing location-based services in one embodiment;

图19为一个实施例中实现位置服务的装置的结构示意图;FIG19 is a schematic structural diagram of an apparatus for implementing location-based services in one embodiment;

图20为图19中提取模块的结构示意图;FIG20 is a schematic structural diagram of the extraction module in FIG19;

图21为图19中处理模块的结构示意图;FIG21 is a schematic structural diagram of the processing module in FIG19;

图22为另一个实施例中实现位置服务的装置的结构示意图;FIG22 is a schematic structural diagram of an apparatus for implementing location-based services in another embodiment;

图23为图22中第二映射模块的结构示意图;FIG23 is a schematic structural diagram of the second mapping module in FIG22;

图24为图22中标记点分布模块的结构示意图;FIG24 is a schematic diagram of the structure of the marking point distribution module in FIG22;

图25为另一个实施例中标记点分布模块的结构示意图;FIG25 is a schematic structural diagram of a marking point distribution module in another embodiment;

图26为一个实施例中实现位置服务的终端的结构示意图。FIG26 is a schematic diagram of the structure of a terminal implementing location-based services in one embodiment.

具体实施方式DETAILED DESCRIPTION

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

如图1所示,在一个实施例中,一种实现位置服务的方法,包括如下步骤:As shown in FIG1 , in one embodiment, a method for implementing location services includes the following steps:

步骤S110,定位当前所在位置和磁北角。Step S110, locating the current location and magnetic north angle.

本实施例中,对用户进行定位以得到当前所在位置和磁北角,其中,当前所在位置可为用户当前所在的经纬度信息;磁北角即为当前偏离正北方向的角度,即罗盘指向角。In this embodiment, the user is positioned to obtain the current location and magnetic north angle, where the current location can be the latitude and longitude information of the user's current location; the magnetic north angle is the current angle away from the north direction, that is, the compass pointing angle.

进一步的,将依赖于本方法所在载体,例如移动终端的硬件,通过移动终端中的GPS和罗盘进行定位,此时,将通过调用HTML5所支持的接口函数获取当前所在位置,监听移动终端的旋转动作以获取磁北角。其中,该接口函数可为getCurrentPosition,旋转动作的监听可通过HTML5deviceorientation事件实现。Furthermore, this method relies on the carrier, such as the hardware of a mobile terminal, to determine the location using the mobile terminal's GPS and compass. In this case, the current location is obtained by calling an HTML5-supported interface function, and the rotation of the mobile terminal is monitored to obtain the magnetic north angle. This interface function can be called getCurrentPosition, and rotation monitoring can be implemented using the HTML5 deviceorientation event.

步骤S130,根据当前所在位置获取对应的地理数据。Step S130: Obtain corresponding geographic data according to the current location.

本实施例中,触发运行本方法,并定位得到当前所在位置和磁北角之后,将获取当前位置所对应的某一区域的地理数据。例如,根据当前所在位置可知用户当前位于某一景区,则获取该景区所对应的地理数据。In this embodiment, after triggering the method and determining the current location and magnetic north angle, geographic data for a region corresponding to the current location is obtained. For example, if the current location indicates that the user is currently located in a scenic area, geographic data corresponding to the scenic area is obtained.

进一步的,在定位得到当前所在位置后,将进行查找,以得到涵盖了当前所在位置的区域所对应的地理数据。Furthermore, after the current location is located, a search is performed to obtain geographic data corresponding to an area covering the current location.

获取的地理数据可以是从后台的服务器加载得到的,也可以是本地所缓存的地理数据。The obtained geographic data can be loaded from a background server or locally cached geographic data.

具体的,若根据当前所在位置首次获取地理数据,将向后台的服务器发起数据加载请求,后台的服务器根据接收到的当前所在位置查找得到涵盖了当前所在位置的地理数据,并返回,此时移动终端将接收到后台的服务器根据数据加载请求返回的地理数据。后续若再次需要根据相同的当前所在位置获取地理数据则不再从后台的服务器下载,直接从本地缓存获取即可。Specifically, if geographic data is being retrieved for the first time based on the current location, a data loading request will be sent to the backend server. The backend server will then search for geographic data covering the current location based on the received current location and return it. The mobile terminal will then receive the geographic data returned by the backend server in response to the data loading request. If geographic data is subsequently needed based on the same current location, it will no longer be downloaded from the backend server, but can be directly retrieved from the local cache.

在一个实施例中,上述地理数据是以文本形式存在的,以保证在地理数据的传输耗费较低的成本,降低了对网络环境的依赖程度,例如,在无wifi,网络较差的情况下,用户不需要耗费较多的流量即可从后台的服务器加载地理数据,也保证了较快的加载速度。In one embodiment, the geographic data is in text form to ensure that the transmission cost of the geographic data is low and the dependence on the network environment is reduced. For example, when there is no WiFi or the network is poor, the user does not need to consume a lot of traffic to load the geographic data from the background server, which also ensures a faster loading speed.

进一步的,地理数据包括了一定区域中所有地点的经纬度信息、地名和标识等,具体可为标记点和标记点的位置,其中,区域中的地点将以标记点的形式存在,标记点的位置可为经纬度信息。例如,某一景区的地理数据包括了景点的名称、景点的经纬度信息和标识。Furthermore, geographic data includes the latitude and longitude information, place names, and identifiers of all locations within a certain area. Specifically, this data can be represented by markers and their locations. Locations within an area are represented by markers, and their locations can be represented by their latitude and longitude information. For example, the geographic data for a particular scenic spot includes the name of the attraction, its latitude and longitude information, and its identifier.

步骤S150,在地理数据中根据磁北角提取视野的标记点和标记点的位置。Step S150 , extracting the marked points of the field of view and the positions of the marked points in the geographic data according to the magnetic north angle.

本实施例中,根据定位得到的磁北角确定当前的视野,进而从地理数据中提取出处于视野内的标记点和标记点的位置。例如,磁北角所对应的视野可以是以当前位置为原点向外辐射所形成的一个角度,由当前位置按照磁北角所形成的射线将是形成的角度的角平分线。In this embodiment, the current field of view is determined based on the magnetic north angle obtained by positioning, and the marker points and their positions within the field of view are then extracted from the geographic data. For example, the field of view corresponding to the magnetic north angle can be an angle radiating outward from the current position as the origin, and the ray formed by the current position according to the magnetic north angle will be the angle bisector of the formed angle.

步骤S170,处理提取的标记点和标记点的位置,以将标记点显示于屏幕中。Step S170 : Processing the extracted marker points and their positions to display the marker points on the screen.

本实施例中,将提取的标记点映射到屏幕所在的平面中,并在该平面进行绘图,以在屏幕中还原视野中标记点的分布,以便于用户查看。In this embodiment, the extracted marker points are mapped to the plane where the screen is located, and drawing is performed on the plane to restore the distribution of the marker points in the field of view on the screen for easy viewing by the user.

如图2所示,在一个实施例中,上述步骤S150包括:As shown in FIG2 , in one embodiment, step S150 includes:

步骤S151,根据地理数据中标记点的位置得到标记点对应的方位角。Step S151: Obtain the azimuth angle corresponding to the marked point according to the position of the marked point in the geographic data.

本实施例中,用户的当前所在位置和标记点的位置均应用经纬度信息表示。方位角是标记点与观察点的连线与正北方向的夹角(顺时针),其中,观察点即为用户的当前所在位置。因此,以用户的当前所在位置为原点,以正北方向为纵坐标的正方向建立坐标系,标记点对应的方位角是由纵坐标的正半轴顺时针旋转到标记点和原点之间的连线时所跨过的角度,如图3所示,对于标记点A而言,角NOA即为标记点A的方位角,角NOB为标记点B的方位角。In this embodiment, the user's current location and the location of the marked point are both represented by latitude and longitude information. The azimuth is the angle (clockwise) between the line connecting the marked point and the observation point and the true north direction, where the observation point is the user's current location. Therefore, a coordinate system is established with the user's current location as the origin and the true north direction as the positive direction of the ordinate. The azimuth corresponding to the marked point is the angle spanned by rotating the positive semi-axis of the ordinate clockwise to the line connecting the marked point and the origin. As shown in Figure 3, for marked point A, angle NOA is the azimuth of marked point A, and angle NOB is the azimuth of marked point B.

步骤S153,根据磁北角得到所处的角度状态,通过该角度状态所对应的角度条件和方位角判断标记点是否位于磁北角对应的视野,若是,则进入步骤S155,若否,则结束。Step S153, obtain the angle state according to the magnetic north angle, and determine whether the marked point is located in the field of view corresponding to the magnetic north angle through the angle condition and azimuth corresponding to the angle state. If so, enter step S155, if not, end.

本实施例中,预先设定了若干个角度状态,根据磁北角所在的角度状态即可获知何种方位角将处于视野中。In this embodiment, a number of angle states are preset, and it is possible to know which azimuth angle will be in the field of view according to the angle state of the magnetic north angle.

具体的,如图4所示,在以用户的当前所在位置为原点,以正北方向为纵坐标的正方向所建立的坐标系中,磁北角即为罗盘指向角,是由轴ON逆时针旋转至当前移动终端的指向所得到的角,当前移动终端指向正北方向时,磁北角等于0度,随着移动终端的旋转,磁北角可由0度变化至360度。Specifically, as shown in Figure 4, in a coordinate system established with the user's current location as the origin and the north direction as the positive direction of the vertical coordinate, the magnetic north angle is the compass pointing angle, which is the angle obtained by rotating the axis ON counterclockwise to the direction of the current mobile terminal. When the current mobile terminal points to the north direction, the magnetic north angle is equal to 0 degrees. As the mobile terminal rotates, the magnetic north angle can change from 0 degrees to 360 degrees.

请参阅图5,v表示视野PlOPr所对应的角度大小,例如,可将v定义为90度。若磁北角NOP∈[0,v/2),以O为起点画射线,任何落在视野PlOPr的射线都将是移动终端当前所指向的视野内的射线,该射线上的任意一点都可作为视野内的点。Refer to Figure 5, where v represents the angle corresponding to the field of view P l OP r. For example, v can be defined as 90 degrees. If the magnetic north angle NOP ∈ [0, v/2), and a ray is drawn from O as the starting point, any ray that falls within the field of view P l OP r will be within the field of view currently pointed by the mobile terminal. Any point on this ray can be considered a point within the field of view.

基于上述原理,以O作为用户的当前所在位置,向标记点画射线,若此条射线落在视野PlOPr内则认为该标记点在移动终端指向的视野内,如射线OA。Based on the above principle, take O as the user's current location and draw a ray to the marked point. If this ray falls within the field of view P l OP r, then the marked point is considered to be within the field of view pointed by the mobile terminal, such as ray OA.

因此,将得到第一角度状态:若磁北角NOP∈[0,v/2),射线OA落在NOPl内,即NOA∈[360-v/2-NOP,360),则标记点A在视野内;当射线OA落在NOPr内,即NOA∈[0,v/2-NOP),则标记点A也在视野内。Therefore, the first angle state will be obtained: if the magnetic north angle NOP∈[0,v/2), the ray OA falls within NOP l , that is, NOA∈[360-v/2-NOP, 360), then the marked point A is in the field of view; when the ray OA falls within NOP r , that is, NOA∈[0,v/2-NOP), then the marked point A is also in the field of view.

相应的,将得到如图6所示的第二角度状态和如图7所示的第三角度状态,其中,分别为:Accordingly, the second angle state shown in FIG6 and the third angle state shown in FIG7 are obtained, where:

第二角度状态:若磁北角NOP∈[v/2,360-v/2),射线OA落在PrOPl内,即NOA∈[360-NOP-v/2,360-NOP+v/2),则标记点A在视野内。Second angle state: If the magnetic north angle NOP∈[v/2,360-v/2), the ray OA falls within P r OP l , that is, NOA∈[360-NOP-v/2,360-NOP+v/2), then the marked point A is in the field of view.

第三角度状态:若磁北角NOP∈[360-v/2,360),射线OA落在PlON内,即NOA∈[360-(v/2-360-NOP),360),则标记点A在视野内;若射线OA落在NOPr内,即NOA∈[0,v/2+360-NOP),则标记点A也在视野内。The third angle state: If the magnetic north angle NOP∈[360-v/2,360), the ray OA falls within P l ON, that is, NOA∈[360-(v/2-360-NOP),360), then the marked point A is in the field of view; if the ray OA falls within NOP r , that is, NOA∈[0,v/2+360-NOP), then the marked point A is also in the field of view.

进而根据角度状态得到相应的角度条件,即,第一角度状态所对应的角度条件为NOA∈[360-v/2-NOP,360)和NOA∈[0,v/2-NOP);第二角度状态所对应的角度条件为NOA∈[360-NOP-v/2,360-NOP+v/2);第三角度状态所对应的角度条件为NOA∈[360-(v/2-360-NOP),360)和NOA∈[0,v/2+360-NOP)。Then, the corresponding angle conditions are obtained according to the angle state, that is, the angle conditions corresponding to the first angle state are NOA∈[360-v/2-NOP, 360) and NOA∈[0, v/2-NOP); the angle conditions corresponding to the second angle state are NOA∈[360-NOP-v/2, 360-NOP+v/2); the angle conditions corresponding to the third angle state are NOA∈[360-(v/2-360-NOP), 360) and NOA∈[0, v/2+360-NOP).

根据磁北角得到所处的角度状态,进而得到该角度状态所对应的角度条件,判断标记点的方位角是否处于得到的角度条件中,若是,则说明该标记点位于视野内。The angle state is obtained according to the magnetic north angle, and then the angle condition corresponding to the angle state is obtained. It is judged whether the azimuth of the marked point is within the obtained angle condition. If so, it means that the marked point is within the field of view.

步骤S155,提取标记点和标记点的位置。Step S155: extract the marking points and their positions.

本实施例中,从地理数据中提取判定得到的位于视野中的标记点和标记点的位置。In this embodiment, the determined marker points located in the field of view and the positions of the marker points are extracted from the geographic data.

如图8所示,在一个实施例中,上述步骤S170包括:As shown in FIG8 , in one embodiment, step S170 includes:

步骤S171,将当前所在位置对应于屏幕中预设的固定点,并根据标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将提取的标记点映射到屏幕所在平面得到标记点对应的第一偏移值。In step S171, the current location corresponds to a preset fixed point on the screen, and the extracted marker point is mapped to the plane of the screen according to the location of the marker point, the current location and the maximum width between the marker points in the geographic data to obtain a first offset value corresponding to the marker point.

本实施例中,将用户当前所在位置设置于屏幕中的某一固定点进行视野内标记点的展示,视野中的标记点都将是用户前方的地点所对应的标记点。优选的,固定点为屏幕底线的中间位置。In this embodiment, the user's current location is set at a fixed point on the screen to display the markers in the field of view. The markers in the field of view will all be the markers corresponding to the location in front of the user. Preferably, the fixed point is the middle position of the bottom line of the screen.

具体的,相对固定点计算标记点映射到屏幕中的位置,即第一偏移值。由于屏幕为方形平面,因此第一偏移值包括第一横向偏移值和第一纵向偏移值。Specifically, the position of the marker point mapped to the screen is calculated relative to the fixed point, that is, the first offset value. Since the screen is a square plane, the first offset value includes a first horizontal offset value and a first vertical offset value.

利用当前所在位置和标记点对应的方位角、屏幕宽度计算得到第一横向偏移值,利用当前所在位置、标记点对应的方位角和屏幕高度计算得到第一纵向偏移值。The first horizontal offset value is calculated using the current position, the azimuth angle corresponding to the mark point, and the screen width, and the first vertical offset value is calculated using the current position, the azimuth angle corresponding to the mark point, and the screen height.

进一步的,首先计算当前所在位置和标记点的位置之间的地理距离gdistance(米),获取视野内标记点之间的最大宽度gwidth(米),即所有标记点分布的最大地理宽度,以及屏幕的宽度mwidth(px)、屏幕的高度mheight(px),则地理距离映射到屏幕上的所对应的固定点至标记点所对应的映射点之间的像素距离为:Furthermore, we first calculate the geographic distance gdistance (meters) between the current location and the location of the marker, and obtain the maximum width gwidth (meters) between the markers in the field of view, that is, the maximum geographic width of all markers, as well as the screen width mwidth (px) and screen height mheight (px). The pixel distance between the corresponding fixed point on the screen and the mapping point corresponding to the marker is mapped to the geographic distance:

mdistance=(mwidth像素/gwidth米)*gdistance米mdistance=(mwidth pixels/gwidth meters)*gdistance meters

从而根据标记点对应的方位角和计算得到的像素距离进行第一横向偏移值left和第一纵向偏移值top的计算,此时为方便计算,逆转方位角,则方位角NOA=360-NOA,根据方位角所在的方位状态进行计算,其中:Therefore, the first horizontal offset value left and the first vertical offset value top are calculated according to the azimuth angle corresponding to the mark point and the calculated pixel distance. At this time, for the convenience of calculation, the azimuth angle is reversed, and the azimuth angle NOA=360-NOA is calculated according to the azimuth angle state, where:

如图9所示,方位状态1,NOA∈[0,90)时,As shown in Figure 9, when the orientation state is 1, NOA∈[0,90),

left=(mwidth/2)-mdistance*sin(NOA);left=(mwidth/2)-mdistance*sin(NOA);

top=mheight-mdistance*cos(NOA)。top=mheight-mdistance*cos(NOA).

如图10所示,方位状态2,NOA∈[90,180)时,As shown in Figure 10, in orientation state 2, NOA∈[90,180),

left=(mwidth/2)+mdistance*sin(180-NOA);left=(mwidth/2)+mdistance*sin(180-NOA);

top=mheight-mdistance*cos(180-NOA)。top=mheight-mdistance*cos(180-NOA).

如图11所示,方位状态3,NOA∈[180,270)时,As shown in Figure 11, in orientation state 3, NOA∈[180,270),

left=(mwidth/2)-mdistance*sin(NOA-180);left=(mwidth/2)-mdistance*sin(NOA-180);

top=mheight-mdistance*cos(NOA-180)。top=mheight-mdistance*cos(NOA-180).

如图12所示,方位状态4,NOA∈[270,360)时,As shown in Figure 12, in orientation state 4, NOA∈[270,360),

left=(mwidth/2)+mdistance*sin(360-NOA);left=(mwidth/2)+mdistance*sin(360-NOA);

top=mheight-mdistance*cos(360-NOA)。top=mheight-mdistance*cos(360-NOA).

步骤S173,按照标记点对应的第一偏移值进行绘图,并显示于屏幕中。In step S173 , drawing is performed according to the first offset value corresponding to the marking point, and the drawing is displayed on the screen.

本实施例中,根据计算得到的第一横向偏移值和第一纵向偏移值进行描点,以使得视野内的标记点均进行了绘制,以便于显示于屏幕中,使得用户通过屏幕即可查看当前视野内的所有标记点。In this embodiment, points are drawn according to the calculated first horizontal offset value and the first vertical offset value, so that all marked points in the field of view are drawn for display on the screen, so that the user can view all marked points in the current field of view through the screen.

此外,还可在屏幕中显示标记点的线路,地理距离等信息,以使得用户所查找得到的标记点相关信息更为丰富。In addition, the route, geographical distance and other information of the marked point can be displayed on the screen to make the relevant information of the marked point found by the user richer.

如图13所示,在一个实施例中,上述步骤S130之前,该方法还包括:As shown in FIG13 , in one embodiment, before the above step S130, the method further includes:

步骤S210,将标记点映射到设定平面。Step S210: Map the marking points to a set plane.

本实施例中,还将在屏幕中的某一区域向用户展示当前所在位置周围的地点,该区域即为设定平面。In this embodiment, locations around the current location will also be displayed to the user in a certain area on the screen, and this area is the set plane.

在获取得到当前所在位置对应的地理数据之后,将地理数据中的标记点映射到设定平面,以通过设定平面向用户还原当前所在环境。After obtaining the geographic data corresponding to the current location, the marked points in the geographic data are mapped to a set plane to restore the current environment to the user through the set plane.

步骤S230,根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布。Step S230 : Displaying the distribution of the marking points on the set plane on the screen according to the mapping of the marking points on the set plane.

本实施例中,将标记点映射到设定平面之后,按照标记点在设定平面的映射对设定平面进行描点,进而将体现了标记点分布的设定平面渲染显示于屏幕中。In this embodiment, after the marking points are mapped to the set plane, the set plane is traced according to the mapping of the marking points on the set plane, and then the set plane reflecting the distribution of the marking points is rendered and displayed on the screen.

对用户当前所在位置周围的地点所进行的展示可通过列表的形式或电子地图的形式实现,但是,在优选的实施例中,对用户当前所在位置周围的地点所进行的展示将通过雷达缩略图的形式实现。The display of places around the user's current location can be achieved in the form of a list or an electronic map. However, in a preferred embodiment, the display of places around the user's current location will be achieved in the form of radar thumbnails.

通过列表的形式将只能在数值大小上展示标记点与用户之间的地理距离和标记点的方位角,而无法形象地进行展示;通过电子地图的形式将存在着实现成本高,和下载该电子地图所耗费的流量高的缺陷,因此将选用雷达缩略图的形式进行用户当前所在位置周围的地点的展示。The list format can only display the geographical distance between the marked point and the user and the azimuth of the marked point in numerical value, but cannot be displayed visually; the electronic map format has the disadvantages of high implementation cost and high traffic consumption when downloading the electronic map, so the radar thumbnail format will be used to display the places around the user's current location.

如图14所示,在一个实施例中,上述步骤S210包括:As shown in FIG. 14 , in one embodiment, step S210 includes:

步骤S211,获取标记点和当前所在位置之间的地理距离,并将地理距离转换为标记点在设定平面中的像素距离。Step S211 : obtaining the geographical distance between the marking point and the current location, and converting the geographical distance into a pixel distance between the marking point in a set plane.

本实施例中,获取标记点到当前所在位置的地理距离gdistance、地理数据中标记点之间的最大宽度gwidth,即地理数据中所有标记点所构成矩形的最大地理宽度gwidth以及屏幕的宽度mwidth,进而根据gdistance、gwidth和mwidth进行地理距离的换算得到标记点在设定平面中的像素距离,即如图15所示的OA,详细公式如下:In this embodiment, the geographic distance gdistance from the marker point to the current location, the maximum width gwidth between the marker points in the geographic data, that is, the maximum geographic width gwidth of the rectangle formed by all the marker points in the geographic data, and the width mwidth of the screen are obtained. Then, the geographic distance is converted according to gdistance, gwidth, and mwidth to obtain the pixel distance of the marker point in the set plane, that is, OA as shown in Figure 15. The detailed formula is as follows:

OA=(mwidth像素/gwidth米)*gdistance米OA = (mwidth pixels / gwidth meters) * gdistance meters

其中,A点为标记点在设定平面的映射,O点为用户当前所在位置,也是坐标系的原点。Among them, point A is the mapping of the marked point on the set plane, and point O is the user's current location, which is also the origin of the coordinate system.

步骤S213,在设定平面以正北方向为纵坐标的正方向,设定平面的中心为原点的坐标系中,获取设定平面和屏幕之间的外边距。Step S213 , obtaining the outer margin between the setting plane and the screen in a coordinate system with the north direction as the positive direction of the vertical coordinate of the setting plane and the center of the setting plane as the origin.

本实施例中,将用户当前所在位置映射到设定平面的中心建立坐标系,其中,正北方向为纵坐标的正方向,在建立的坐标系中获取设定平面的边界相对于屏幕中相邻的两条边界的外边距,即获取的外边距包括了横向外边距和纵向外边距,如图15所示,设定平面1510为圆形,屏幕1530所在的平面与设定平面1510之间的外边距包括了横向外边距tx和纵向外边距ty。In this embodiment, the user's current location is mapped to the center of the set plane to establish a coordinate system, wherein the north direction is the positive direction of the vertical coordinate. In the established coordinate system, the margins of the boundary of the set plane relative to the two adjacent boundaries in the screen are obtained, that is, the obtained margins include the horizontal margins and the vertical margins. As shown in Figure 15, the set plane 1510 is a circle, and the margins between the plane where the screen 1530 is located and the set plane 1510 include the horizontal margin tx and the vertical margin ty.

步骤S215,将当前所在位置映射到坐标系的原点,通过外边距、像素距离和标记点的位置计算得到标记点映射到设定平面的第二偏移值。Step S215 , mapping the current position to the origin of the coordinate system, and calculating a second offset value of the marker point mapped to the set plane through the outer margin, the pixel distance, and the position of the marker point.

本实施例中,在建立的坐标系中,通过外边距、像素距离和标记点的位置进行几何变换以计算得到标记点映射到设定平面的第二偏移值,该第二偏移值是标记点相对于屏幕中相邻的两条边界的距离,包括第二横向偏移值和第二纵向偏移值。In this embodiment, in the established coordinate system, a geometric transformation is performed through the outer margin, pixel distance and position of the marker point to calculate the second offset value of the marker point mapped to the set plane. The second offset value is the distance between the marker point and the two adjacent boundaries in the screen, including a second horizontal offset value and a second vertical offset value.

请结合参阅图15,点A为标记点到坐标系中的映射,r为圆形的设定平面所对应的半径,tx为横向外边距,ty为纵向外边距。为在设定平面中描绘标记点,将首先根据标记点的位置得到对应的方位角,并逆转方位角,以便于计算,即方位角NOA=360-NOA,则任一标记点的第二横向偏移值left和第二纵向偏移值top可由如下公式计算得到:Please refer to Figure 15. Point A is the mapping of the marker point to the coordinate system, r is the radius of the circular plane, tx is the horizontal margin, and ty is the vertical margin. To depict the marker point in the set plane, the corresponding azimuth angle is first obtained based on the marker point's position and then reversed for ease of calculation. That is, azimuth angle NOA = 360 - NOA. The second horizontal offset value left and the second vertical offset value top of any marker point can be calculated using the following formula:

left=r-OA*sin(NOA)+tx;left=r-OA*sin(NOA)+tx;

top=r-OA*cos(NOA)+ty。top=r-OA*cos(NOA)+ty.

其中,OA为像素距离。Where OA is the pixel distance.

在一个实施例中,上述设定平面为圆形,上述步骤S215之后,该步骤S210还包括:In one embodiment, the set plane is a circle. After the above step S215, the step S210 further includes:

对映射到设定平面之外的标记点,根据设定平面的半径、标记点的位置和外边距计算得到对应的第二偏移修正值。For a marking point mapped outside the set plane, a corresponding second offset correction value is calculated based on the radius of the set plane, the position of the marking point, and the outer margin.

本实施例中,并非地理数据中所有的标记点均能够映射到设定平面之内,因此,对于映射到设定平面之外的标记点,将对其第二偏移值进行修正,以使得映射到设定平面之外的标记点均被展示于设定平面边缘,使得用户在设定平面上也能够查看到该标记点,以获知其所在的方位。In this embodiment, not all marker points in the geographic data can be mapped within the set plane. Therefore, for the marker points mapped outside the set plane, their second offset values will be corrected so that the marker points mapped outside the set plane are displayed at the edge of the set plane, so that the user can also view the marker point on the set plane to know its location.

具体的,映射到设定平面之外的标记点的修正可通过如下公式实现:Specifically, the correction of the marker points mapped outside the set plane can be achieved by the following formula:

eleft=r-r*sin(NOA)+tx;eleft=r-r*sin(NOA)+tx;

etop=r-r*cos(NOA)+ty。etop=r-r*cos(NOA)+ty.

其中,eleft为第二横向偏移修正值,etop为第二纵向偏移修正值,NOA为一次逆转后的方位角。Wherein, eleft is the second lateral offset correction value, etop is the second longitudinal offset correction value, and NOA is the azimuth after one reversal.

如图16所示,在一个实施例中,上述步骤S230包括:As shown in FIG. 16 , in one embodiment, step S230 includes:

步骤S231,获取映射到设定平面之内的标记点对应的第二偏移值。Step S231: Obtain a second offset value corresponding to the marking point mapped within the set plane.

本实施例中,对设定平面之内的标记点获取第二横向偏移值和第二纵向偏移值。In this embodiment, a second transverse offset value and a second longitudinal offset value are obtained for the marking point within the set plane.

步骤S233,按照第二偏移值在设定平面描点。Step S233: Draw a point on the set plane according to the second offset value.

本实施例中,在设定平面中按照第二横向偏移值和第二纵向偏移值进行绘图,以得到设定平面之内所有标记点的雷达缩略图,进而向用户展示一定范围之内所有标记点的分布。In this embodiment, a plot is performed in the set plane according to the second lateral offset value and the second longitudinal offset value to obtain a radar thumbnail of all the marked points within the set plane, thereby showing the distribution of all the marked points within a certain range to the user.

步骤S235,显示描点得到的雷达缩略图。Step S235: Display the radar thumbnail obtained by tracing the points.

如图17所示,在一个实施例中,上述步骤S235之前还包括:As shown in FIG17 , in one embodiment, before step S235, the following steps are further included:

步骤S237,根据映射到设定平面之外的标记点的位置确定标记点映射到坐标系所对应的象限。Step S237 : determining the quadrant corresponding to the coordinate system to which the marked point is mapped based on the position of the marked point mapped outside the set plane.

本实施例中,为使得映射到设定平面之外的标记点不漂移到设定平面之外,对于映射到设定平面之外的标记点,将根据其位置获取对应的方位角得到标记点的映射在坐标系的象限。In this embodiment, in order to prevent the marking points mapped outside the set plane from drifting outside the set plane, for the marking points mapped outside the set plane, the corresponding azimuth angle will be obtained according to their position to obtain the quadrant of the coordinate system in which the marking points are mapped.

步骤S238,按照象限对比映射点的第二偏移值和第二偏移修正值得到实际偏移值。Step S238 , obtaining the actual offset value according to the second offset value and the second offset correction value of the quadrant comparison mapping point.

本实施例中,按方位角NOA所在象限对第二偏移值和第二偏移修正值进行对比以得到实际偏移值,相应的,该实际偏移值包括横向实际偏移值和纵向实际偏移值,具体的:In this embodiment, the second offset value and the second offset correction value are compared according to the quadrant where the azimuth angle NOA is located to obtain an actual offset value. Accordingly, the actual offset value includes a horizontal actual offset value and a vertical actual offset value. Specifically:

当NOA/90等于0时,实际横向偏移值left=max(left,eleft),实际纵向偏移值top=max(top,etop)。When NOA/90 is equal to 0, the actual lateral offset value left=max(left,eleft), and the actual longitudinal offset value top=max(top,etop).

当NOA/90等于1时,实际横向偏移值left=max(left,eleft),实际纵向偏移值top=min(top,etop)。When NOA/90 is equal to 1, the actual lateral offset value left=max(left,eleft), and the actual longitudinal offset value top=min(top,etop).

当NOA/90等于2时,实际横向偏移值left=min(left,eleft),实际纵向偏移值top=min(top,etop)。When NOA/90 is equal to 2, the actual lateral offset value left=min(left,eleft), and the actual longitudinal offset value top=min(top,etop).

当NOA/90等于3时,实际横向偏移值left=min(left,eleft),实际纵向偏移值top=max(top,etop)。When NOA/90 is equal to 3, the actual lateral offset value left=min(left,eleft), and the actual longitudinal offset value top=max(top,etop).

步骤S239,按照实际偏移值在设定平面描点。Step S239: Draw points on the set plane according to the actual offset value.

本实施例中,对比得到标记点的实际偏移值之后,即可按照实际偏移值在设定平面中渲染描点,以得到大致显示映射到设定平面之外的标记点的分布的雷达缩略图。In this embodiment, after comparing and obtaining the actual offset values of the marker points, the points can be rendered in the set plane according to the actual offset values to obtain a radar thumbnail that roughly shows the distribution of the marker points mapped outside the set plane.

上述实现位置服务的方法,通过雷达缩略图实现一定区域内的全视角标记点分布和方位的展示,进而使得用户通过雷达缩略图掌控该区域内的所有地理位置信息,以实现了该区域内的地理位置服务。The above method for implementing location services uses radar thumbnails to display the distribution and orientation of full-view marker points in a certain area, so that users can control all geographic location information in the area through radar thumbnails, thereby realizing geographic location services in the area.

上述实现位置服务的方法中,如图18所示,通过对地理数据的标记点进行两次不同方式的映射而分别得到当前用户视野内的标记点分布和展示全视角标记点分布的雷达缩略图,进而还可获取相应的位置服务信息,以标记于当前用户视野内的标记点分布中,也可标记于雷达缩略图中,为用户提供更为丰富的信息。In the above-mentioned method for implementing location services, as shown in FIG18, by mapping the marker points of geographic data in two different ways, the distribution of marker points within the current user's field of view and the radar thumbnail showing the distribution of marker points in full view are obtained respectively. Then, the corresponding location service information can be obtained to be marked in the distribution of marker points within the current user's field of view, and can also be marked in the radar thumbnail to provide users with richer information.

由于上述实现位置服务的方法可通过HTML5实现,因此不需要安装额外的插件即可实现,大大地降低了系统资源的耗费。Since the above method for implementing location services can be implemented through HTML5, it can be implemented without installing additional plug-ins, which greatly reduces the consumption of system resources.

上述实现位置服务的方法中,对屏幕所在平面绘制视野中标记点的分布或者雷达缩略图的绘制均是通过模拟线程实现的。具体的,上述实现位置服务的方法可通过HTML5中的JS(Javascript)语言实现,由于JS语言本质上并不支持多进程,因此,将通过一个单独的进程执行上述实现位置服务的方法,并通过调用setTimeout触发标记点的绘制功能,setTimeout即称为是模拟线程,进而使得标记点的绘制看似与当前的进程同时执行。In the aforementioned location-based service implementation method, the distribution of markers in the field of view or the drawing of the radar thumbnail on the screen plane are both implemented through simulated threads. Specifically, the aforementioned location-based service implementation method can be implemented using the JavaScript (JS) language in HTML5. Because JavaScript does not inherently support multiple processes, the aforementioned location-based service implementation method is executed in a separate process, and the marker drawing function is triggered by calling setTimeout. setTimeout is called simulated threading, which makes the marker drawing appear to be executed simultaneously with the current process.

如图19所示,在一个实施例中,一种实现位置服务的装置,包括定位模块110、数据获取模块130、提取模块150和处理模块170。As shown in FIG. 19 , in one embodiment, a device for implementing location-based services includes a positioning module 110 , a data acquisition module 130 , an extraction module 150 , and a processing module 170 .

定位模块110,用于定位当前所在位置和磁北角。The positioning module 110 is used to locate the current location and magnetic north angle.

本实施例中,定位模块110对用户进行定位以得到当前所在位置和磁北角,其中,当前所在位置可为用户当前所在的经纬度信息;磁北角即为当前偏离正北方向的角度,即罗盘指向角。In this embodiment, the positioning module 110 locates the user to obtain the current location and magnetic north angle, where the current location can be the latitude and longitude information of the user; the magnetic north angle is the current angle away from the north direction, that is, the compass pointing angle.

进一步的,定位模块110将依赖于本方法所在载体,例如移动终端的硬件,通过移动终端中的GPS和罗盘进行定位,此时,定位模块110将通过调用HTML5所支持的接口函数获取当前所在位置,监听移动终端的旋转动作以获取磁北角。其中,该接口函数可为getCurrentPosition,旋转动作的监听可通过HTML5deviceorientation事件实现。Furthermore, positioning module 110 will rely on the carrier of this method, such as the hardware of a mobile terminal, and perform positioning using the GPS and compass in the mobile terminal. In this case, positioning module 110 will obtain the current location by calling an interface function supported by HTML5 and monitor the rotation of the mobile terminal to obtain the magnetic north angle. The interface function may be getCurrentPosition, and monitoring of rotation can be implemented through the HTML5 deviceorientation event.

数据获取模块130,用于根据当前所在位置获取对应的地理数据。The data acquisition module 130 is used to acquire corresponding geographic data according to the current location.

本实施例中,触发运行本方法,并定位得到当前所在位置和磁北角之后,数据获取模块130将获取当前位置所对应的某一区域的地理数据。例如,数据获取模块130根据当前所在位置可知用户当前位于某一景区,则获取该景区所对应的地理数据。In this embodiment, after triggering the method and determining the current location and magnetic north angle, the data acquisition module 130 acquires geographic data for a region corresponding to the current location. For example, if the data acquisition module 130 determines that the user is currently located in a particular scenic area based on the current location, it will acquire geographic data corresponding to the scenic area.

进一步的,在定位得到当前所在位置后,数据获取模块130将进行查找,以得到涵盖了当前所在位置的区域所对应的地理数据。Furthermore, after the current location is located, the data acquisition module 130 will search to obtain geographic data corresponding to the area covering the current location.

数据获取模块130获取的地理数据可以是从后台的服务器加载得到的,也可以是本地所缓存的地理数据。The geographic data acquired by the data acquisition module 130 may be loaded from a backend server or may be locally cached geographic data.

具体的,若根据当前所在位置首次获取地理数据,数据获取模块130将向后台的服务器发起数据加载请求,后台的服务器根据接收到的当前所在位置查找得到涵盖了当前所在位置的地理数据,并返回,此时移动终端中的数据获取模块130将接收到后台的服务器根据数据加载请求返回的地理数据。后续若再次需要根据相同的当前所在位置获取地理数据则不再从后台的服务器下载,数据获取模块130直接从本地缓存获取即可。Specifically, if geographic data is being acquired for the first time based on the current location, the data acquisition module 130 will initiate a data loading request to the backend server. The backend server will then search for geographic data covering the current location based on the received current location and return the data. At this point, the data acquisition module 130 in the mobile terminal will receive the geographic data returned by the backend server in response to the data loading request. If geographic data is subsequently needed based on the same current location, it will no longer be downloaded from the backend server; the data acquisition module 130 will retrieve the data directly from the local cache.

在一个实施例中,上述地理数据是以文本形式存在的,以保证在地理数据的传输耗费较低的成本,降低了对网络环境的依赖程度,例如,在无wifi,网络较差的情况下,用户不需要耗费较多的流量即可从后台的服务器加载地理数据,也保证了较快的加载速度。In one embodiment, the geographic data is in text form to ensure that the transmission cost of the geographic data is low and the dependence on the network environment is reduced. For example, when there is no WiFi or the network is poor, the user does not need to consume a lot of traffic to load the geographic data from the background server, which also ensures a faster loading speed.

进一步的,地理数据包括了一定区域中所有地点的经纬度信息、地名和标识等,具体可为标记点和标记点的位置,其中,区域中的地点将以标记点的形式存在,标记点的位置可为经纬度信息。例如,某一景区的地理数据包括了景点的名称、景点的经纬度信息和标识。Furthermore, geographic data includes the latitude and longitude information, place names, and identifiers of all locations within a certain area. Specifically, this data can be represented by markers and their locations. Locations within an area are represented by markers, and their locations can be represented by their latitude and longitude information. For example, the geographic data for a particular scenic spot includes the name of the attraction, its latitude and longitude information, and its identifier.

提取模块150,用于在地理数据中根据磁北角提取视野的标记点和标记点的位置。The extraction module 150 is used to extract the marked points of the field of view and the positions of the marked points in the geographic data according to the magnetic north angle.

本实施例中,提取模块150根据定位得到的磁北角确定当前的视野,进而从地理数据中提取出处于视野内的标记点和标记点的位置。例如,磁北角所对应的视野可以是以当前位置为原点向外辐射所形成的一个角度,由当前位置按照磁北角所形成的射线将是形成的角度的角平分线。In this embodiment, the extraction module 150 determines the current field of view based on the magnetic north angle obtained by positioning, and then extracts the markers and their positions within the field of view from the geographic data. For example, the field of view corresponding to the magnetic north angle may be an angle radiating outward from the current location as the origin, and the ray formed by the current location according to the magnetic north angle will be the angle bisector of the formed angle.

处理模块170,用于处理提取的标记点和标记点的位置,以将标记点显示于屏幕中。The processing module 170 is configured to process the extracted marker points and their positions to display the marker points on the screen.

本实施例中,处理模块170将提取的标记点映射到屏幕所在的平面中,并在该平面进行绘图,以在屏幕中还原视野中标记点的分布,以便于用户查看。In this embodiment, the processing module 170 maps the extracted marker points to the plane where the screen is located, and performs drawing on the plane to restore the distribution of the marker points in the field of view on the screen for user viewing.

如图20所示,在一个实施例中,上述提取模块150包括方位角获取单元151、标记点判定单元153和标记点提取单元155。As shown in FIG. 20 , in one embodiment, the extraction module 150 includes an azimuth angle acquisition unit 151 , a marker point determination unit 153 , and a marker point extraction unit 155 .

方位角获取单元151,用于根据地理数据中标记点的位置得到标记点对应的方位角。The azimuth obtaining unit 151 is configured to obtain the azimuth corresponding to the marked point according to the position of the marked point in the geographic data.

本实施例中,用户的当前所在位置和标记点的位置均应用经纬度信息表示。方位角是标记点与观察点的连线与正北方向的夹角(顺时针),其中,观察点即为用户的当前所在位置。因此,以用户的当前所在位置为原点,以正北方向为纵坐标的正方向建立坐标系,标记点对应的方位角是由纵坐标的正半轴顺时针旋转到标记点和原点之间的连线时所跨过的角。In this embodiment, the user's current location and the location of the marked point are both represented by latitude and longitude information. The azimuth is the angle (clockwise) between the line connecting the marked point and the observation point and true north, where the observation point is the user's current location. Therefore, a coordinate system is established with the user's current location as the origin and true north as the positive direction of the ordinate. The azimuth corresponding to the marked point is the angle spanned by rotating the positive semi-axis of the ordinate clockwise to the line connecting the marked point and the origin.

标记点判定单元153,用于根据磁北角得到所处的角度状态,通过角度状态所对应的角度条件和方位角判断标记点是否位于磁北角对应的视野,若是,则通知标记点提取单元155,若否,则停止执行。The marking point determination unit 153 is used to obtain the angle state according to the magnetic north angle, and determine whether the marking point is located in the field of view corresponding to the magnetic north angle through the angle condition and azimuth corresponding to the angle state. If so, the marking point extraction unit 155 is notified; if not, the execution is stopped.

本实施例中,预先设定了若干个角度状态,标记点判定单元153根据磁北角所在的角度状态即可获知何种方位角将处于视野中。In this embodiment, several angle states are preset, and the marking point determination unit 153 can know which azimuth angle will be in the field of view according to the angle state of the magnetic north angle.

具体的,在以用户的当前所在位置为原点,以正北方向为纵坐标的正方向所建立的坐标系中,磁北角即为罗盘指向角,当前移动终端指向正北方向时,磁北角等于0度,随着移动终端的旋转,磁北角可由0度变化至360度。Specifically, in a coordinate system established with the user's current location as the origin and the north direction as the positive direction of the vertical coordinate, the magnetic north angle is the compass pointing angle. When the current mobile terminal points to the north direction, the magnetic north angle is equal to 0 degrees. As the mobile terminal rotates, the magnetic north angle can change from 0 degrees to 360 degrees.

请参阅图5,v表示视野PlOPr所对应的角度大小,例如,可将v定义为90度。若磁北角NOP∈[0,v/2),以O为起点画射线,任何落在视野PlOPr的射线都将是移动终端当前所指向的视野内的射线,该射线上的任意一点都可作为视野内的点。Refer to Figure 5, where v represents the angle corresponding to the field of view P l OP r. For example, v can be defined as 90 degrees. If the magnetic north angle NOP ∈ [0, v/2), and a ray is drawn from O as the starting point, any ray that falls within the field of view P l OP r will be within the field of view currently pointed by the mobile terminal. Any point on this ray can be considered a point within the field of view.

基于上述原理,以O作为用户的当前所在位置,向标记点画射线,若此条射线落在视野PlOPr内则认为该标记点在移动终端指向的视野内,如射线OA。Based on the above principle, take O as the user's current location and draw a ray to the marked point. If this ray falls within the field of view P l OP r, then the marked point is considered to be within the field of view pointed by the mobile terminal, such as ray OA.

因此,将得到第一角度状态:若磁北角NOP∈[0,v/2),射线OA落在NOPl内,即NOA∈[360-v/2-NOP,360),则标记点A在视野内;当射线OA落在NOPr内,即NOA∈[0,v/2-NOP),则标记点A也在视野内。Therefore, the first angle state will be obtained: if the magnetic north angle NOP∈[0,v/2), the ray OA falls within NOP l , that is, NOA∈[360-v/2-NOP, 360), then the marked point A is in the field of view; when the ray OA falls within NOP r , that is, NOA∈[0,v/2-NOP), then the marked point A is also in the field of view.

相应的,将得到如图6所示的第二角度状态和如图7所示的第三角度状态,其中,分别为:Accordingly, the second angle state shown in FIG6 and the third angle state shown in FIG7 are obtained, where:

第二角度状态:若磁北角NOP∈[v/2,360-v/2),射线OA落在PrOPl内,即NOA∈[360-NOP-v/2,360-NOP+v/2),则标记点A在视野内。Second angle state: If the magnetic north angle NOP∈[v/2,360-v/2), the ray OA falls within P r OP l , that is, NOA∈[360-NOP-v/2,360-NOP+v/2), then the marked point A is in the field of view.

第三角度状态:若磁北角NOP∈[360-v/2,360),射线OA落在PlON内,即NOA∈[360-(v/2-360-NOP),360),则标记点A在视野内;若射线OA落在NOPr内,即NOA∈[0,v/2+360-NOP),则标记点A也在视野内。The third angle state: If the magnetic north angle NOP∈[360-v/2,360), the ray OA falls within P l ON, that is, NOA∈[360-(v/2-360-NOP),360), then the marked point A is in the field of view; if the ray OA falls within NOP r , that is, NOA∈[0,v/2+360-NOP), then the marked point A is also in the field of view.

进而根据角度状态得到相应的角度条件,即,第一角度状态所对应的角度条件为NOA∈[360-v/2-NOP,360)和NOA∈[0,v/2-NOP);第二角度状态所对应的角度条件为NOA∈[360-NOP-v/2,360-NOP+v/2);第三角度状态所对应的角度条件为NOA∈[360-(v/2-360-NOP),360)和NOA∈[0,v/2+360-NOP)。Then, the corresponding angle conditions are obtained according to the angle state, that is, the angle conditions corresponding to the first angle state are NOA∈[360-v/2-NOP, 360) and NOA∈[0, v/2-NOP); the angle conditions corresponding to the second angle state are NOA∈[360-NOP-v/2, 360-NOP+v/2); the angle conditions corresponding to the third angle state are NOA∈[360-(v/2-360-NOP), 360) and NOA∈[0, v/2+360-NOP).

标记点判定单元153根据磁北角得到所处的角度状态,进而得到该角度状态所对应的角度条件,判断标记点的方位角是否处于得到的角度条件中,若是,则说明该标记点位于视野内。The marking point determination unit 153 obtains the angle state according to the magnetic north angle, and then obtains the angle condition corresponding to the angle state, and determines whether the azimuth of the marking point is within the obtained angle condition. If so, it means that the marking point is within the field of view.

标记点提取单元155,用于提取标记点和标记点的位置。The marker point extraction unit 155 is configured to extract marker points and their positions.

本实施例中,标记点提取单元155从地理数据中提取判定得到的位于视野中的标记点和标记点的位置。In this embodiment, the marker point extraction unit 155 extracts the marker points determined to be located in the field of view and the positions of the marker points from the geographic data.

如图21所示,在一个实施例中,上述处理模块170包括第一映射单元171和绘图单元173。As shown in FIG. 21 , in one embodiment, the processing module 170 includes a first mapping unit 171 and a drawing unit 173 .

第一映射单元171,用于将当前所在位置对应于屏幕中预设的固定点,并根据标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将提取的标记点映射到屏幕所在平面得到标记点对应的第一偏移值。The first mapping unit 171 is used to correspond the current location to a preset fixed point on the screen, and map the extracted marker point to the plane of the screen according to the position of the marker point, the current location and the maximum width between the marker points in the geographic data to obtain a first offset value corresponding to the marker point.

本实施例中,第一映射单元171将用户当前所在位置设置于屏幕中的某一固定点进行视野内标记点的展示,视野中的标记点都将是用户前方的地点所对应的标记点。优选的,固定点为屏幕底线的中间位置。In this embodiment, the first mapping unit 171 sets the user's current location at a fixed point on the screen to display the markers in the field of view. The markers in the field of view will all be the markers corresponding to the location in front of the user. Preferably, the fixed point is the middle position of the bottom line of the screen.

具体的,第一映射单元171相对固定点计算标记点映射到屏幕中的位置,即第一偏移值。由于屏幕为方形平面,因此第一偏移值包括第一横向偏移值和第一纵向偏移值。Specifically, the first mapping unit 171 calculates the position of the marker point mapped to the screen relative to the fixed point, that is, the first offset value. Since the screen is a square plane, the first offset value includes a first horizontal offset value and a first vertical offset value.

第一映射单元171利用当前所在位置和标记点对应的方位角、屏幕宽度计算得到第一横向偏移值,利用当前所在位置、标记点对应的方位角和屏幕高度计算得到第一纵向偏移值。The first mapping unit 171 calculates a first horizontal offset value using the current position, the azimuth angle corresponding to the marker point, and the screen width, and calculates a first vertical offset value using the current position, the azimuth angle corresponding to the marker point, and the screen height.

进一步的,第一映射单元171首先计算当前所在位置和标记点的位置之间的地理距离gdistance(米),获取视野内标记点之间的最大宽度gwidth(米),即所有标记点分布的最大地理宽度,以及屏幕的宽度mwidth(px)、屏幕的高度mheight(px),则地理距离映射到屏幕上的所对应的固定点至标记点所对应的映射点之间的像素距离为:Furthermore, the first mapping unit 171 first calculates the geographic distance gdistance (meters) between the current location and the location of the marker, obtains the maximum width gwidth (meters) between the markers in the field of view, that is, the maximum geographic width of all marker distributions, as well as the width mwidth (px) of the screen and the height mheight (px) of the screen. Then, the pixel distance between the corresponding fixed point on the screen and the mapping point corresponding to the marker is mapped to the geographic distance:

mdistance=(mwidth像素/gwidth米)*gdistance米mdistance=(mwidth pixels/gwidth meters)*gdistance meters

从而第一映射单元171根据标记点对应的方位角和计算得到的像素距离进行第一横向偏移值left和第一纵向偏移值top的计算,此时为方便计算,逆转方位角,则方位角NOA=360-NOA,根据方位角所在的方位状态进行计算,其中:Thus, the first mapping unit 171 calculates the first horizontal offset value left and the first vertical offset value top according to the azimuth angle corresponding to the mark point and the calculated pixel distance. At this time, for the convenience of calculation, the azimuth angle is reversed, and the azimuth angle NOA=360-NOA is calculated according to the azimuth angle state, where:

如图9所示,方位状态1,NOA∈[0,90)时,As shown in Figure 9, when the orientation state is 1, NOA∈[0,90),

left=(mwidth/2)-mdistance*sin(NOA);left=(mwidth/2)-mdistance*sin(NOA);

top=mheight-mdistance*cos(NOA)。top=mheight-mdistance*cos(NOA).

如图10所示,方位状态2,NOA∈[90,180)时,As shown in Figure 10, in orientation state 2, NOA∈[90,180),

left=(mwidth/2)+mdistance*sin(180-NOA);left=(mwidth/2)+mdistance*sin(180-NOA);

top=mheight-mdistance*cos(180-NOA)。top=mheight-mdistance*cos(180-NOA).

如图11所示,方位状态3,NOA∈[180,270)时,As shown in Figure 11, in orientation state 3, NOA∈[180,270),

left=(mwidth/2)-mdistance*sin(NOA-180);left=(mwidth/2)-mdistance*sin(NOA-180);

top=mheight-mdistance*cos(NOA-180)。top=mheight-mdistance*cos(NOA-180).

如图12所示,方位状态4,NOA∈[270,360)时,As shown in Figure 12, in orientation state 4, NOA∈[270,360),

left=(mwidth/2)+mdistance*sin(360-NOA);left=(mwidth/2)+mdistance*sin(360-NOA);

top=mheight-mdistance*cos(360-NOA)。top=mheight-mdistance*cos(360-NOA).

绘图单元173,用于按照标记点对应的第一偏移值进行绘图,并显示于屏幕中。The drawing unit 173 is configured to draw a picture according to the first offset value corresponding to the marking point, and display the picture on the screen.

本实施例中,绘图单元173根据计算得到的第一横向偏移值和第一纵向偏移值进行描点,以使得视野内的标记点均进行了绘制,以便于显示于屏幕中,使得用户通过屏幕即可查看当前视野内的所有标记点。In this embodiment, the drawing unit 173 draws points according to the calculated first horizontal offset value and the first vertical offset value, so that all the marked points in the field of view are drawn for display on the screen, so that the user can view all the marked points in the current field of view through the screen.

此外,绘图单元173还可在屏幕中显示标记点的线路,地理距离等信息,以使得用户所查找得到的标记点相关信息更为丰富。In addition, the drawing unit 173 can also display information such as the route and geographical distance of the marked point on the screen, so that the user can obtain more information related to the marked point.

如图22所示,在一个实施例中,上述装置还包括第二映射模块210和标记点分布模块230。As shown in FIG. 22 , in one embodiment, the apparatus further includes a second mapping module 210 and a marker distribution module 230 .

第二映射模块210,用于将标记点映射到设定平面。The second mapping module 210 is configured to map the marking point to a set plane.

本实施例中,第二映射模块210还将在屏幕中的某一区域向用户展示当前所在位置周围的地点,该区域即为设定平面。In this embodiment, the second mapping module 210 will also display locations around the current location to the user in a certain area on the screen, and this area is the set plane.

第二映射模块210在获取得到当前所在位置对应的地理数据之后,将地理数据中的标记点映射到设定平面,以通过设定平面向用户还原当前所在环境。After obtaining the geographic data corresponding to the current location, the second mapping module 210 maps the marking points in the geographic data to a set plane, so as to restore the current environment to the user through the set plane.

标记点分布模块230,用于根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布。The marker point distribution module 230 is configured to display the distribution of the marker points on the set plane on the screen according to the mapping of the marker points on the set plane.

本实施例中,将标记点映射到设定平面之后,标记点分布模块230按照标记点在设定平面的映射对设定平面进行描点,进而将体现了标记点分布的设定平面渲染显示于屏幕中。In this embodiment, after mapping the marker points to the set plane, the marker point distribution module 230 plots the set plane according to the mapping of the marker points on the set plane, and then renders and displays the set plane reflecting the marker point distribution on the screen.

标记点分布模块230对用户当前所在位置周围的地点所进行的展示可通过列表的形式或电子地图的形式实现,但是,在优选的实施例中,对用户当前所在位置周围的地点所进行的展示将通过雷达缩略图的形式实现。The marker point distribution module 230 can display the places around the user's current location in the form of a list or an electronic map. However, in a preferred embodiment, the places around the user's current location are displayed in the form of radar thumbnails.

通过列表的形式将只能在数值大小上展示标记点与用户之间的地理距离和标记点的方位角,而无法形象地进行展示;通过电子地图的形式将存在着实现成本高,和下载该电子地图所耗费的流量高的缺陷,因此将选用雷达缩略图的形式进行用户当前所在位置周围的地点的展示。The list format can only display the geographical distance between the marked point and the user and the azimuth of the marked point in numerical value, but cannot be displayed visually; the electronic map format has the disadvantages of high implementation cost and high traffic consumption when downloading the electronic map, so the radar thumbnail format will be used to display the places around the user's current location.

如图23所示,在一个实施例中,上述第二映射模块210包括距离处理单元211、外边距获取单元213和偏移值计算单元215。As shown in FIG. 23 , in one embodiment, the second mapping module 210 includes a distance processing unit 211 , an outer margin obtaining unit 213 , and an offset value calculating unit 215 .

距离处理单元211,用于获取标记点和当前所在位置之间的地理距离,并将地理距离转换为标记点在设定平面中的像素距离。The distance processing unit 211 is used to obtain the geographical distance between the marker point and the current location, and convert the geographical distance into a pixel distance between the marker point in a set plane.

本实施例中,距离处理单元211获取标记点到当前所在位置的地理距离gdistance、地理数据中标记点之间的最大宽度gwidth,即地理数据中所有标记点所构成矩形的最大地理宽度gwidth以及屏幕的宽度mwidth,进而根据gdistance、gwidth和mwidth进行地理距离的换算得到标记点在设定平面中的像素距离,即如图15所示的OA,详细公式如下:In this embodiment, the distance processing unit 211 obtains the geographic distance gdistance from the marker point to the current location, the maximum width gwidth between the marker points in the geographic data, that is, the maximum geographic width gwidth of the rectangle formed by all the marker points in the geographic data, and the width mwidth of the screen, and then converts the geographic distance according to gdistance, gwidth, and mwidth to obtain the pixel distance of the marker point in the set plane, that is, OA as shown in Figure 15. The detailed formula is as follows:

OA=(mwidth像素/gwidth米)*gdistance米OA = (mwidth pixels / gwidth meters) * gdistance meters

其中,A点为标记点在设定平面的映射,O点为用户当前所在位置,也是坐标系的原点。Among them, point A is the mapping of the marked point on the set plane, and point O is the user's current location, which is also the origin of the coordinate system.

外边距获取单元213,用于在设定平面以正北方向为纵坐标的正方向,设定平面的中心为原点的坐标系中,获取设定平面和屏幕之间的外边距。The margin obtaining unit 213 is configured to obtain the margin between the setting plane and the screen in a coordinate system with the north direction as the positive direction of the vertical coordinate of the setting plane and the center of the setting plane as the origin.

本实施例中,外边距获取单元213将用户当前所在位置映射到设定平面的中心建立坐标系,其中,正北方向为纵坐标的正方向,在建立的坐标系中获取设定平面的边界相对于屏幕中相邻的两条边界的外边距,即获取的外边距包括了横向外边距和纵向外边距,如图15所示,设定平面1510为圆形,屏幕1530所在的平面与设定平面1510之间的外边距包括了横向外边距tx和纵向外边距ty。In this embodiment, the margin acquisition unit 213 maps the user's current location to the center of the set plane to establish a coordinate system, wherein the north direction is the positive direction of the vertical coordinate, and obtains the margins of the boundary of the set plane relative to the two adjacent boundaries in the screen in the established coordinate system, that is, the obtained margins include the horizontal margins and the vertical margins. As shown in Figure 15, the set plane 1510 is a circle, and the margins between the plane where the screen 1530 is located and the set plane 1510 include the horizontal margin tx and the vertical margin ty.

偏移值计算单元215,用于将当前所在位置映射到坐标系的原点,通过外边距、像素距离和标记点的位置计算得到标记点映射到设定平面的第二偏移值。The offset value calculation unit 215 is used to map the current position to the origin of the coordinate system, and calculate the second offset value of the marker point mapped to the set plane through the outer margin, pixel distance and the position of the marker point.

本实施例中,在建立的坐标系中,偏移值计算单元215通过外边距、像素距离和标记点的位置进行几何变换以计算得到标记点映射到设定平面的第二偏移值,该第二偏移值是标记点相对于屏幕中相邻的两条边界的距离,包括第二横向偏移值和第二纵向偏移值。In this embodiment, in the established coordinate system, the offset value calculation unit 215 performs a geometric transformation through the outer margin, pixel distance and position of the marker point to calculate the second offset value of the marker point mapped to the set plane. The second offset value is the distance between the marker point and the two adjacent boundaries in the screen, including a second horizontal offset value and a second vertical offset value.

请结合参阅图15,点A为标记点到坐标系中的映射,r为圆形的设定平面所对应的半径,tx为横向外边距,ty为纵向外边距。为在设定平面中描绘标记点,偏移值计算单元215将首先根据标记点的位置得到对应的方位角,并逆转方位角,以便于计算,即方位角NOA=360-NOA,则任一标记点的第二横向偏移值left和第二纵向偏移值top可由如下公式计算得到:Please refer to Figure 15 , where point A is the mapping of the marker point to the coordinate system, r is the radius of the circular plane, tx is the horizontal margin, and ty is the vertical margin. To depict the marker point in the plane, the offset calculation unit 215 first obtains the corresponding azimuth angle based on the position of the marker point and reverses the azimuth angle for easier calculation, i.e., azimuth angle NOA = 360 - NOA. The second horizontal offset value left and the second vertical offset value top of any marker point can be calculated using the following formula:

left=r-OA*sin(NOA)+tx;left=r-OA*sin(NOA)+tx;

top=r-OA*cos(NOA)+ty。top=r-OA*cos(NOA)+ty.

其中,OA为像素距离。Where OA is the pixel distance.

在一个实施例中,该设定平面为圆形,上述第二映射模块210还用于对映射到设定平面之外的标记点,根据设定平面的半径、标记点的位置和外边距离计算得到对应的第二偏移修正值。In one embodiment, the set plane is circular, and the second mapping module 210 is further configured to calculate a corresponding second offset correction value for a marker point mapped outside the set plane according to the radius of the set plane, the position of the marker point, and the outer distance.

本实施例中,并非地理数据中所有的标记点均能够映射到设定平面之内,因此,对于映射到设定平面之外的标记点,第二映射模块210将对其第二偏移值进行修正,以使得映射到设定平面之外的标记点均被展示于设定平面边缘,使得用户在设定平面上也能够查看到该标记点,以获知其所在的方位。In this embodiment, not all marker points in the geographic data can be mapped within the set plane. Therefore, for the marker points mapped outside the set plane, the second mapping module 210 will correct their second offset values so that the marker points mapped outside the set plane are displayed at the edge of the set plane, so that the user can also view the marker point on the set plane to know its location.

具体的,映射到设定平面之外的标记点的修正可通过如下公式实现:Specifically, the correction of the marker points mapped outside the set plane can be achieved by the following formula:

eleft=r-r*sin(NOA)+tx;eleft=r-r*sin(NOA)+tx;

etop=r-r*cos(NOA)+ty。etop=r-r*cos(NOA)+ty.

其中,eleft为第二横向偏移修正值,etop为第二纵向偏移修正值,NOA为一次逆转后的方位角。Wherein, eleft is the second lateral offset correction value, etop is the second longitudinal offset correction value, and NOA is the azimuth after one reversal.

如图24所示,在一个实施例中,上述标记点分布模块230包括第二偏移值获取单元231、第二偏移值描点单元233和显示单元235。As shown in FIG. 24 , in one embodiment, the marking point distribution module 230 includes a second offset value acquiring unit 231 , a second offset value plotting unit 233 , and a display unit 235 .

第二偏移值获取单元231,用于获取映射到设定平面之内的标记点对应的第二偏移值。The second offset value acquiring unit 231 is configured to acquire a second offset value corresponding to a marking point mapped into a set plane.

本实施例中,第二偏移值获取单元231对设定平面之内的标记点获取第二横向偏移值和第二纵向偏移值。In this embodiment, the second offset value acquiring unit 231 acquires a second transverse offset value and a second longitudinal offset value for a marking point within a set plane.

第二偏移值描点单元233,用于按照第二偏移值在设定平面描点。The second offset value plotting unit 233 is used to plot points on the set plane according to the second offset value.

本实施例中,第二偏移值描点单元233在设定平面中按照第二横向偏移值和第二纵向偏移值进行绘图,以得到设定平面之内所有标记点的雷达缩略图,进而向用户展示一定范围之内所有标记点的分布。In this embodiment, the second offset value plotting unit 233 plots in the set plane according to the second horizontal offset value and the second vertical offset value to obtain a radar thumbnail of all marked points within the set plane, thereby showing the user the distribution of all marked points within a certain range.

显示单元235,用于显示描点得到的雷达缩略图。The display unit 235 is used to display the radar thumbnail obtained by plotting points.

如图25所示,在一个实施例中,上述标记点分布模块230还包括象限确定单元237、对比单元238和实际偏移值描点单元239。As shown in FIG. 25 , in one embodiment, the marker point distribution module 230 further includes a quadrant determination unit 237 , a comparison unit 238 , and an actual offset value plotting unit 239 .

象限确定单元237,用于根据映射到设定平面之外的标记点映射到坐标系对应的象限。The quadrant determining unit 237 is configured to map the marker points mapped outside the set plane to the corresponding quadrant of the coordinate system.

本实施例中,为使得映射到设定平面之外的标记点不漂移到设定平面之外,对于映射到设定平面之外的标记点,象限确定单元237将根据其位置获取对应的方位角得到标记点的映射在坐标系的象限。In this embodiment, in order to prevent the marking points mapped outside the set plane from drifting outside the set plane, for the marking points mapped outside the set plane, the quadrant determination unit 237 will obtain the corresponding azimuth angle according to its position to obtain the quadrant of the mapping of the marking point in the coordinate system.

对比单元238,用于按照象限对比映射点的第二偏移值和第二偏移修正值得到实际偏移值。The comparing unit 238 is configured to compare the second offset value and the second offset correction value of the mapping point according to the quadrant to obtain the actual offset value.

本实施例中,对比单元238按方位角NOA所在象限对第二偏移值和第二偏移修正值进行对比以得到实际偏移值,相应的,该实际偏移值包括横向实际偏移值和纵向实际偏移值,具体的:In this embodiment, the comparison unit 238 compares the second offset value and the second offset correction value according to the quadrant where the azimuth angle NOA is located to obtain an actual offset value. Accordingly, the actual offset value includes a horizontal actual offset value and a vertical actual offset value. Specifically:

当NOA/90等于0时,实际横向偏移值left=max(left,eleft),实际纵向偏移值top=max(top,etop)。When NOA/90 is equal to 0, the actual lateral offset value left=max(left,eleft), and the actual longitudinal offset value top=max(top,etop).

当NOA/90等于1时,实际横向偏移值left=max(left,eleft),实际纵向偏移值top=min(top,etop)。When NOA/90 is equal to 1, the actual lateral offset value left=max(left,eleft), and the actual longitudinal offset value top=min(top,etop).

当NOA/90等于2时,实际横向偏移值left=min(left,eleft),实际纵向偏移值top=min(top,etop)。When NOA/90 is equal to 2, the actual lateral offset value left=min(left,eleft), and the actual longitudinal offset value top=min(top,etop).

当NOA/90等于3时,实际横向偏移值left=min(left,eleft),实际纵向偏移值top=max(top,etop)。When NOA/90 is equal to 3, the actual lateral offset value left=min(left,eleft), and the actual longitudinal offset value top=max(top,etop).

实际偏移值描点单元239,用于按照实际偏移值在设定平面描点。The actual offset value plotting unit 239 is used to plot points on the set plane according to the actual offset value.

本实施例中,对比得到标记点的实际偏移值之后,实际偏移值描点单元239即可按照实际偏移值在设定平面中渲染描点,以得到大致显示映射到设定平面之外的标记点的分布的雷达缩略图。In this embodiment, after comparing and obtaining the actual offset values of the marker points, the actual offset value plotting unit 239 can render the plotted points in the set plane according to the actual offset values to obtain a radar thumbnail that roughly shows the distribution of the marker points mapped outside the set plane.

上述实现位置服务的装置,通过雷达缩略图实现一定区域内的全视角标记点分布和方位的展示,进而使得用户通过雷达缩略图掌控该区域内的所有地理位置信息,以实现了该区域内的地理位置服务。The above-mentioned device for realizing location service realizes the display of the distribution and orientation of full-view marker points in a certain area through radar thumbnails, thereby allowing users to grasp all geographic location information in the area through radar thumbnails, thereby realizing geographic location service in the area.

上述实现位置服务的装置中,通过对地理数据的标记点进行两次不同方式的映射而分别得到当前用户视野内的标记点分布和展示全视角标记点分布的雷达缩略图,进而还可获取相应的位置服务信息,以标记于当前用户视野内的标记点分布中,也可标记于雷达缩略图中,为用户提供更为丰富的信息。In the above-mentioned device for implementing location services, the marker points of geographic data are mapped twice in different ways to obtain the marker point distribution within the current user's field of view and the radar thumbnail showing the full-view marker point distribution. Corresponding location service information can also be obtained to mark the marker point distribution within the current user's field of view, or to mark it in the radar thumbnail, providing users with richer information.

由于上述实现位置服务的装置可通过HTML5实现,因此不需要安装额外的插件即可实现,大大地降低了系统资源的耗费。Since the above-mentioned device for implementing location services can be implemented through HTML5, it can be implemented without installing additional plug-ins, which greatly reduces the consumption of system resources.

上述实现位置服务的装置中,对屏幕所在平面绘制视野中标记点的分布或者雷达缩略图的绘制均是通过模拟线程实现的。具体的,上述实现位置服务的方法可通过HTML5中的JS(Javascript)语言实现,由于JS语言本质上并不支持多进程,因此,将通过一个单独的进程执行上述实现位置服务的方法,并通过调用setTimeout触发标记点的绘制功能,setTimeout即称为是模拟线程,进而使得标记点的绘制看似与当前的进程同时执行。In the aforementioned device for implementing location-based services, the distribution of markers in the field of view or the drawing of a radar thumbnail on the screen plane is achieved through simulated threads. Specifically, the aforementioned method for implementing location-based services can be implemented using the JavaScript (JS) language within HTML5. Because JavaScript does not inherently support multiple processes, the aforementioned method for implementing location-based services is executed in a separate process, and the marker drawing function is triggered by calling setTimeout. setTimeout is known as simulated threading, which makes the marker drawing appear to be executed simultaneously with the current process.

上述实现位置服务的方法和装置,定位当前所在位置和磁北角,根据当前所在位置获取对应的地理数据,在地理数据中提取处于磁北角对应的角度范围的标记点和标记点的位置,处理提取的标记点和标记点的位置,以将标记点显示于屏幕中,由于用户当前所在的方位进行了定位以得到相应的磁北角,并且显示于屏幕中的标记点也是根据磁北角进行提取得到的,因此,实现了用户当前所在的方位的识别,进而根据用户当前所在的方位进行了准确导航。The above-mentioned method and device for implementing location services locate the current location and the magnetic north angle, obtain corresponding geographic data based on the current location, extract markers and the positions of the markers within the angle range corresponding to the magnetic north angle from the geographic data, process the extracted markers and the positions of the markers to display the markers on the screen. Since the user's current location is located to obtain the corresponding magnetic north angle, and the markers displayed on the screen are also extracted based on the magnetic north angle, the user's current location is identified, and accurate navigation is then performed based on the user's current location.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium, and when executed, the program can include the processes in the above-described method embodiments. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

本发明实施例还提供了另一种实现位置服务的终端,如图25所示,为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以终端为手机为例:The present invention also provides another terminal for implementing location-based services, as shown in Figure 25. For ease of explanation, only the portion relevant to the present invention is shown. For specific technical details not disclosed, please refer to the method section of the present invention. The terminal can be any terminal device, including a mobile phone, tablet computer, PDA (Personal Digital Assistant), POS (Point of Sales), in-vehicle computer, etc. Taking a mobile phone as an example:

图26示出的是与本发明实施例提供的终端相关的手机的部分结构的框图。参考图26,手机包括:射频(Radio Frequency,RF)电路2610、存储器2620、输入单元2630、显示单元2640、传感器2650、音频电路2660、无线保真(wireless fidelity,WiFi)模块2670、处理器2680、以及电源2690等部件。本领域技术人员可以理解,图26中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Figure 26 is a block diagram of a portion of the structure of a mobile phone related to a terminal provided by an embodiment of the present invention. Referring to Figure 26 , the mobile phone includes components such as a radio frequency (RF) circuit 2610, a memory 2620, an input unit 2630, a display unit 2640, a sensor 2650, an audio circuit 2660, a wireless fidelity (WiFi) module 2670, a processor 2680, and a power supply 2690. Those skilled in the art will appreciate that the mobile phone structure shown in Figure 26 does not limit the mobile phone, and may include more or fewer components than shown, or combine certain components, or arrange the components differently.

下面结合图26对手机的各个构成部件进行具体的介绍:The following is a detailed introduction to the various components of the mobile phone in conjunction with Figure 26:

RF电路2610可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器2680处理;另外,将设计上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low NoiseAmplifier,LNA)、双工器等。此外,RF电路260还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(GlobalSystem of Mobile communication,GSM)、通用分组无线服务(General Packet RadioService,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。RF circuitry 2610 can be used to receive and transmit signals during messaging or phone calls. Specifically, it receives downlink information from the base station and passes it to processor 2680 for processing. It also transmits uplink data to the base station. Typically, RF circuitry includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, and the like. RF circuitry 260 can also communicate with the network and other devices via wireless communications. This wireless communication can utilize any communication standard or protocol, including but not limited to Global System of Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, and Short Messaging Service (SMS).

存储器2620可用于存储软件程序以及模块,处理器2680通过运行存储在存储器2620的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器2620可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器2620可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。Memory 2620 can be used to store software programs and modules. Processor 2680 executes the various functional applications and data processing functions of the mobile phone by running the software programs and modules stored in memory 2620. Memory 2620 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and at least one application required for a function (such as sound playback or image playback). The data storage area may store data generated based on the use of the mobile phone (such as audio data and a phone book). Memory 2620 may also include high-speed random access memory and non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state memory device.

输入单元2630可用于接收输入的数字或字符信息,以及产生与手机2600的用户设置以及功能控制有关的键信号输入。具体地,输入单元2630可包括触控面板2631以及其他输入设备2632。触控面板2631,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板2631上或在触控面板2631附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板2631可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器2680,并能接收处理器2680发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板2631。除了触控面板2631,输入单元2630还可以包括其他输入设备2632。具体地,其他输入设备2632可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 2630 is used to receive input digital or character information and generate key signal input related to user settings and function control of the mobile phone 2600. Specifically, the input unit 2630 may include a touch panel 2631 and other input devices 2632. The touch panel 2631, also known as a touch screen, detects user touch operations on or near it (for example, operations performed on or near the touch panel 2631 using a finger, stylus, or any other suitable object or accessory) and drives corresponding connected devices according to pre-set programs. Optionally, the touch panel 2631 may include a touch detection device and a touch controller. The touch detection device detects the user's touch position and detects signals generated by the touch operation, transmitting the signals to the touch controller. The touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then transmits it to the processor 2680. The touch controller can also receive and execute commands from the processor 2680. Furthermore, the touch panel 2631 can be implemented using various types of sensors, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 2631, the input unit 2630 may further include other input devices 2632. Specifically, the other input devices 2632 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power keys, etc.), a trackball, a mouse, and a joystick.

显示单元2640可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元2640可包括显示面板2641,可选的,可以采用液晶显示器(LiquidCrystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板2641。进一步的,触控面板2631可覆盖显示面板2641,当触控面板2631检测到在其上或附近的触摸操作后,传送给处理器2680以确定触摸事件的类型,随后处理器2680根据触摸事件的类型在显示面板2641上提供相应的视觉输出。虽然在图26中,触控面板2631与显示面板2641是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板2631与显示面板2641集成而实现手机的输入和输出功能。The display unit 2640 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 2640 may include a display panel 2641. Optionally, the display panel 2641 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Furthermore, a touch panel 2631 may overlay the display panel 2641. When the touch panel 2631 detects a touch operation on or near it, it transmits the information to the processor 2680 to determine the type of touch event. The processor 2680 then provides a corresponding visual output on the display panel 2641 based on the type of touch event. Although in Figure 26, the touch panel 2631 and the display panel 2641 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 2631 and the display panel 2641 can be integrated to implement the input and output functions of the mobile phone.

手机2600还可包括至少一种传感器2650,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板2641的亮度,接近传感器可在手机移动到耳边时,关闭显示面板2641和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The mobile phone 2600 may also include at least one sensor 2650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor may adjust the brightness of the display panel 2641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 2641 and/or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes) and the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as switching between horizontal and vertical screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described in detail here.

音频电路2660、扬声器2661,传声器2662可提供用户与手机之间的音频接口。音频电路2660可将接收到的音频数据转换后的电信号,传输到扬声器2661,由扬声器2661转换为声音信号输出;另一方面,传声器2662将收集的声音信号转换为电信号,由音频电路2660接收后转换为音频数据,再将音频数据输出处理器2680处理后,经RF电路2610以发送给比如另一手机,或者将音频数据输出至存储器2620以便进一步处理。Audio circuit 2660, speaker 2661, and microphone 2662 provide an audio interface between the user and the phone. Audio circuit 2660 converts received audio data into electrical signals and transmits them to speaker 2661, which then converts them into sound signals for output. Microphone 2662, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 2660 and converted into audio data. The audio data is then processed by processor 2680 and then transmitted to, for example, another phone via RF circuit 2610. Alternatively, the audio data can be stored in memory 2620 for further processing.

WiFi属于短距离无线传输技术,手机通过WiFi模块2670可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图26示出了WiFi模块2670,但是可以理解的是,其并不属于手机2600的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。WiFi is a short-range wireless transmission technology. A mobile phone uses WiFi module 2670 to help users send and receive emails, browse the web, and access streaming media, providing wireless broadband Internet access. Although FIG26 illustrates WiFi module 2670, it is understood that it is not a required component of mobile phone 2600 and can be omitted as needed without changing the essence of the invention.

处理器2680是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器2620内的软件程序和/或模块,以及调用存储在存储器2620内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器2680可包括一个或多个处理单元;优选的,处理器2680可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器2680中。Processor 2680 is the control center of the phone, connecting all parts of the phone using various interfaces and circuits. By running or executing software programs and/or modules stored in memory 2620 and accessing data stored in memory 2620, it performs various phone functions and processes data, thereby providing overall monitoring of the phone. Optionally, processor 2680 may include one or more processing units; preferably, processor 2680 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 2680.

手机2600还包括给各个部件供电的电源2690(比如电池),优选的,电源可以通过电源管理系统与处理器2680逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 2600 also includes a power supply 2690 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 2680 through a power management system, thereby managing charging, discharging, and power consumption through the power management system.

尽管未示出,手机2600还可以包括摄像头、蓝牙模块等,在此不再赘述。Although not shown, the mobile phone 2600 may also include a camera, a Bluetooth module, etc., which will not be described in detail here.

在本发明实施例中,该终端所包括的处理器2680还具有以下功能:In this embodiment of the present invention, the processor 2680 included in the terminal further has the following functions:

定位当前所在位置和磁北角;Locate the current location and magnetic north angle;

根据当前所在位置获取对应的地理数据;Get the corresponding geographic data based on the current location;

在地理数据中根据磁北角提取视野的标记点和标记点的位置;Extract the marker points of the field of view and the positions of the marker points according to the magnetic north angle in the geographic data;

处理提取的标记点和标记点的位置,以将标记点显示于屏幕中。The extracted marker points and the positions of the marker points are processed to display the marker points on the screen.

进一步的,在地理数据中根据磁北角提取视野的标记点和标记点的位置的步骤包括:Furthermore, the step of extracting the mark points of the field of view and the positions of the mark points according to the magnetic north angle in the geographic data includes:

根据地理数据中标记点的位置得到标记点对应的方位角;Obtain the azimuth corresponding to the marker point according to the position of the marker point in the geographic data;

根据磁北角得到所处的角度状态,通过角度状态所对应的角度条件和方位角判断标记点是否位于磁北角对应的视野,若是,则According to the magnetic north angle, the angle state is obtained. The angle condition and azimuth corresponding to the angle state are used to determine whether the mark point is in the field of view corresponding to the magnetic north angle. If so,

提取标记点和标记点的位置。Extract the markers and their locations.

进一步的,处理提取的标记点和标记点的位置,以将标记点显示于屏幕中的步骤包括:Furthermore, the step of processing the extracted marker points and their positions to display the marker points on the screen includes:

将当前所在位置对应于屏幕中预设的固定点,并根据标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将提取的标记点映射到屏幕所在平面得到标记点对应的第一偏移值;The current location corresponds to a preset fixed point on the screen, and the extracted marker point is mapped to the plane of the screen according to the location of the marker point, the current location, and the maximum width between the marker points in the geographic data to obtain a first offset value corresponding to the marker point;

按照标记点对应的第一偏移值进行绘图,并显示于屏幕中。Drawing is performed according to the first offset value corresponding to the marked point and displayed on the screen.

进一步的,根据当前所在位置获取对应的地理数据的步骤之后,该方法还包括:Furthermore, after the step of obtaining corresponding geographic data according to the current location, the method further includes:

将标记点映射到设定平面;Map the marker points to the set plane;

根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布。The distribution of the marker points on the set plane is displayed on the screen according to the mapping of the marker points on the set plane.

进一步的,将标记点映射到设定平面的步骤包括:Furthermore, the step of mapping the marker points to the set plane includes:

获取标记点和当前所在位置之间的地理距离,并将地理距离转换为标记点在设定平面中的像素距离;Get the geographic distance between the marker point and the current location, and convert the geographic distance into the pixel distance of the marker point in the set plane;

在设定平面以正北方向为纵坐标的正方向,设定平面的中心为原点的坐标系中,获取设定平面和屏幕之间的外边距;Get the outer margin between the setting plane and the screen in a coordinate system with the north direction as the positive direction of the vertical coordinate of the setting plane and the center of the setting plane as the origin;

将当前所在位置映射到坐标系的原点,通过外边距、像素距离和标记点的位置计算得到标记点映射到设定平面的第二偏移值。The current position is mapped to the origin of the coordinate system, and the second offset value of the marker point mapped to the set plane is calculated by the outer margin, pixel distance and position of the marker point.

进一步的,该设定平面为圆形,将当前所在位置映射到坐标系的原点,通过外边距、像素距离和标记点的位置计算得到标记点映射到设定平面的第二偏移值的步骤之后,该方法还包括:Furthermore, the plane is set to be circular, and after the step of mapping the current position to the origin of the coordinate system and calculating a second offset value for mapping the marker point to the set plane by using the outer margin, the pixel distance, and the position of the marker point, the method further includes:

对映射到设定平面之外的标记点,根据设定平面的半径、标记点的位置和外边距计算得到对应的第二偏移修正值。For a marking point mapped outside the set plane, a corresponding second offset correction value is calculated based on the radius of the set plane, the position of the marking point, and the outer margin.

进一步的,根据标记点在设定平面的映射在屏幕显示标记点在设定平面的分布的步骤包括:Furthermore, the step of displaying the distribution of the marker points on the set plane on the screen according to the mapping of the marker points on the set plane includes:

获取映射到设定平面之内的标记点对应的第二偏移值;Obtain a second offset value corresponding to the marker point mapped within the set plane;

按照第二偏移值在设定平面描点;Draw points on the set plane according to the second offset value;

显示描点得到的雷达缩略图。Displays a radar thumbnail obtained by plotting points.

进一步的,显示描点得到的雷达缩略图的步骤之前还包括:Furthermore, before the step of displaying the radar thumbnail obtained by tracing the points, the following steps are further included:

根据映射到设定平面之外的标记点的位置确定标记点映射到坐标系所对应的象限;Determine the quadrant corresponding to the coordinate system to which the marker point is mapped according to the position of the marker point mapped outside the set plane;

按照象限对比映射点的第二偏移值和第二偏移修正值得到实际偏移值;Comparing the second offset value and the second offset correction value of the mapping point by quadrant to obtain the actual offset value;

按照实际偏移值在设定平面描点。Draw points on the set plane according to the actual offset value.

以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.

Claims (18)

1.一种实现位置服务的方法,包括如下步骤:1. A method for implementing location services, comprising the following steps: 定位当前所在位置和磁北角;Locate your current position and magnetic north corner; 根据当前所在位置获取对应的地理数据;Obtain the corresponding geographic data based on the current location; 在地理数据中根据所述磁北角提取视野的标记点和所述标记点的位置;The geographic data is used to extract the field of view markers and their locations based on the magnetic north angle; 处理所述提取的标记点和所述标记点的位置,以将所述标记点显示于屏幕中,包括:根据所述标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将所述标记点显示于屏幕中。Processing the extracted markers and their positions to display them on the screen includes: displaying the markers on the screen based on their positions, current locations, and the maximum width between markers in the geographic data. 2.根据权利要求1所述的方法,其特征在于,所述在地理数据中根据所述磁北角提取视野的标记点和所述标记点的位置的步骤包括:2. The method according to claim 1, characterized in that the step of extracting the field-of-view markers and the positions of the markers from the geographic data based on the magnetic north angle includes: 根据地理数据中标记点的位置得到所述标记点对应的方位角;The azimuth angle corresponding to the marked point is obtained based on the location of the marked point in the geographic data; 根据所述磁北角得到所处的角度状态,通过所述角度状态所对应的角度条件和方位角判断所述标记点是否位于所述磁北角对应的视野,若是,则Based on the magnetic north angle, the angular state is obtained. Using the corresponding angular conditions and azimuth, it is determined whether the marker point is within the field of view corresponding to the magnetic north angle. If so, then... 提取所述标记点和所述标记点的位置。Extract the marker points and their positions. 3.根据权利要求1所述的方法,其特征在于,所述处理所述提取的标记点和所述标记点的位置,以将所述标记点显示于屏幕中的步骤包括:3. The method according to claim 1, wherein the step of processing the extracted marker points and the positions of the marker points to display the marker points on the screen includes: 将当前所在位置对应于屏幕中预设的固定点,并根据所述标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将所述提取的标记点映射到屏幕所在平面得到所述标记点对应的第一偏移值,偏移值是指标记点相对于屏幕中相邻的两条边界的距离;The current location is mapped to a preset fixed point on the screen, and the extracted marker point is mapped to the plane of the screen according to the position of the marker point, the current location and the maximum width between the marker points in the geographic data to obtain the first offset value corresponding to the marker point. The offset value refers to the distance of the marker point relative to two adjacent boundaries on the screen. 按照所述标记点对应的第一偏移值进行绘图,并显示于屏幕中。The drawing is performed according to the first offset value corresponding to the marked point and displayed on the screen. 4.根据权利要求1所述的方法,其特征在于,所述根据当前所在位置获取对应的地理数据的步骤之后,所述方法还包括:4. The method according to claim 1, characterized in that, after the step of obtaining the corresponding geographic data based on the current location, the method further includes: 将地理数据中的标记点映射到设定平面;Map markers in geographic data to a defined plane; 根据所述标记点在设定平面的映射在屏幕显示所述标记点在设定平面的分布。The distribution of the marker points on the set plane is displayed on the screen according to the mapping of the marker points on the set plane. 5.根据权利要求4所述的方法,其特征在于,所述将所述标记点映射到设定平面的步骤包括:5. The method according to claim 4, wherein the step of mapping the marker point to a set plane comprises: 获取所述标记点和当前所在位置之间的地理距离,并将所述地理距离转换为所述标记点在所述设定平面中的像素距离;Obtain the geographic distance between the marker point and its current location, and convert the geographic distance into the pixel distance of the marker point in the defined plane; 在所述设定平面以正北方向为纵坐标的正方向,设定平面的中心为原点的坐标系中,获取所述设定平面和屏幕之间的外边距;In a coordinate system with the north direction as the positive direction of the set plane and the center of the set plane as the origin, obtain the outer margin between the set plane and the screen; 将当前所在位置映射到所述坐标系的原点,通过所述外边距、像素距离和标记点的位置计算得到所述标记点映射到设定平面的第二偏移值,偏移值是指标记点相对于屏幕中相邻的两条边界的距离。The current position is mapped to the origin of the coordinate system. The second offset value of the marker point mapped to the set plane is calculated using the outer margin, pixel distance and the position of the marker point. The offset value refers to the distance of the marker point relative to the two adjacent boundaries on the screen. 6.根据权利要求5所述的方法,其特征在于,所述设定平面为圆形,所述将当前所在位置映射到所述坐标系的原点,通过所述外边距、像素距离和标记点的位置计算得到所述标记点映射到设定平面的第二偏移值的步骤之后,所述方法还包括:6. The method according to claim 5, wherein the set plane is circular, and after the step of mapping the current position to the origin of the coordinate system and calculating the second offset value of the marker point mapped to the set plane using the outer margin, pixel distance, and the position of the marker point, the method further includes: 对映射到设定平面之外的标记点,根据所述设定平面的半径、标记点的位置和外边距计算得到对应的第二偏移修正值。For marker points mapped outside the set plane, the corresponding second offset correction value is calculated based on the radius of the set plane, the position of the marker point, and the outer margin. 7.根据权利要求6所述的方法,其特征在于,所述根据所述标记点在设定平面的映射在屏幕显示所述标记点在设定平面的分布的步骤包括:7. The method according to claim 6, wherein the step of displaying the distribution of the marker points on the set plane on the screen according to the mapping of the marker points on the set plane includes: 获取映射到所述设定平面之内的标记点对应的第二偏移值;Obtain the second offset value corresponding to the marker point mapped to the set plane; 按照所述第二偏移值在所述设定平面描点;Plot points on the designated plane according to the second offset value; 显示所述描点得到的雷达缩略图。The radar thumbnail obtained by plotting the points is displayed. 8.根据权利要求7所述的方法,其特征在于,所述显示所述描点得到的雷达缩略图的步骤之前还包括:8. The method according to claim 7, characterized in that, before the step of displaying the radar thumbnail obtained by plotting the points, it further comprises: 根据映射到设定平面之外的标记点的位置确定所述标记点映射到坐标系所对应的象限;The quadrant of the coordinate system to which the marker point is mapped is determined based on the position of the marker point mapped outside the set plane; 按照所述象限对比映射点的第二偏移值和第二偏移修正值得到实际偏移值;The actual offset value is obtained by comparing the second offset value and the second offset correction value of the quadrant comparison mapping point; 按照所述实际偏移值在所述设定平面描点。Plot points on the designated plane according to the actual offset value. 9.一种实现位置服务的装置,其特征在于,包括:9. An apparatus for implementing location services, characterized in that it comprises: 定位模块,用于定位当前所在位置和磁北角;The positioning module is used to determine the current location and magnetic north. 数据获取模块,用于根据当前所在位置获取对应的地理数据;The data acquisition module is used to acquire corresponding geographic data based on the current location; 提取模块,用于在地理数据中根据所述磁北角提取视野的标记点和所述标记点的位置;The extraction module is used to extract the field-of-view markers and the positions of the markers from the geographic data based on the magnetic north angle; 处理模块,用于处理所述提取的标记点和所述标记点的位置,以将所述标记点显示于屏幕中,包括:根据所述标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将所述标记点显示于屏幕中。The processing module is used to process the extracted marker points and the positions of the marker points in order to display the marker points on the screen, including: displaying the marker points on the screen according to the position of the marker points, the current location, and the maximum width between marker points in the geographic data. 10.根据权利要求9所述的装置,其特征在于,所述提取模块包括:10. The apparatus according to claim 9, wherein the extraction module comprises: 方位角获取单元,用于根据地理数据中标记点的位置得到所述标记点对应的方位角;Azimuth angle acquisition unit is used to obtain the azimuth angle corresponding to the marker point based on the position of the marker point in the geographic data; 标记点判定单元,用于根据所述磁北角得到所处的角度状态,通过所述角度状态所对应的角度条件和方位角判断所述标记点是否位于所述磁北角对应的视野,若是,则通知标记点提取单元;The marker point determination unit is used to determine whether the marker point is located in the field of view corresponding to the magnetic north angle based on the angle state obtained from the magnetic north angle and the angle condition and azimuth angle corresponding to the angle state. If so, the marker point extraction unit is notified. 所述标记点提取单元用于提取所述标记点和所述标记点的位置。The marker extraction unit is used to extract the marker points and their positions. 11.根据权利要求9所述的装置,其特征在于,所述处理模块包括:11. The apparatus according to claim 9, wherein the processing module comprises: 第一映射单元,用于将当前所在位置对应于屏幕中预设的固定点,并根据所述标记点的位置、当前所在位置和地理数据中标记点之间的最大宽度将所述提取的标记点映射到屏幕所在平面得到所述标记点对应的第一偏移值,偏移值是指标记点相对于屏幕中相邻的两条边界的距离;The first mapping unit is used to map the current location to a preset fixed point on the screen, and to map the extracted marker point to the plane of the screen according to the position of the marker point, the current location and the maximum width between marker points in the geographic data to obtain the first offset value corresponding to the marker point. The offset value refers to the distance of the marker point relative to two adjacent boundaries on the screen. 绘图单元,用于按照所述标记点对应的第一偏移值进行绘图,并显示于屏幕中。The drawing unit is used to draw according to the first offset value corresponding to the marked point and display it on the screen. 12.根据权利要求9所述的装置,其特征在于,所述装置还包括:12. The apparatus according to claim 9, wherein the apparatus further comprises: 第二映射模块,用于将地理数据中的标记点映射到设定平面;The second mapping module is used to map marker points in geographic data to a defined plane. 标记点分布模块,用于根据所述标记点在设定平面的映射在屏幕显示所述标记点在设定平面的分布。The marker distribution module is used to display the distribution of the marker points on the set plane on the screen according to the mapping of the marker points on the set plane. 13.根据权利要求12所述的装置,其特征在于,所述第二映射模块包括:13. The apparatus according to claim 12, wherein the second mapping module comprises: 距离处理单元,用于获取所述标记点和当前所在位置之间的地理距离,并将地理距离转换为所述标记点在所述设定平面中的像素距离;A distance processing unit is used to obtain the geographic distance between the marker point and its current location, and convert the geographic distance into the pixel distance of the marker point in the set plane; 外边距获取单元,用于在所述设定平面以正北方向为纵坐标的正方向,设定平面的中心为原点的坐标系中,获取所述设定平面和屏幕之间的外边距;The outer margin acquisition unit is used to acquire the outer margin between the set plane and the screen in a coordinate system with the north direction as the positive direction of the set plane and the center of the set plane as the origin. 偏移值计算单元,用于将当前所在位置映射到所述坐标系的原点,通过所述外边距、像素距离和标记点的位置计算得到所述标记点映射到设定平面的第二偏移值,偏移值是指标记点相对于屏幕中相邻的两条边界的距离。The offset calculation unit is used to map the current position to the origin of the coordinate system. It calculates the second offset value of the marker point mapped to the set plane by using the outer margin, pixel distance and the position of the marker point. The offset value refers to the distance of the marker point relative to two adjacent boundaries on the screen. 14.根据权利要求13所述的装置,其特征在于,所述设定平面为圆形,所述第二映射模块还用于对映射到设定平面之外的标记点,根据所述设定平面的半径、标记点的位置和外边距计算得到对应的第二偏移修正值。14. The apparatus according to claim 13, wherein the set plane is circular, and the second mapping module is further configured to calculate a corresponding second offset correction value for the marker points mapped outside the set plane based on the radius of the set plane, the position of the marker points, and the outer margin. 15.根据权利要求14所述的装置,其特征在于,所述标记点分布模块包括:15. The apparatus according to claim 14, wherein the marker distribution module comprises: 第二偏移值获取单元,用于获取映射到所述设定平面之内的标记点对应的第二偏移值;The second offset value acquisition unit is used to acquire the second offset value corresponding to the marker point mapped to the set plane; 第二偏移值描点单元,用于按照所述第二偏移值在所述设定平面描点;The second offset value plotting unit is used to plot points on the set plane according to the second offset value; 显示单元,用于显示所述描点得到的雷达缩略图。The display unit is used to display the radar thumbnail obtained by the plotting points. 16.根据权利要求15所述的装置,其特征在于,所述标记点分布模块还包括:16. The apparatus according to claim 15, wherein the marker distribution module further comprises: 象限确定单元,用于根据映射到设定平面之外的标记点映射到坐标系对应的象限;The quadrant determination unit is used to map marker points mapped to outside the set plane to the corresponding quadrant of the coordinate system; 对比单元,用于按照所述象限对比映射点的第二偏移值和第二偏移修正值得到实际偏移值;The comparison unit is used to obtain the actual offset value by comparing the second offset value and the second offset correction value of the mapping point according to the quadrant; 实际偏移值描点单元,用于按照所述实际偏移值在所述设定平面描点。The actual offset value plotting unit is used to plot points on the set plane according to the actual offset value. 17.一种终端,其特征在于,包括存储器和处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行权利要求1至8中任一项权利要求所述实现位置服务的方法的步骤。17. A terminal, characterized in that it comprises a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the method for implementing location services as claimed in any one of claims 1 to 8. 18.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至8中任一项权利要求所述实现位置服务的方法的步骤。18. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program causes the processor to perform the steps of the method for implementing location services as claimed in any one of claims 1 to 8.
HK15104740.8A 2015-05-19 Method and device for providing location services HK1204043B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310430953.7A CN104457767B (en) 2013-09-18 2013-09-18 The method and apparatus for realizing location-based service

Publications (2)

Publication Number Publication Date
HK1204043A1 HK1204043A1 (en) 2015-11-06
HK1204043B true HK1204043B (en) 2019-11-08

Family

ID=

Similar Documents

Publication Publication Date Title
US9377316B2 (en) Method and device for providing location services
TWI606416B (en) Method, terminal and system for sharing geographic position
KR101233534B1 (en) Graphical user interface for presenting location information
JP5916261B2 (en) File transmission method, system, and control apparatus
US11394871B2 (en) Photo taking control method and system based on mobile terminal, and storage medium
CN107943489B (en) Data sharing method and mobile terminal
US20150082231A1 (en) Method and terminal for displaying desktop
US20150002539A1 (en) Methods and apparatuses for displaying perspective street view map
EP3355596B1 (en) Positioning information processing method and apparatus
CN103080933A (en) Methods, apparatuses and computer program products for providing a constant level of information in augmented reality
WO2015109906A1 (en) Method, device, and terminal for simultaneously displaying multiple users' locations on a map cross-reference to related applications
CN108337368A (en) A kind of update method and mobile terminal of location data
KR101848696B1 (en) A method of superimposing location information on a collage,
JP2017509051A (en) Method and system for collecting statistics on streaming media data and associated apparatus
CN108592939A (en) A kind of air navigation aid and terminal
US10298590B2 (en) Application-based service providing method, apparatus, and system
CN105282692A (en) Speed measurement information display method and device
CN106204588B (en) Image processing method and device
WO2014206076A1 (en) Methods and apparatuses for displaying perspective street view map
US20160330587A1 (en) Information obtaining method, server, terminal, and system
CN105741599B (en) The display methods and device of information of vehicles
HK1204043B (en) Method and device for providing location services
CN110019583B (en) Environment display method and system based on virtual reality
CN114077471B (en) Information display method, target device, source device, system and storage medium
CN106933979A (en) A kind of position information processing method, device and mobile terminal