Giter Site home page Giter Site logo

issue9 / cnregion Goto Github PK

View Code? Open in Web Editor NEW
182.0 7.0 24.0 34.67 MB

2009-2023 年**全国(省、市、县、乡/镇、村/街道)五级行政区域划分数据

Home Page: https://pkg.go.dev/github.com/issue9/cnregion/v2

License: MIT License

Go 99.76% Shell 0.24%
go golang cn-region region cn-location

cnregion's Introduction

cnregion

Test Go version PkgGoDev codecov License

历年统计用区域和城乡划分代码,数据来源于 https://www.stats.gov.cn/sj/tjbz/tjyqhdmhcxhfdm/。 符合国家标准 GB/T 2260 与 GB/T 10114。

关于版本号,主版本号代码不兼容性更改,次版本号代码最后一次生成的数据年份,BUG 修正和兼容性的功能增加则增加修订版本号。

v, err := cnregion.LoadFile("./data/regions.db", "-", 2020)

p := v.Provinces() // 返回所有省列表
cities := p[0].Items() // 返回该省下的所有市
counties := cities[0].Items() // 返回该市下的所有县
towns := counties[0].Items() // 返回所有镇
villages := towns[0].Items() // 所有村和街道信息

d := v.Districts() // 按以前的行政大区进行划分
provinces := d[0].Items() // 该大区下的所有省份

list := v.Search(&SearchOptions{Text: "温州"}) // 按索地名中带温州的区域列表

对采集的数据进行了一定的加工,以减少文件的体积,文件保存在 ./data/regions.db 中。

安装

go get github.com/issue9/cnregion/v2

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

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.