1. Go to this page and download the library: Download longitude-one/spatial-types library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
longitude-one / spatial-types example snippets
use LongitudeOne\SpatialTypes\Types\Dimension2\Geometry\LineString;
use LongitudeOne\SpatialTypes\Types\Dimension2\Geometry\Point;
$point = new Point(1, 2);
echo $point->getX(); // 1
echo $point->getY(); // 2
$lineString = new LineString([
new Point(1, 2, 4326),
new Point(3, 4, 4326),
new Point(5, 6, 4326),
], 4326);
$lineString->getSrid(); // 4326
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.