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: about 5 hours 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 (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T13:23:28.000Z (3 months ago)
- Last Synced: 2024-08-09T15:19:54.827Z (3 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
![longitude-one/spatial--types](https://img.shields.io/badge/longitude--one-spatial--types-blue)
![Stable release](https://img.shields.io/github/v/release/longitude-one/spatial-types)
![Minimum PHP Version](https://img.shields.io/packagist/php-v/longitude-one/spatial-types.svg?maxAge=3600)
[![Packagist License](https://img.shields.io/packagist/l/longitude-one/spatial-types)](https://github.com/longitude-one/spatial-types/blob/main/LICENSE)[![Last integration test](https://github.com/longitude-one/spatial-types/actions/workflows/php-oldest.yaml/badge.svg)](https://github.com/longitude-one/spatial-types/actions/workflows/php-oldest.yaml)
[![Last integration test](https://github.com/longitude-one/spatial-types/actions/workflows/php-oldest.yaml/badge.svg)](https://github.com/longitude-one/spatial-types/actions/workflows/php-latests.yaml)
[![Maintainability](https://api.codeclimate.com/v1/badges/494c578572cae00ec1db/maintainability)](https://codeclimate.com/github/longitude-one/spatial-types/maintainability)
[![Downloads](https://img.shields.io/packagist/dm/longitude-one/spatial-types.svg)](https://packagist.org/packages/longitude-one/spatial-types)
[![Coverage Status](https://coveralls.io/repos/github/longitude-one/spatial-types/badge.svg?branch=main)](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
```