Giter VIP home page Giter VIP logo

geojson's Introduction

GeoJSON 数据下载器及坐标系转换器

这个项目包含用于从阿里云的地理数据服务下载GeoJSON数据的Python脚本,把GCJ-02坐标系的GeoJSON数据批量转换为WGS-84坐标系的Python脚本,以及国内精确到district级别的所有GeoJSON数据(两种坐标系都有,但暂不包括南海九段线的数据,即adcode100000_JD的数据)。

主要特点

  • 使用递归的方式遍历指定adcode下的所有地区数据。
  • 及时捕获运行脚本时可能发生的错误并输出。
  • 拥有一个多线程下载的高效率版本,但是需要注意设置速率限制。
  • 提供一个将GeoJSON的GCJ-02坐标点批量转换到WGS-84坐标系的功能。
  • 使用实时更新的进度条展示下载及转换的进度信息。

文件结构

  • download.py: 主要的Python脚本,用于下载GeoJSON数据。
  • geojson_gcj02/: 这个文件夹包含下载的GeoJSON数据,按照行政区划代码(adcode)进行组织,为GCJ-02坐标系。
  • geojson_wgs84/: 这个文件夹包含转换后的GeoJSON数据,按照行政区划代码(adcode)进行组织,为WGS-84坐标系。
  • requirements.txt: 包含download.py所需的所有依赖。
  • gcj2wgs.py: 把GCJ-02坐标系的GeoJSON数据批量转换为WGS-84坐标系的Python脚本。
  • download_multithread.py: 下载器的多线程试验版本。

如何使用

  1. 确保你已经安装了Python和所有必要的依赖。你可以通过运行以下命令来安装依赖:
pip install -r requirements.txt
  1. 运行download.py脚本来开始下载数据:
python download.py
  1. 运行gcj2wgs.py脚本来开始转换数据:
python gcj2wgs.py

注意事项

  • 请确保你有足够的磁盘空间来存储下载的数据。
  • 下载过程可能需要一些时间,具体取决于你的网络速度和阿里云服务器的响应速度。
  • 多线程版本由于速度过快会受到限制,请慎用。
  • 数据获取日期为2024/4/7,数据来源为https://geo.datav.aliyun.com/areas_v3/bound/geojson?code={adcode}[_full]
  • 注意根据数据源的描述,页面数据来源于高德开放平台,所以下载的GeoJSON坐标系应为GCJ-02

许可证

这个项目是在MIT许可证下发布的。详情请查看LICENSE文件。

geojson's People

Contributors

pamaforce avatar

Stargazers

 avatar  avatar Wbx avatar Fish_code avatar  avatar  avatar

Watchers

 avatar

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.