longitude-one / spatial-types
This library implements PHP spatial types: their interfaces and their geometric and geographic classes.
Installs: 13
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/longitude-one/spatial-types
Requires
- php: ^8.1
- doctrine/deprecations: ^1.1.3
- longitude-one/geo-parser: ^3.0.1
Requires (Dev)
- ext-pcov: *
- phpunit/phpunit: ^10
This package is auto-updated.
Last update: 2025-10-08 15:52:22 UTC
README
Implement spatial PHP types and their geometric and geographic classes.
If you want to persist spatial data in a database, you should use the longitude-one/doctrine2-spatial package.
Current status
Installation
composer require longitude-one/spatial-types
Usage
use LongitudeOne\Spatial\Types\Geometry\Point; $point = new Point(1, 2); echo $point->getX(); // 1 echo $point->getY(); // 2 $lineString = new LineString([ new Point(1, 2), new Point(3, 4), new Point(5, 6), ], 4326); $lineString->getSrid(); // 4326