siddthartha / geo-area-fast
Geographical area of given polygon in WGS84
Installs: 10
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/siddthartha/geo-area-fast
Requires
- php: >=5.4.0
- components/qunit: ^1.11
Requires (Dev)
- phpunit/phpunit: ^4
This package is not auto-updated.
Last update: 2025-10-01 23:24:58 UTC
README
Все аналогично geo-area-calculator
Вычисление площади полигона в координатах WGS'84. Порт ??-алгоритма на PHP и JS. Статья источник:
Установка
В корне модуля:
.../geo-area-calculator-fast$ composer install
Если необходимы js-тесты:
.../geo-area-calculator-fast$ npm install
Тесты
PHP
.../geo-area-calculator-fast$ phpunit
JavaScript
.../geo-area-calculator-fast$ npm test
Примеры
JavaScript
alert( ffGeo.getGeoPolygonAreaFast( [ [ -10.812317, 18 ], [ 10.812317, -18 ], [ 26.565051, 18 ], [ 52.622632, -18 ], [ 52.622632, 54 ], [ 10.812317, 54 ], [ -10.812317, 18 ], ] ) );
PHP
use siddthartha\geo\area\fast\helpers\GeoAreaFastCalculator; echo GeoAreaFastCalculator::getArea( [ [ -10.812317, 18 ], [ 10.812317, -18 ], [ 26.565051, 18 ], [ 52.622632, -18 ], [ 52.622632, 54 ], [ 10.812317, 54 ], [ -10.812317, 18 ], ] ); // 33953235824742.51 (sq.meters)