Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lahdekorpi/finland-city-distances

Calculates distances between cities in Finland
https://github.com/lahdekorpi/finland-city-distances

Last synced: 10 days ago
JSON representation

Calculates distances between cities in Finland

Awesome Lists containing this project

README

        

# Finland-city-distances
Calculates distances between cities in Finland

## Usage
```php
$cd = new CityDistances();
echo $cd->cityNames; // Outputs list of cities in the database
echo $cd->cityDistance("Pori", "Helsinki"); // Outputs the distance between two cities in kilometers (374.92202880166)
echo $cd->distance(21.783, 61.483, 24.931,60.17); // Outputs the distance between two coordinates (lat, lng)
echo $cd->getCityCoordinates("Pori"); // Outputs the coordinates of a city array(2) { [0]=> float(21.783) [1]=> float(61.483) }
```