{"id":18247058,"url":"https://github.com/badbye/baidumap","last_synced_at":"2025-08-03T20:36:39.556Z","repository":{"id":22088272,"uuid":"25417943","full_name":"badbye/baidumap","owner":"badbye","description":"R interface of baidu map api","archived":false,"fork":false,"pushed_at":"2023-07-17T10:44:34.000Z","size":37,"stargazers_count":101,"open_issues_count":14,"forks_count":51,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-20T14:40:42.294Z","etag":null,"topics":["baidu-api","baidu-map","ggmap","ggplot","r"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/badbye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-10-19T04:37:41.000Z","updated_at":"2023-12-25T09:52:15.000Z","dependencies_parsed_at":"2022-08-05T15:30:20.989Z","dependency_job_id":"ff118123-c4a1-4b67-856d-bfdd2298b7c8","html_url":"https://github.com/badbye/baidumap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Fbaidumap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Fbaidumap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Fbaidumap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/badbye%2Fbaidumap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/badbye","download_url":"https://codeload.github.com/badbye/baidumap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194041,"owners_count":20899419,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baidu-api","baidu-map","ggmap","ggplot","r"],"created_at":"2024-11-05T09:28:50.854Z","updated_at":"2025-04-04T14:31:27.533Z","avatar_url":"https://github.com/badbye.png","language":"R","readme":"baidumap\n========\n\nR interface of baidu map api，just like ggmap but get map from baidu api instead of google or openstreet.\n\n## Installation\n```\nlibrary(devtools)\ninstall_github('badbye/baidumap')\n```\n\n## Usage\n\nApply an application from [lbsyun.baidu.com](http://lbsyun.baidu.com/apiconsole/key). Then register you key here.\n```\nlibrary(baidumap)\noptions(baidumap.key = 'XXX fill your key here XXX')\n```\n\n\n### Function: getLocation\nGet location from coordinates data.\n```\nlon = matrix(c(117.93780, 24.55730, 117.93291, 24.57745, 117.23530, 24.64210, 117.05890, 24.74860), byrow=T, ncol=2)\n### json \nlocation_json = getLocation(lon[1,], output='json')\n\n### xml\nlocation_xml = getLocation(lon[1, ], output='xml')\n\n## formatted\nlocation = getLocation(lon[1, ], formatted = T) \n```\n\n### Function: GetCoordinate\nGiven a address, return the corresponding coordinates\n```\ngetCoordinate('北京大学') # json\ngetCoordinate('北京大学', output='xml') # xml\ngetCoordinate('北京大学', formatted = T) # character\ngetCoordinate(c('北京大学', '清华大学'), formatted = T) # matrix\n```\n\n\n### Function: getBaiduMap\n\n```\np \u003c- getBaiduMap(c(lon=116.354431, lat=39.942333))\nlibrary(ggmap)\nggmap(p)\n```\n\n### Function: geoconv\n\nConvert your coordinate data to BaiduMap's coordinate system. Document: http://lbsyun.baidu.com/index.php?title=webapi/guide/changeposition\n\n## Example\n\n```\nlibrary(baidumap)\nlibrary(ggplot2)\noptions(baidumap.key='xxx')\nruc_map = getBaiduMap('中国人民大学', zoom=12)\nruc_coordinate = getCoordinate('中国人民大学', formatted = T)\nruc_coordinate = data.frame(t(ruc_coordinate))\nggmap::ggmap(ruc_map) +\n  geom_point(aes(x=longtitude, y=latitude), data=ruc_coordinate, col='red', size=5)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbye%2Fbaidumap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbadbye%2Fbaidumap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbadbye%2Fbaidumap/lists"}