Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/longitude-one/spatial-types
Implement spatial interfaces and their geometric and geographic classes
https://github.com/longitude-one/spatial-types
Last synced: 3 months ago
JSON representation
Implement spatial interfaces and their geometric and geographic classes
- Host: GitHub
- URL: https://github.com/longitude-one/spatial-types
- Owner: longitude-one
- License: mit
- Created: 2024-07-14T09:04:55.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T13:23:28.000Z (7 months ago)
- Last Synced: 2024-08-09T15:19:54.827Z (6 months ago)
- Language: PHP
- Size: 195 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spatial Types Library
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](https://github.com/longitude-one/doctrine2-spatial) package.## Current status



[](https://github.com/longitude-one/spatial-types/blob/main/LICENSE)[](https://github.com/longitude-one/spatial-types/actions/workflows/php-oldest.yaml)
[](https://github.com/longitude-one/spatial-types/actions/workflows/php-latests.yaml)
[](https://codeclimate.com/github/longitude-one/spatial-types/maintainability)
[](https://packagist.org/packages/longitude-one/spatial-types)
[](https://coveralls.io/github/longitude-one/spatial-types?branch=main)## Installation
```bash
composer require longitude-one/spatial-types
```## Usage
```php
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
```