georgique/world-geojson 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

georgique/world-geojson

Composer 安装命令:

composer require georgique/world-geojson

包简介

GeoJson for all the countries, areas (regions) and some states.

README 文档

README

SWUbanner

World boundaries in GeoJSON format

This repository contains GeoJSON data for all the countries boundaries including boundaries for states of bigger countries (note that this repository is currently filling). Detalization is good for using this data on scales up to 1:10000000 / gmaps zoom 6-7 (it's the best quality in combination with free-to-use license). Data is created using geojson.io tool.

Quality example

Getting started

You can either download it or install in your project either via Composer or NPM:

Via Composer:

"require": {
  "georgique/world-geojson": "^3.0"
}

Via NPM:

"dependencies": {
  "world-geojson": "^3.0",
}

Help with integrating it with any other Package Manager is welcome.

Usage

JSON files can be read from the directory in which the package was downloaded.

Node.js

Node.js applications can use the provided helper functions to synchronously load the JSON as a JavaScript object.

const geoJson = require('world-geojson') // or `import * as geoJson from 'world-geojson'`

geoJson.forCountry('Antigua & Barbuda'); // returns the contents of /countries/antigua_and_barbuda.json
geoJson.forState('Australia', 'New South Wales'); // returns the contents of /states/australia/new_south_wales.json
geoJson.forArea('U.S.A.', 'U.S. Virgin Islands'); // returns the contents of /areas/usa/us_virgin_islands.json

// Combine multiple GeoJSONs into one
const combined = geoJson.combineGeoJson([
  {countryName: 'Antigua & Barbuda'},
  {countryName: 'Australia', stateName: 'New South Wales'}, 
  {countryName: 'U.S.A.', areaName: 'U.S. Virgin Islands'} 
]);

What's included

Countries (v1)

Contries boundaries besides mainlands include all the geographically separated, but de jure dependent, associated and managed territories. Separated mainland and all the territories mentioned are added in release 2. Countries states are to be added in release 3. More about countries boundaries release here.

Additional areas (v2)

Besides bigger countries which are to be splitted into states, some smaller are also worth to be splitted into geographical areas. More about additional area boundaries release here.

Countries split into areas are:

  • Azerbaijan (2): Mainland/Nakhchivan
  • Denmark (3): Mainland/Greenland/Faroe Islands
  • Ecuador (2): Mainland/Galápagos Islands
  • France (18): Mainland/Corsica/French Guiana/Guadeloupe/Martinique/Mayotte/Réunion/Clipperton Island/French Polynesia/New Caledonia/Saint Barthélemy/Saint Martin/Saint Pierre and Miquelon/Wallis and Futuna/French Southern and Atlantic Lands
  • Italy (3): Mainland/Sardinia/Sicily
  • Netherlands (7): Mainland/Bonaire/Saba/Sint Eustatius/Aruba/Curaçao/Sin Maarten
  • New Zealand (12): Mainland/North Island/South Island/Tokelau/Kermadec Islands/Chatham Islands/Three Kings Islands/Antipodes Islands/Auckland Islands/Bounty Islands/Campbell Island/Snares Islands
  • Norway (3): Mainland/Svalbard/Jan Mayen
  • Portugal (3): Mainland/Azores/Madeira
  • Spain (3): Mailand/Canary Islands/Balearic Islands
  • United Kingdom (21): United Kingdom/England/Scotland/Wales/Northern Ireland/Isle of Man/Guernsey/Jersey/Gibraltar/Akrotiri and Dhekelia/Bermuda/Turks and Caicos Islands/British Virgin Islands/Anguilla/Cayman Islands/Montserrat/Pitcairn Islands/Saint Helena, Ascension and Tristan de Cunha/British Indian Ocean Territory/Falkland Islands/South Georgia and the South Sandwich Islands
  • USA (17): Mainland (to be split to states in v3)/Palmyra Atoll/Guam/Northern Mariana Islands/Puerto Rico/United States Virgin Islands/American Samoa/Baker Island/Howland Island/Jarvis Island/Johnston Atoll/Kingman Reef/Wake Island/Midway Atoll/Navassa Island/Serranilla Bank/Bajo Nuevo Bank

Aligned borders for all the countries (v3.0) and Australian states (v3.1)

This release is about gluing borders between all the countries so they perfectly align. Was / Is:

Also, NPM this package can now be installed via NPM

Added region boundaries for Thailand and Switzerland (v3.2)

Note that those region boundaries are not aligned with the country borders.

Added Taiwan (v3.3)

Enough said. It was missing, not it is not.

Added India states (v3.4)

Quality is unknown.

What's planned

There is no ongoing work right now and no commitment to have this ready within a certain timeframe, so these shouldn't be counted on, but this is the plan in general.

Aligned and better quality state borders for CA and USA (v3.5)

  • Better Canadian province borders
  • Glued borders for Canadian provinces
  • Better USA state borders
  • Glued borders for USA states

States boundaries (v4.0)

Countries which we are going to provide state boundaries for:

  • Australia (ready)
  • Argentina (pending: 24)
  • Brazil (pending: 26)
  • Canada (ready / OSM / low quality)
  • China (pending: 33)
  • India (pending: 29)
  • Indonesia (pending: 34)
  • Kazakhstan (pending: 14)
  • Mexico (pending: 31)
  • Philippines (pending: 18)
  • Russia (pending: 83)
  • USA (ready, OSM data)

Note that some states boundaries are provided by OSM, however quality of that data is much lower. It's planned to replace them with handmade ones eventually.

Help wanted

  • Providing geojson for any regions - not necessarily from the roadmap above, any country's regions can be included
  • Integration with any package managers other than NPM and Packagist

Reference

This library is my personal mini-project which I enjoy doing and I am happy if that is useful for anyone else. If you want to thank me, feel free to buy me a cup of coffee through the GitHub Sponsor program.

统计信息

  • 总下载量: 5.71k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 497
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 497
  • Watchers: 11
  • Forks: 104
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-3.0-or-later
  • 更新时间: 2019-12-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固