Giter Club home page Giter Club logo

city-geo's Introduction

💡 简介

City Geo 仓库整理了**城市县区的经纬度数据。

⚗ 用法

data.json 是已经整理好的数据,可直接使用。

代码中的 baiduAK 请勿在生产环境使用,可能会随时删除。

✨ 动机

整理这些数据的动机是满足链滴实现暗黑模式的需要,模式分为明亮、暗黑、随日出日落自动切换。

随日出日落自动切换特性需要知道日出日落时间,而不同地理位置的日出日落时间是不同的,但可以基于经纬度来进行计算,这就是制作该仓库的动机。

🏘️ 社区

  • 报告问题
  • 欢迎关注 B3log 开源社区微信公众号 B3log开源
    b3logos.jpg

📄 开源协议

City Geo 使用 木兰宽松许可证, 第2版 开源协议。

🙏 鸣谢

city-geo's People

Contributors

88250 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

city-geo's Issues

非常感谢这个小爬虫,提一个很小的改进建议:百度地图使用的是自有坐标系系统

参见百度地图文档 ,地理编码 API 默认返回的是百度的 bd09ll 坐标,在使用其它平台地图的服务(比如geojson是从datav高德那边来的)会产生偏移。

虽然我大概粗略地用几个区域测了下,省市级定位是偏不出去的,不过毕竟也说不好会不会有什么预期外的问题,所以最好还是使用比较统一的坐标系统: 在请求 API 的地方加上 &ret_coordtype=gcj02ll 即可。

改动很小就不提PR了,开个 Issue 提醒看到的大家留意一下有这么回事。

panic问题解除

描述问题 Describe the problem

2024/01/07 23:02:07 city [苏州市] result failed [[Get "http://api.map.baidu.com/geocoding/v3/?address=%E6%B1%9F%E8%8B%8F%E7%9C%81%E8%8B%8F%E5%B7%9E%E5%B8%82%E5%90%B4%E6%B1%9F%E5%8C%BA&ak=&output=json": EOF]]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x10 pc=0xd25666]

goroutine 1 [running]:
main.query({0xc00045cc46?, 0x24?}, {0xc00045cc4d?, 0x1?}, {0xc00045cc57, 0x9}, {0xc00045cc61?, 0x9?})
        D:/Github/city-geo/main.go:76 +0x526
main.main()
        D:/Github/city-geo/main.go:46 +0x1d7

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.