{"action":"created","issue":{"url":"https://api.github.com/repos/pyecharts/pyecharts/issues/687","repository_url":"https://api.github.com/repos/pyecharts/pyecharts","labels_url":"https://api.github.com/repos/pyecharts/pyecharts/issues/687/labels{/name}","comments_url":"https://api.github.com/repos/pyecharts/pyecharts/issues/687/comments","events_url":"https://api.github.com/repos/pyecharts/pyecharts/issues/687/events","html_url":"https://github.com/pyecharts/pyecharts/issues/687","id":353038269,"node_id":"MDU6SXNzdWUzNTMwMzgyNjk=","number":687,"title":"如何精确自定义 Geo/Geolines 坐标","user":{"login":"chenjiandongx","id":19553554,"node_id":"MDQ6VXNlcjE5NTUzNTU0","avatar_url":"https://avatars2.githubusercontent.com/u/19553554?v=4","gravatar_id":"","url":"https://api.github.com/users/chenjiandongx","html_url":"https://github.com/chenjiandongx","followers_url":"https://api.github.com/users/chenjiandongx/followers","following_url":"https://api.github.com/users/chenjiandongx/following{/other_user}","gists_url":"https://api.github.com/users/chenjiandongx/gists{/gist_id}","starred_url":"https://api.github.com/users/chenjiandongx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chenjiandongx/subscriptions","organizations_url":"https://api.github.com/users/chenjiandongx/orgs","repos_url":"https://api.github.com/users/chenjiandongx/repos","events_url":"https://api.github.com/users/chenjiandongx/events{/privacy}","received_events_url":"https://api.github.com/users/chenjiandongx/received_events","type":"User","site_admin":false},"labels":[{"id":1022353157,"node_id":"MDU6TGFiZWwxMDIyMzUzMTU3","url":"https://api.github.com/repos/pyecharts/pyecharts/labels/example","name":"example","color":"f96df7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-22T16:49:03Z","updated_at":"2018-08-23T05:56:27Z","closed_at":null,"author_association":"MEMBER","body":"项目地址：https://github.com/pyecharts/geo-region-coords\r\n\r\n### pyecharts 自定义坐标\r\n\r\n在 [pyecharts](https://github.com/pyecharts/pyecharts) 中，Geo/Geolines 图需要定义地区坐标，由于全国地区众多且多重名，pyecharts 无法精确度较高的区域坐标。pyecharts 中提供自定义坐标的方式有两种：\r\n\r\n1. 使用 `geo_cities_coords` 参数，字典类型，如 {'阿城': [126.58, 45.32],}\r\n\r\n    coords.txt\r\n    ```\r\n    \"北京\": [116.407526, 39.90403],\r\n    \"北京东城\": [116.416357, 39.928353],\r\n    \"北京东城东华门\": [116.406708, 39.914219],\r\n    \"北京东城东华门多福巷\": [116.412747, 39.923014],\r\n    \"北京东城东华门银闸\": [116.406708, 39.914219],\r\n    \"北京东城东华门东厂\": [116.406708, 39.914219],\r\n    \"北京东城东华门智德\": [116.404642, 39.918634],\r\n    \"北京东城东华门南池子\": [116.40318, 39.907837],\r\n    \"北京东城东华门黄图岗\": [116.410022, 39.920854],\r\n    \"北京东城东华门灯市口\": [116.414391, 39.918751],\r\n    ```\r\n\r\n    **在 coords.txt 中查找对应关键字,复制到 `geo_cities_coords` 参数即可**\r\n\r\n\r\n2. *Hack* pyecharts 源代码，对应文件位于 `Lib/site-packages/pyecharts/datasets/city_coordinates.json` 具体路径根据操作系统和 Python 环境而定。\r\n\r\n    coords.json\r\n    ```\r\n    [\r\n        {\"北京\": [116.407526, 39.90403]},\r\n        {\"北京东城\": [116.416357, 39.928353]},\r\n        {\"北京东城东华门\": [116.406708, 39.914219]},\r\n        {\"北京东城东华门多福巷\": [116.412747, 39.923014]},\r\n        {\"北京东城东华门银闸\": [116.406708, 39.914219]},\r\n        {\"北京东城东华门东厂\": [116.406708, 39.914219]},\r\n        {\"北京东城东华门智德\": [116.404642, 39.918634]},\r\n        {\"北京东城东华门南池子\": [116.40318, 39.907837]},\r\n        {\"北京东城东华门黄图岗\": [116.410022, 39.920854]},\r\n        {\"北京东城东华门灯市口\": [116.414391, 39.918751]},\r\n        ...\r\n    ]\r\n    ```\r\n\r\n    **在 coords.json 中查找对应关键字，补充到 city_coordinates.json 文件中即可**\r\n"},"comment":{"url":"https://api.github.com/repos/pyecharts/pyecharts/issues/comments/415300422","html_url":"https://github.com/pyecharts/pyecharts/issues/687#issuecomment-415300422","issue_url":"https://api.github.com/repos/pyecharts/pyecharts/issues/687","id":415300422,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTMwMDQyMg==","user":{"login":"kinegratii","id":9875406,"node_id":"MDQ6VXNlcjk4NzU0MDY=","avatar_url":"https://avatars0.githubusercontent.com/u/9875406?v=4","gravatar_id":"","url":"https://api.github.com/users/kinegratii","html_url":"https://github.com/kinegratii","followers_url":"https://api.github.com/users/kinegratii/followers","following_url":"https://api.github.com/users/kinegratii/following{/other_user}","gists_url":"https://api.github.com/users/kinegratii/gists{/gist_id}","starred_url":"https://api.github.com/users/kinegratii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kinegratii/subscriptions","organizations_url":"https://api.github.com/users/kinegratii/orgs","repos_url":"https://api.github.com/users/kinegratii/repos","events_url":"https://api.github.com/users/kinegratii/events{/privacy}","received_events_url":"https://api.github.com/users/kinegratii/received_events","type":"User","site_admin":false},"created_at":"2018-08-23T05:56:27Z","updated_at":"2018-08-23T05:56:27Z","author_association":"COLLABORATOR","body":"The second solution is a bad practice and should be removed. Hack source code is temporary solution and will be invalid when software is upgraded.So it should not appear in official document. \r\n\r\n`geo.add_coordinate` is the only API to import user's cusom geo data.\r\n\r\nhttps://github.com/pyecharts/pyecharts/blob/2577153563be046dcda83cdf7655481dcdd0950e/pyecharts/charts/geo.py#L22-L31"}}
{"actor":{"display_login":"kinegratii"}}