Skip to content

ersien/sea-ports

This branch is 3 commits behind marchah/sea-ports:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 9, 2020
993a8ca · Oct 9, 2020

History

34 Commits
Oct 9, 2020
Apr 12, 2016
Apr 11, 2016
Apr 11, 2016
Apr 11, 2016
Apr 11, 2016
Apr 29, 2016
Apr 11, 2016
Jun 18, 2020
Apr 12, 2016
Oct 9, 2020

Repository files navigation

sea-ports

Sea Ports JSON Data

Be aware the GPS coordinates are not all correct

Installation

Install via npm:

$ npm install sea-ports

Documentation

Data

JSON

Return a JSON object with all the ports with the unloc as key

{
  "AEAJM": {
    "name": "Ajman",
    "city": "Ajman",
    "country": "United Arab Emirates",
    "alias": [],
    "regions": [],
    "coordinates": [
      55.5136433,
      25.4052165
    ],
    "province": "Ajman",
    "timezone": "Asia/Dubai",
    "unlocs": [
      "AEAJM"
    ],
    "code" : "52000"
  },
  "AEAUH": {
    "name": "Abu Dhabi",
    "coordinates": [
      54.37,
      24.47
    ],
    "city": "Abu Dhabi",
    "province": "Abu Z¸aby [Abu Dhabi]",
    "country": "United Arab Emirates",
    "alias": [],
    "regions": [],
    "timezone": "Asia/Dubai",
    "unlocs": [
      "AEAUH"
    ],
    "code": "52001"
  },
  "AEDXB": {
    "name": "Dubai",
    "coordinates": [
      55.27,
      25.25
    ],
    "city": "Dubai",
    "province": "Dubayy [Dubai]",
    "country": "United Arab Emirates",
    "alias": [],
    "regions": [],
    "timezone": "Asia/Dubai",
    "unlocs": [
      "AEDXB"
    ],
    "code": "52005"
  },
  ...
}

Methods

getByUnloc(unloc)

Return the matched port, else undefined (alias: getByUNLOC, findByUnloc, findByUNLOC)

Examples

var ports = require('sea-ports');

console.log(ports.JSON);
/*
{
  "AEAJM": {
    "name": "Ajman",
    "city": "Ajman",
    "country": "United Arab Emirates",
    "alias": [],
    "regions": [],
    "coordinates": [
      55.5136433,
      25.4052165
    ],
    "province": "Ajman",
    "timezone": "Asia/Dubai",
    "unlocs": [
      "AEAJM"
    ],
    "code" : "52000"
  },
  ...
}
*/

Contributing

This project is a work in progress and subject to API changes. A lot of port's codes are missing (338/1624). Some data may be wrong, feel free to correct them. Also I plan on adding couple functions to search ports.

Please feel free to contribute

About

JSON Data Sea Ports

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%