Giter VIP home page Giter VIP logo

world-geojson's Introduction

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'} 
]);

Countries (release 1.0)

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 (release 2.0)

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 (release 3.0 - published)

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

Aligned borders and better state borders for AU, CA and USA (release 3.2)

  • Glued borders for AU states (100% - published in 3.1)
  • Better Canadian province borders (0%)
  • Glued borders for Canadian provinces (0%)
  • Better USA state borders
  • Glued borders for USA states (0%)

States boundaries (release 4.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.

world-geojson's People

Contributors

alexgouget avatar b-jazz avatar bnf avatar georgique avatar njrbailey avatar tvedeane 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  avatar  avatar  avatar  avatar  avatar  avatar

world-geojson's Issues

Coordinates for some countries are incorrect

Some countries, like Portugal, Ukraine, Lithuania have correct coordinates, that are inside bounds longitude +/-180, latitude +/-90.

On another side countries like Germany, France, Italy, Georgia etc have coordinates starting from 700... For example this is header of Italy

$ cat ./italy.json | head -n 30
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              727.5311279296875,
              43.77902662160831
            ],
            [
              727.5627136230469,
              43.77456454892858
            ],
            [
              727.5702667236327,
              43.78497553389676
            ],
            [
              727.5984191894531,
              43.781009658142914
            ],
            [
              727.6581573486328,
              43.77109381775651
            ],

ER: all coordinates are in longitude +/-180, latitude +/-90 bounds

What is the coordinate system ?

Hello,
What is the coordinate system you use ? It doesn't look like WGS84…
For example France is supposed to be around lat 45 / lon 3, but the france.json file has coordinates around 700 / 50 !?
Thanks for this very useful data.

Data Source and License

Hey! Fantastic job on this project!

I am building a project where I need specific regions (mainland Spain excluding The Canary Islands for example) and this looks like it might be exactly what I'm after. I just have a few questions:

  1. What's the license? Is it MIT?
  2. Can you reveal the original data source?
  3. How did you produce the split regions? (If there are any missing then I would want to use a similar technique/tools and contribute them back to the repository).

Thanks in advance :)

JavaScript import into JS file

Hello, thanks so much for your hard work on this project, it's really useful! 😄

I am trying to use the package from NPM in a Node.js project I am working on, but currently the package is not set up to allow it to be imported into a .js file. It would not be difficult to allow this for both Node.js and browser usage, as JS can parse .json files into JavaScript objects using the require keyword. This code can be seen at #13

However, the only barrier to this is that the Canadian states use the .geojson file extension, which JS does not recognise and cannot import. This makes it more difficult to import.

I have some questions:

  1. Is it intentional that these are .geojson files?
  2. Are you planning on making the other .json files into .geojson?
  3. Do you like the idea of allowing the files to be imported in this way?
  4. If you would rather not have this feature in this project, would you be happy for me to make a separate package which allows this feature somehow?

Thank you very much for your time!

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.