Giter Site home page Giter Site logo

china_region's Introduction

简介

行政区域json文件, 包括省,市,区,县,镇,街道

数据持续更新中。。。

保存目录

data
│  ├─1  
│  ├─2
│  ├─3
│  └─4
│  └─5
  • 1 省
  • 2 市
  • 3 区/县
  • 4 镇/街道
  • 5 邮政编码/电话区号

根据层级结构保存在不同的文件夹中,文件的命名都是上级区域的id。

比如北京的id是110000,那么海淀区所在的文件名称就是110000.json 以此类推

启动项目

下载代码到本机(二选一即可)

$ git clone https://github.com/lizeze/china_region.git

$ git clone https://gitee.com/zeze.li/china_region.git

安装依赖

 $ cd china_region
 $ npm i 
 $ npm start

Get http://localhost:9600/v1/api/xzhf/fid=100000&level=1

level 请求的数据类型,和保存目录一致
fid 请求数据的父节点

生成sql文件

 $ npm run sql     #全部数据生成sql

 $ npm run sql 1   #生成省级sql

 $ npm run sql 2   #生成市级sql

 $ npm run sql 3   #生成县级sql

 $ npm run sql 4   #生成街道sql
 
 $ npm run postcode # 生成邮政编码数据sql

修改sql字段名称

./src/tool.js

let sqlObj = {
   tableName: 'table1',
   id: 'id',
   name: 'name',
   level: 'level',
   parent: 'parent',
};

修改postCode表名称 ./src/tool.js

let postCodeSqlObj = {
    tableName: 'postCode'
};

其他语言

china_region's People

Contributors

tjlizz 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.