aratnikov/distance-to-sea

Calculation of the nearest distance to the seas: Azov, Baltic, Caspian and Black

1.0.2 2022-02-02 09:04 UTC

This package is auto-updated.

Last update: 2024-03-29 04:32:52 UTC


README

Calculation of the nearest distance to the seas: Azov, Baltic, Caspian and Black.

Requirements

Minimum required PHP version is 7.3.

Installation

Using Composer, just add it to your composer.json by running:

composer require aratnikov/distance-to-sea 

Examples/Usage

<?php

use ARatnikov\DistanceToSea\{Calculating, Seas};

$calculating = Calculating::getInstance();

$lat = 44.47755606247829;
$lng = 34.145802750750015;

//to the nearest sea
$result = $calculating->calculateToNearestSea($lat, $lng);

//or to a certain sea
$result = $calculating->calculateToSea(Seas::BLACK_SEA, $lat, $lng);

echo "To the {$result->getSeaName()} {$result->getDistance()} meters"; // To the black_sea 700 meters

License

The MIT License (MIT). Please see License File for more information.