LBS cloud search and development details, lbs cloud details
Baidu map LBS cloud is a platform-level service launched by Baidu map for LBS developers. It is applicable not only to PC application development, but also to mobile device application development. With LBS cloud, mobile developers can store massive volumes of data on their servers at no cost and maintain pressure, efficiently retrieve user data, and display maps.
Note: Since Android SDK v2.2.0, the SDK will support the LBS cloud v2 service. If you still use the v1 cloud service, complete the version upgrade as soon as possible, you can also use sdks earlier than v2.2.0 to perform cloud search and other operations.
To retrieve data owned by an LBS cloud developer, follow these steps:
Step 1: Data Storage: first, developers need to store the data to be retrieved to the LBS cloud;
Step 2. Search: Use the SDK to search your own data using interfaces provided by developers;
Step 3: Display your data in multiple forms (such as result list and map mode) based on your actual needs.
Coordinate description
Currently, the coordinates of the Baidu map SDK interface and returned content only support Baidu BD09 coordinates. If you are using the GPS WGS84 coordinates or the GCJ02 coordinates of the national test bureau, the WGS84 or GCJ02 coordinates must be converted to the BD09 coordinates.
For the corresponding interfaces and conversion methods, see coordinate conversion. Do not use unofficial conversion methods.
LBS cloud search
After data is stored on the LBS cloud, developers can call the SDK cloud retrieval service to retrieve data stored on the cloud. The specific method is as follows:
Step 1: implement the GeoSearchListener interface;
Public void onGetSearchResult (CloudSearchResult result, int error) {// process the corresponding search result here} ** key content **
Step 2: Initiate a cloud search request;
LocalSearchInfo info = new LocalSearchInfo (); info. ak = "B266f735e43ab207ec152deff44fec8b"; // here info. the ak is the server ak, not the Adnroid sdk ak, and the server ak and the Adnroid sdk ak are in the same account. Info. geoTableId = 31869; // info. geoTableId is stored in the same Development Account as info. ak. Info. tags = ""; info. q = "Tiananmen"; info. region = "Beijing"; CloudManager. getInstance (). localSearch (info );
Step 3: Run and display the following results;
LBS cloud anti-geographic code (RGC for short)
Cloud anti-geocoding (cloud RGC) is a set of personalized location description services based on the Anti-geocoding service. Developers can customize the geographic data used for Inverse geocode computing to train the location description service most suitable for real business scenarios. For example, the recommendation result of the coordinate "40.055743, 116.308243" is "Baidu Tower", which uses the cloud anti-geocoding service, the coordinates can be defined as "Baidu shuttle bus pick-up point", "xierqi express centralized sending and receiving" and other more personalized location descriptions.
Applicable to the following business scenarios:
1. Customize the location description of the business location. For example, a vehicle or carpool developer can define frequent pick-up and drop-off locations to make optimal recommendations based on the user's current location to improve service efficiency and user experience.
2. Customize the location description of the business area. For example, the same-city distribution developer can quickly calculate the location description of the outlet where the user's order coordinates are located by defining the service outlet area. It can also be used as a reference basis for automatic order sorting.
3. Fill in the descriptions of basic features or industry categories that are not displayed on maps required for key business areas. For example, a community service developer needs to push custom services based on the user's location, and can define or enrich public facilities around the community as needed.
Start using cloud anti-geocode in three steps:
61e86572ea2319767344a03e27245306.png
LBS cloud rgc api detailed description of this function:
Note the following when developing the map SDK:
1. The ak under the same developer account can share the "location data table" under this account. In other words, the ak under other developer accounts, you cannot use the location data table under another account ".
During development, you can use the ak and location data table under your Development Account for debugging. However, before going online, you must change it to the ak under your official account, you can call the official "location data table ".
2. developers can maintain and update location data through the cloud storage service, which is reflected in cloud anti-geographic code in real time.
3. If the request "location data table" prompts "Return parameter error", check whether the tableid and coordinate format are correct.
The cloud RGC call method is the same as the cloud retrieval call method. The method is as follows:
Step 1: Create a cloud anti-geographic code retrieval listener;
CloudListener listen = new CloudListener () {@ Override public void onGetSearchResult (CloudSearchResult result, int error) {}@ Override public void onGetDetailSearchResult (DetailSearchResult result, int error) {}@ Override public void onGetCloudRgcResult (CloudRgcResult result, int error) {// obtain the cloud anti-geographic code search result }};
Step 2: Set the cloud anti-geographic code retrieval listener;
CloudManager. getInstance (). init (listen); Step 3: create cloud anti-geocode retrieval information; CloudRgcInfo info = new CloudRgcInfo (); info. geoTableId = 145801; info. location = "40.047969, 116.313718 ";
Step 4: Initiate cloud anti-geographic code search;
CloudManager.getInstance().rgcSearch(info);
Step 5: Release the cloud anti-geographic code retrieval instance;
CloudManager.getInstance().destroy();