world-countries-centroids

Centroids of world countries in CSV, GeoJson, etc

Usage no npm install needed!

<script type="module">
  import worldCountriesCentroids from 'https://cdn.skypack.dev/world-countries-centroids';
</script>

README

World Countries - Centroids

Centroids of world countries in CSV, GeoJson, etc

Background/Problems

  • There is no generally accepted definition of geographic center, and no completely satisfactory method for determining it. (USGS)
  • The geographic center of a region is a fundamental geographic concept, and yet there is no commonly accepted method for its determination. (Peter A. Rogerson)

Schema

  • longitude
  • latitude
  • COUNTRY - country name
  • ISO - country ISO code
  • COUNTRYAFF - country affiliated
  • AFF_ISO - country affiliated ISO code

Data Usage

There are multiple ways to access the data.

Download

You may download the data and check the dist folder for data.

ArcGIS Feature Service

The data is also published to an ArcGIS Online hosted feature service. The REST endpoint to query is:

https://services9.arcgis.com/l9yXFvhjz46ekkZV/arcgis/rest/services/Countries_Centroids/FeatureServer/0/query

For example, get the center point of Mexico:

https://services9.arcgis.com/l9yXFvhjz46ekkZV/arcgis/rest/services/Countries_Centroids/FeatureServer/0/query?where=ISO+%3D+%27MX%27&outFields=*&f=pgeojson

REST call - all data

Use JSDelivr to get all the data as CSV or GeoJSON:

NPM

https://www.npmjs.com/package/world-countries-centroids

License

See LICENSE file.