dev-master
9999999-dev https://github.com/webtoucher/geometeo-libsGeoMeteo libraries
BSD-3-Clause
The Requires
- php >=5.6.0
by Alexey Kuznetsov
geolocation calculator sun wind meteo
GeoMeteo libraries
Libraries for GeoMeteo or another application., (*1)
The preferred way to install this library is through composer., (*3)
Either run, (*4)
$ php composer.phar require webtoucher/geometeo-libs "*"
or add, (*5)
"webtoucher/geometeo-libs": "*"
to the require
section of your composer.json
file., (*6)
use \webtoucher\geometeo\libs\GeoDataProvider; use \webtoucher\geometeo\libs\SunCalculator; use \webtoucher\geometeo\libs\Coordinate;
Create and configure data provider for selected geoposition., (*7)
$provider = new GeoDataProvider(55.012207, 83.289468, 'Asia/Novosibirsk');
or, (*8)
$provider = new GeoDataProvider( Coordinate::fromDms(55, 0, 43.945199999987, Coordinate::NORTH), Coordinate::fromDms(83, 17, 22.084799999998, Coordinate::EAST), 'Asia/Novosibirsk' );
Then you can calculate needed data with one of calculators and time grid., (*9)
$inputValuesGrid = [ '2017-03-02 19:00:00' => [], '2017-03-02 19:01:00' => [], '2017-03-02 19:02:00' => [], '2017-03-02 19:03:00' => [], '2017-03-02 19:04:00' => [], ]; $calculator = new SunCalculator(SunCalculator::AZIMUTH|SunCalculator::ALTITUDE); $outputValuesGrid = $provider->calculate($calculator, $inputValuesGrid); // $outputValuesGrid: // [ // '2017-03-02 19:00:00' => [ // SunCalculator::AZIMUTH => 257.89361108248, // SunCalculator::ALTITUDE => -0.36968324076901, // ], // '2017-03-02 19:01:00' => [ // SunCalculator::AZIMUTH => 258.09820089334, // SunCalculator::ALTITUDE => -0.50989896273262, // ], // '2017-03-02 19:02:00' => [ // SunCalculator::AZIMUTH => 258.30272277877, // SunCalculator::ALTITUDE => -0.65022023277039, // ], // '2017-03-02 19:03:00' => [ // SunCalculator::AZIMUTH => 258.50717913747, // SunCalculator::ALTITUDE => -0.7906452287774, // ], // '2017-03-02 19:04:00' => [ // SunCalculator::AZIMUTH => 258.71157237265, // SunCalculator::ALTITUDE => -0.93117213026396, // ], // ];
If you believe you have found a bug, please report it using the GitHub issue tracker., (*10)
GeoMeteo libraries
BSD-3-Clause
geolocation calculator sun wind meteo