help cnmapsearch

Title

cnmapsearch -- This Stata module helps to extract the specified information by keyword in a certain geographic range.

Syntax

cnmapsearch, baidukey(string) [options]

Extracts the information that is searched by keyword in a certain circular range.

Description

Baidu Map API is widely used in China.
cnmapsearch use Baidu Map API to extract the specified information by keyword around the specified location.
The content of keyword and the size of range are specified by users.
Before using this command,a Baidu secret key from Baidu Map API is needed.
A typical Baidu secret key is an alphanumeric string.
The option baidukey(string) is actually not optional.
If you have a Baidu key, which is, say CH8eakl6UTlEb1OakeWYvofh, the baidukey option must be specified as baidukey(CH8eakl6UTlEb1OakeWYvofh).
You can get a secret key from Baidu Map open platform (http://lbsyun.baidu.com).
The process normally will take 3-5 days after you submit your application online.
There are some information can be extracted when users using cnmapsearch.
(1) The name of the place in the searching range.
(2) The address and Latitude & Longitude of the place.
(3) The telephone number of the place if it has.
(4) If this place is a hotel or a restaurant,command can provide the score of service quality.

cnmapsearch require Stata version 14 or higher.

Options for cnmapsearch

Credentials(required)

baidukey(string) is required before using this command.
You can get a secret key from Baidumap open platform(http://lbsyun.baidu.com).
The process normally will take 3-5 days after you submit your application online.

addr(varname) is required when users using this command.
This option determines the center of searching circle and command searches the revelent information users specified within this circle.
There are other three options can be used and users can only choose one of them.

addr_lat(varname) & addr_lng(varname) specify the longitude and latitude of the address.
These cannot be used with other options of address.

singleaddr(string) specify a single address.
For example,singleaddr("湖北省武汉市洪山区中南财经政法大学").
These cannot be used with other options of address.

singlecoord(string) specify the longitude and latitude of a single address.
For example,singlecoord("30.506959132159595,114.38494520005379").
These cannot be used with other options of address.

Search options

number(string) determines that how many objects will be extract,the range of number is 1-20.
The default is 10.

radius(string) can specify the radius of circle that is used in searching revelent objects.

filter(string) can adjust the preference of searching so that users can extract more accurate information.
The syntax of this option is filter(category-preference).
There are three kinds of category:cater,hotal and life.
Users can input different preference in different category.
The option of category narrow the range of searching so that it can improve the accuracy of searching.

When the category is cater,there are five types of preference can be selected:

distance :sorting by distance, from close to distant.

price :sorting by price, from lowest to highest.

overall_rating :sorting by the score that customers give from Internet.

taste_rating :sorting by the score that taste of food.

service_rating :sorting by the quality of service.

When the category is life,there are four types of preference can be selected:

distance 、 price and overall_rating had been listed before.

comment_num is equal to service_rating.

When the category is hotel,there are five types of preference can be selected:

distance and price had been listed before.

total_score is equal to overall_rating.

level sorting by the level of hotel.

health_score sorting by the quality of hygienic condition.

Respondent preference

seeradius If users want to extract the radius of searching automatically, option seeradius helps.
The dimension of this option is meter and the default is 2000.

seefilter If users want to extract the filter used in this searching automatically, option seefilter helps.
The default is not to show this information.

Example

Input the address

`"clear"'

`"input str100 address"'

`""湖北省武汉市洪山区中南财经政法大学" "'

`""湖北省武汉市武昌区政府" "'

`""陕西省西安市雁塔区大雁塔" "'

`"end"'

Extracts the information of object that is relevent to food within a circular range.

`"cnmapsearch, baidukey(your secret key) addr(address) keyword("食") filter(cater-)"'

`"list item1 longitude latitude"'

Input the longitude and latitude of the address

`"clear"'

`"input double lat double lng"'

`"114.38494 30.50695"'

`"30.54414 114.36921"'

`"30.43655 114.42726"'

`"end"'

Change the radius of searching range and extracts the information of object.

`"cnmapsearch, baidukey(your secret key) addr_lat(lat) addr_lng(lng) keyword("酒") radius("4000") seeradius"'

`"list "'

Extracts the information of object when the type of address is singleaddr.

`"clear"'

`"cnmapsearch,baidukey(your secret key) singleaddr("湖北省武汉市洪山区中南财经政法大学") keyword("食") filter(cater-price) "'

`"list"'

Extracts the information of object when the type of address is singlecoord.

`"clear"'

`"cnmapsearch,baidukey("your secret key") singlecoord("30.506959,114.384945") keyword("医院") radius("9000") filter(cater) number("12")"'

`"list "'

Author

Chuntao LI

School of Finance, Zhongnan University of Economics and Law

Wuhan, China

chtl@zuel.edu.cn

Yuan Xue

School of Finance, Zhongnan University of Economics and Law

Wuhan, China

xueyuan19920310@163.com

Xueren Zhang

School of Finance, Zhongnan University of Economics and Law

Wuhan, China

zhijunzhang_hi@163.com