Station

Station

Class to parse station object.

Constructor

new Station(station)

Create a station.

Parameters:
Name Type Description
station Station~Object

The station object.

Properties:
Name Type Description
station Station~Object

The station object.

Source:

Methods

getId() → {number}

Returns the station id.

Source:
Example
const station = new Station(stationObject);
const stationID = station.getId();
// => 944

getName() → {string}

Returns the station name.

Source:
Example
const station = new Station(stationObject);
const stationName = station.getName();
// => "Poznan-Dabrowskiego"

getCoordinates() → {Station~Coordinates}

Returns the station coordinates.

Source:
Example
const station = new Station(stationObject);
const stationCoordinates = station.getCoordinates();
// => { lat: 52.420319, lon: 16.877289 }

getCity() → {Station~City}

Returns the station city information.

Source:
Example
const station = new Station(stationObject);
const stationCity = station.getCity();
// => { id: 729, name: "Poznań", address: "ul. Dąbrowskiego 169", voivodeship: "WIELKOPOLSKIE" }

getRaw() → {Station~Object}

Returns the station raw object.

Source:
Example
const station = new Station(stationObject);
const stationCity = station.getRaw();

Type Definitions

Object :object

Station object

Properties:
Name Type Description
id number

The station id

stationName string

The station name

gegrLat string

The station Latitude

gegrLon string

The station Longitude

city object

The station city object

Properties
Name Type Description
id number

The station city id

name string

The station city name

commune object

The station city commune

Properties
Name Type Description
communeName string

The city commune name

districtName string

The city district name

provinceName string

The city voivodeship

Source:

City :object

Station city object

Properties:
Name Type Description
id number

The city id

name string

The city name

address string

The city address

voivodeship string

The city voivodeship

Source:

Coordinates :object

Staion coordinates object

Properties:
Name Type Description
lat number

The latitude value

lon number

The longitude value

Source: