aratnikov / distance-to-sea
Calculation of the nearest distance to the seas: Azov, Baltic, Caspian and Black
Installs: 8 635
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: >=7.3
- ext-json: *
- mjaschen/phpgeo: ^4.0
Requires (Dev)
- phpunit/phpunit: ^9.5
- squizlabs/php_codesniffer: ^3.5
This package is auto-updated.
Last update: 2025-03-29 00:50:24 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.