CN106454743B - Asynchronous acquisition method of geographic position - Google Patents
Asynchronous acquisition method of geographic position Download PDFInfo
- Publication number
- CN106454743B CN106454743B CN201611078316.8A CN201611078316A CN106454743B CN 106454743 B CN106454743 B CN 106454743B CN 201611078316 A CN201611078316 A CN 201611078316A CN 106454743 B CN106454743 B CN 106454743B
- Authority
- CN
- China
- Prior art keywords
- address information
- geographical
- location address
- geographical location
- geographic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 18
- 238000007792 addition Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000004083 survival effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/02—Services making use of location information
- H04W4/025—Services making use of location information using location based information parameters
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a geographic position asynchronous acquisition method, which is characterized in that a plurality of geographic anti-coding interfaces are arranged to acquire geographic position address information by using a locally stored geographic position coordinate point, so that the success rate and the accuracy of information acquisition are improved. The advantages of the invention are as follows: the method of the invention obtains the geographical position information in the threads of the geocoding and the geocoding by asynchronously obtaining the geographical position information, does not occupy the time of a main thread, has higher speed and is not blocked; the obtained geographic position realizes local storage (namely caching), and the latest geographic position information is cached in each local storage, so that the method can be reused, and the positioning speed and accuracy are improved.
Description
Technical Field
The invention relates to the technical field of geographic position information acquisition, in particular to a geographic position asynchronous acquisition method.
Background
The geographic position is a comprehensive information base which is continuously distributed in space and time and is formed by connecting various information in human survival and social activities. The geographical position coordinate point is represented by the longitude and latitude of the current position, and the specific geographical position address information is the information used as reference and needed in daily life of people.
At present, with the rapid development of the mobile internet technology, more and more applications are installed on a terminal, wherein an important part of the applications is Location Based Service (LBS) applications. The application can push some information to a client of the application installed on the terminal according to the geographic position of the terminal, such as interest points near the terminal, distance information between the interest points and the terminal, and the like, so that various services can be provided for a user according to the geographic position of the terminal.
However, when the LBS-based application pushes information to the client according to the geographical location of the terminal, if the geographical location information of the terminal cannot be obtained through the positioning operation, the information required by the user cannot be obtained and pushed to the client. Therefore, in the prior art, the reliability and the acquisition efficiency of the method for acquiring the geographical position information by completely relying on the positioning operation are low.
Disclosure of Invention
The invention aims to provide a geographic position asynchronous acquisition method aiming at the defects in the prior art.
In order to achieve the purpose, the invention adopts the technical scheme that: a geographic position asynchronous acquisition method comprises the following steps:
step 01: acquiring a locally stored geographic position coordinate point;
step 02: acquiring geographical position address information corresponding to the coordinate points through geographical inverse coding;
step 03: if the geographical location address information is successfully acquired, judging whether the acquired geographical location address information is valid, if so, performing memory caching on the geographical location address information corresponding to the geographical location coordinate point, updating the locally stored geographical location address information, and if not, starting the step 04;
step 04: and if the acquisition of the geographical location address information fails or the acquired geographical location address information is invalid, switching the interface of the geographical anti-coding immediately, and restarting the step 2.
Further, in step 02, it is determined whether the obtained geographic location address information is valid, including that the obtained geographic location address information satisfies that the priorities are city, assistant province unit, road, province, and country in sequence, and it is determined that the obtained geographic location address information is valid or not.
Further, the failure to acquire the geographic location address information includes that the acquired geographic location address information is null.
Furthermore, the service for acquiring the geographical location address information is performed in real time along with the update of the geographical location coordinate point, and the service for acquiring the geographical location address information is started after the locally stored geographical location coordinate point is updated each time.
The invention has the advantages that:
the method of the invention obtains the geographical position information in the threads of the geocoding and the geocoding by asynchronously obtaining the geographical position information, does not occupy the time of a main thread, has higher speed and is not blocked; the obtained geographic position realizes local storage (namely caching), and the latest geographic position information is cached in each local storage, so that the method can be reused, and the positioning speed and accuracy are improved.
Drawings
For a more complete understanding of the objects, features and advantages of the present invention, reference is now made to the following detailed description of the preferred embodiments of the invention, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of the method of the present invention.
Detailed Description
The method of the present invention will be further described with reference to the accompanying drawings.
As shown in fig. 1, the method for asynchronously acquiring a geographic location of the present invention includes the following steps:
step 01: acquiring a locally stored geographic position coordinate point; and (3) immediately starting a program for acquiring the geographical position address information after the geographical position coordinate point is acquired, namely starting the step 2.
Step 02: acquiring geographical position address information corresponding to the coordinate points through geographical inverse coding;
step 03: if the geographical location address information is successfully acquired, judging whether the acquired geographical location address information is valid; in this embodiment, preferably, the obtained geographic position coordinate point is used, and the geographic position address information corresponding to the coordinate point is obtained by using android. And if the returned geographical location address information is empty at the moment, the geographical location address information acquisition fails, the geographical anti-coding interface is switched, and the geographical location address information is continuously acquired by using a substitution scheme. If the returned geographic position address information is not null, the acquisition is successful, and then whether the acquired information is valid information or not is judged, namely whether the acquired geographic position address information meets the requirements that the priority is sequentially city, subsidiary provincial unit, road, province and country is judged, and if the priority is met and the returned fields are continuous legal readable fields, the information is valid information. After successfully obtaining effective geographical location address information, performing memory caching on the geographical location address information corresponding to the geographical location coordinate point, simultaneously updating the locally stored geographical location coordinate point, and starting a step 4 if the obtained geographical location information is invalid; the service for acquiring the geographical location address information is carried out along with the updating of the geographical location coordinate point, and the service for acquiring the geographical location address information is started after the locally stored geographical location coordinate point is updated each time.
Step 04: if the acquisition of the geographical position address information fails or the acquired geographical position address information is invalid, switching the interface of the geographical anti-coding immediately, and re-acquiring the geographical position address information corresponding to the coordinate point, namely restarting the step 2; in this embodiment, preferably, when the first scheme fails to acquire the geographic location address information, the scheme immediately switches to the use of the Google Maps Geocoding API to acquire the geographic location address information, the accuracy of successfully acquiring the valid information by the scheme is the second level of "address _ components" in the returned geographic location address information, and the language of the returned geographic location address information also follows the language used by the current system.
Preferably, if repeated acquisition of the geographic location address information fails or the acquired geographic location address information is invalid, the memory cache and the local storage are updated to an empty character string.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and additions can be made without departing from the method of the present invention, and these modifications and additions should also be regarded as the protection scope of the present invention.
Claims (3)
1. A geographic position asynchronous acquisition method is characterized by comprising the following steps:
step 01: acquiring a locally stored geographic position coordinate point, and starting a local geographic position address information acquisition program;
step 02: acquiring geographical position address information corresponding to the coordinate points through geographical inverse coding;
step 03: if the geographical location address information is successfully acquired, judging whether the acquired geographical location address information is valid, if the acquired geographical location address information meets the requirements that the priority is sequentially city, subsidiary province unit, road, province and country, judging that the acquired geographical location address information is valid, storing the geographical location address information corresponding to the geographical location coordinate point, updating the locally stored geographical location coordinate point, and if the acquired geographical location address information does not meet the requirements, starting step 04;
step 04: and if the acquisition of the geographical location address information fails or the acquired geographical location address information is invalid, switching the interface of the geographical anti-coding immediately, and restarting the step 02.
2. The asynchronous geo-location acquisition method of claim 1 wherein the failure to acquire geo-location address information comprises the acquired geo-location address information being null.
3. The asynchronous geographic location acquisition method of claim 1, wherein the service for acquiring the geographic location address information is performed in real time following the update of the geographic location coordinate point, and wherein the service for acquiring the geographic location address information is initiated each time the locally stored geographic location coordinate point is updated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611078316.8A CN106454743B (en) | 2016-11-29 | 2016-11-29 | Asynchronous acquisition method of geographic position |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611078316.8A CN106454743B (en) | 2016-11-29 | 2016-11-29 | Asynchronous acquisition method of geographic position |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106454743A CN106454743A (en) | 2017-02-22 |
CN106454743B true CN106454743B (en) | 2020-03-24 |
Family
ID=58222424
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611078316.8A Active CN106454743B (en) | 2016-11-29 | 2016-11-29 | Asynchronous acquisition method of geographic position |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106454743B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110837605A (en) * | 2019-10-17 | 2020-02-25 | 贝壳技术有限公司 | Low-flow consumption quick positioning method |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1939757A2 (en) * | 2006-12-28 | 2008-07-02 | Group 1 Software, Inc. | Universal address parsing system and method |
CN103957502A (en) * | 2014-04-04 | 2014-07-30 | 小米科技有限责任公司 | Location-based service program selecting method, device and terminal |
CN104867402A (en) * | 2014-02-25 | 2015-08-26 | 高德软件有限公司 | Offline reverse geocoding method, device thereof and terminal equipment |
CN104917895A (en) * | 2015-06-09 | 2015-09-16 | 小米科技有限责任公司 | Positioning system selection method and device and terminal |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103167604B (en) * | 2013-03-01 | 2015-12-23 | 海南久其云计算科技有限公司 | A kind of mobile communication terminal report method and system |
US9389096B2 (en) * | 2013-10-04 | 2016-07-12 | Uber Technologies, Inc. | Determining location information using a location data point provided by a computing device |
-
2016
- 2016-11-29 CN CN201611078316.8A patent/CN106454743B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1939757A2 (en) * | 2006-12-28 | 2008-07-02 | Group 1 Software, Inc. | Universal address parsing system and method |
CN104867402A (en) * | 2014-02-25 | 2015-08-26 | 高德软件有限公司 | Offline reverse geocoding method, device thereof and terminal equipment |
CN103957502A (en) * | 2014-04-04 | 2014-07-30 | 小米科技有限责任公司 | Location-based service program selecting method, device and terminal |
CN104917895A (en) * | 2015-06-09 | 2015-09-16 | 小米科技有限责任公司 | Positioning system selection method and device and terminal |
Also Published As
Publication number | Publication date |
---|---|
CN106454743A (en) | 2017-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104819723B (en) | A kind of localization method and location-server | |
US20150370828A1 (en) | Tile-Based Distribution of Searchable Geospatial Data to Client Devices | |
CN104867402B (en) | A kind of method and device thereof and terminal device of offline inverse geocoding | |
CN102546656B (en) | Method, system and device for finding user in social network | |
AU2014280973B2 (en) | Method and apparatus for displaying point of interest | |
US9123178B2 (en) | Updating map tiles | |
US8131818B2 (en) | Optimizing caching period of location data for network based location services | |
CN102901501B (en) | Target position query method and server | |
CN103530330B (en) | A kind of processing method of inverse geocoding processing system | |
US10127324B2 (en) | Dynamically integrating offline and online suggestions in a geographic application | |
US20150170387A1 (en) | Accessing map tiles | |
US20170099629A1 (en) | Network search method and apparatus | |
CN112432646B (en) | A route navigation method, storage medium and device | |
CN103476111A (en) | Method, device and system for obtaining geographic position information | |
CN101977435A (en) | Terminal positioning method and system | |
CN103617254A (en) | Method, system and device for constructing geographic position coordinate information base | |
CN103198135A (en) | Microblog registration data online acquiring method for grid division of geographic regions | |
CN106454743B (en) | Asynchronous acquisition method of geographic position | |
CN107357797B (en) | Information pushing method and device | |
CN105354326B (en) | Spatial position indexing method and system | |
JP5364557B2 (en) | Destination estimation apparatus, method and program | |
CN106597509A (en) | Positioning method and device | |
CN110598131B (en) | Method and device for determining user resident area, storage medium and electronic equipment | |
CN105659637A (en) | Caching of locations on a device | |
CN101742403A (en) | Method and device for acquiring target identifier |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |