baidumapapi
============
A Simple Python Baidu Map API Library, make easy for you when you want to use map data.
It is Python Baidu Map API Library. We encapsulate it, and make it more easy for you.
Exmaple
----------
Query the transit info
.. code-block:: python
direction = MapDirection(AK, SK)
origin = "23.137903,113.34348"
destination = "22.544383,114.062203"
coord_type = "wgs84"
content = direction.transit(origin, destination, coord_type=coord_type)
result = json.loads(content)
print(result)
This exmaple of getting all street of china.
.. code-block:: python
df = pd.read_csv("http://baidumapapi.shikanon.com/data/ChUnit2017.csv", encoding="utf-8")
df["lat"] = 0.0
df["lng"] = 0.0
df["详细地址"] = df["区镇"] + df["街道"]
search = SearchPlace(AK, SK)
for i in df.index:
print(df["详细地址"][i], df["省"][i])
if df["城市"][i] == "市辖区":
content = search.searchRegion(query=df["详细地址"][i], region=df["省"][i], output="json")
else:
content = search.searchRegion(query=df["详细地址"][i], region=df["城市"][i], output="json")
result = json.loads(content)
assert result["status"] == 0
if len(result["results"]) > 0:
df["lat"][i] = result["results"][0]["location"]["lat"]
df["lng"][i] = result["results"][0]["location"]["lng"]
============
A Simple Python Baidu Map API Library, make easy for you when you want to use map data.
It is Python Baidu Map API Library. We encapsulate it, and make it more easy for you.
Exmaple
----------
Query the transit info
.. code-block:: python
direction = MapDirection(AK, SK)
origin = "23.137903,113.34348"
destination = "22.544383,114.062203"
coord_type = "wgs84"
content = direction.transit(origin, destination, coord_type=coord_type)
result = json.loads(content)
print(result)
This exmaple of getting all street of china.
.. code-block:: python
df = pd.read_csv("http://baidumapapi.shikanon.com/data/ChUnit2017.csv", encoding="utf-8")
df["lat"] = 0.0
df["lng"] = 0.0
df["详细地址"] = df["区镇"] + df["街道"]
search = SearchPlace(AK, SK)
for i in df.index:
print(df["详细地址"][i], df["省"][i])
if df["城市"][i] == "市辖区":
content = search.searchRegion(query=df["详细地址"][i], region=df["省"][i], output="json")
else:
content = search.searchRegion(query=df["详细地址"][i], region=df["城市"][i], output="json")
result = json.loads(content)
assert result["status"] == 0
if len(result["results"]) > 0:
df["lat"][i] = result["results"][0]["location"]["lat"]
df["lng"][i] = result["results"][0]["location"]["lng"]
Metadata
Release files for BaiduMapAPI 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| BaiduMapAPI-0.1.2.tar.gz | 9.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| BaiduMapAPI-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 24.2 kB
Release files / BaiduMapAPI-0.1.2.tar.gz
| Download URL | BaiduMapAPI-0.1.2.tar.gz |
|---|---|
| Size | 9.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f985cf039439b08d8afc5b584867adce8c028cdb56e261e21c4205aab7975c2
|
|
BLAKE2b-256 checksum How to use checksums |
8345b3285d9a7b425ef81c8f087455d58ee4eb5cf25fd4b05f3a21ff27675d3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|
Release files / BaiduMapAPI-0.1.2-py3-none-any.whl
| Download URL | BaiduMapAPI-0.1.2-py3-none-any.whl |
|---|---|
| Size | 14.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
695ee67710ef40399628ea61f76821127b4315439736ce3d42bcdc451d40a6eb
|
|
BLAKE2b-256 checksum How to use checksums |
7e3076089d25e1418ee0f1853c23c52d403bc2d183c783f2eb689a81355bd234
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
|