Giter Site home page Giter Site logo

romka-chev / geo-area-calculator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from siddthartha/geo-area-calculator

0.0 2.0 0.0 280 KB

Helpers for calculating geographical area of a given polygon in WGS'84 coordinates standart

PHP 52.17% JavaScript 41.59% HTML 6.25%

geo-area-calculator's Introduction

geo-area-calculator

Вычисление площади полигона в координатах WGS'84. Порт Python-алгоритма на PHP и JS. Статья источник: http://gis-lab.info/qa/polygon-area-sphere-ellipsoid.html

Установка

В корне модуля:

.../geo-area-calculator$ composer install

Если необходимы js-тесты:

.../geo-area-calculator$ npm install

Тесты

PHP

.../geo-area-calculator$ phpunit

JavaScript

.../geo-area-calculator$ npm test

Примеры

JavaScript

alert( FFGeo.getGeoPolygonArea(
			[
				[ -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\helpers\GeoAreaCalculator;

echo GeoAreaCalculator::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)

geo-area-calculator's People

Contributors

romka-chev avatar siddthartha avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.