airports-json
Version:
A comprehensive dataset of airports, countries, and regions in JSON format, including , with a script to generate data from CSV sources.
151 lines (121 loc) • 4.25 kB
Markdown
Airports provides JSON datasets of airports, including name, coordinates, elevation, country, region, IATA code and GPS code. Created by the team at [Jet Set Expert](https://jetsetexpert.com).
- Provides JSON datasets for airports, countries, and regions
- Generated datasets are filtered to include only medium and large airports by default
- Customizable airport types through the `--types` flag
- Fetches data from the following sources:
- [OurAirports: airports.csv](https://davidmegginson.github.io/ourairports-data/airports.csv)
- [OurAirports: countries.csv](https://davidmegginson.github.io/ourairports-data/countries.csv)
- [OurAirports: regions.csv](https://davidmegginson.github.io/ourairports-data/regions.csv)
```
[
{
"id": "12243",
"ident": "5A8",
"type": "medium_airport",
"name": "Aleknagik / New Airport",
"latitude_deg": "59.2826004028",
"longitude_deg": "-158.617996216",
"elevation_ft": "66",
"continent": "NA",
"iso_country": "US",
"iso_region": "US-AK",
"municipality": "Aleknagik",
"scheduled_service": "yes",
"gps_code": "5A8",
"iata_code": "WKK",
"local_code": "5A8",
"home_link": "",
"wikipedia_link": "https://en.wikipedia.org/wiki/Aleknagik_Airport",
"keywords": ""
},
...
]
```
```
[
{
"id": "302672",
"code": "AD",
"name": "Andorra",
"continent": "EU",
"wikipedia_link": "https://en.wikipedia.org/wiki/Andorra",
"keywords": "Andorran airports"
},
...
]
```
```
[
{
"id": "302811",
"code": "AD-02",
"local_code": "02",
"name": "Canillo Parish",
"continent": "EU",
"iso_country": "AD",
"wikipedia_link": "https://en.wikipedia.org/wiki/Canillo",
"keywords": "Airports in Canillo Parish"
},
...
]
```
Install the package using npm:
```bash
npm install airports-json
```
After installing the package, you can import and use the datasets in your project like this:
```javascript
const { airports, regions, countries } = require("airports-json");
// Use the datasets as needed
console.log(airports);
console.log(regions);
console.log(countries);
```
By default, the package includes data for medium and large airports. If you need to include other airport types or a custom set of types, you can generate the datasets with the --types flag followed by a comma-separated list of types.
First, clone the repository:
```bash
git clone https://github.com/JetSetExpert/airports.git
cd airports
```
Install the dependencies:
```bash
npm install
```
Generate the datasets with the desired airport types:
```bash
node src/generate.js --types small_airport,medium_airport,large_airport
```
Replace `small_airport,medium_airport,large_airport` with the desired types. Possible types are:
- balloonport
- closed
- heliport
- large_airport
- medium_airport
- seaplane_base
- small_airport
[](https://jetsetexpert.com)
[](https://github.com/jetsetexpert/airports)
[](https://www.npmjs.com/package/airports-json)
[](https://developer.aliyun.com/mirror/npm/package/airports-json)
[](https://npmmirror.com/package/airports-json)
[](https://www.jsdelivr.com/package/npm/airports-json)
[](https://snyk.io/advisor/npm-package/airports-json)
[](https://libraries.io/npm/airports-json)
[](https://npm.runkit.com/airports-json)
[](https://www.npmtrends.com/airports-json)
[](https://packagephobia.com/result?p=airports-json)
[](https://www.skypack.dev/view/airports-json)
[](https://cnpmjs.org/package/airports-json)
[](https://githubmemory.com/repo/javascriptutils/airports-json)
[](https://npm.io/package/airports-json)
[](https://www.pkgstats.com/pkg:airports-json)