PHPackages                             longitude-one/spatial-types - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. longitude-one/spatial-types

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

longitude-one/spatial-types
===========================

This library implements PHP spatial types: their interfaces and their geometric and geographic classes.

0.0.1.alpha(1y ago)0132MITPHPPHP ^8.1

Since Aug 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/longitude-one/spatial-types)[ Packagist](https://packagist.org/packages/longitude-one/spatial-types)[ RSS](/packages/longitude-one-spatial-types/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (2)Used By (2)

Spatial Types Library
=====================

[](#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
--------------

[](#current-status)

[![longitude-one/spatial--types](https://camo.githubusercontent.com/93579c36559c5b81bf147e2711fdc917e6e41d741542a6bff2d16c4ccaa2b8c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6f6e6769747564652d2d6f6e652d7370617469616c2d2d74797065732d626c7565)](https://camo.githubusercontent.com/93579c36559c5b81bf147e2711fdc917e6e41d741542a6bff2d16c4ccaa2b8c5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6f6e6769747564652d2d6f6e652d7370617469616c2d2d74797065732d626c7565)[![Stable release](https://camo.githubusercontent.com/cb1731a39e9196bca99b34f06e4a30d8c0411abed576c117954b1d26b95ce502/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c6f6e6769747564652d6f6e652f7370617469616c2d7479706573)](https://camo.githubusercontent.com/cb1731a39e9196bca99b34f06e4a30d8c0411abed576c117954b1d26b95ce502/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6c6f6e6769747564652d6f6e652f7370617469616c2d7479706573)[![Minimum PHP Version](https://camo.githubusercontent.com/311b228529f5d96010ec70cef5af5c75cbd2cf638b75cc0be9a0663fc74a7ae0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c6f6e6769747564652d6f6e652f7370617469616c2d74797065732e7376673f6d61784167653d33363030)](https://camo.githubusercontent.com/311b228529f5d96010ec70cef5af5c75cbd2cf638b75cc0be9a0663fc74a7ae0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c6f6e6769747564652d6f6e652f7370617469616c2d74797065732e7376673f6d61784167653d33363030)[![Packagist License](https://camo.githubusercontent.com/0719a49408fe5ad51464b31549a3700d880172b7a75735b4020d255149f8affb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c6f6e6769747564652d6f6e652f7370617469616c2d7479706573)](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://camo.githubusercontent.com/391d0d006748421e3d77d609bce8598d87b87a3c1d611f09ab28eba0a492ff53/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f34393463353738353732636165303065633164622f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/longitude-one/spatial-types/maintainability)[![Downloads](https://camo.githubusercontent.com/e217eab0fcf1787b1164803cdf4b8cfe658b092b403ae440e2a90f64a8e85f6f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c6f6e6769747564652d6f6e652f7370617469616c2d74797065732e737667)](https://packagist.org/packages/longitude-one/spatial-types)[![Coverage Status](https://camo.githubusercontent.com/507bd402b659617eb7e1a79d07c47e930cd69e80dcc7b8ed962bed5fc3e1f9f0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c6f6e6769747564652d6f6e652f7370617469616c2d74797065732f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/longitude-one/spatial-types?branch=main)

Installation
------------

[](#installation)

```
composer require longitude-one/spatial-types
```

Usage
-----

[](#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
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

648d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5101481?v=4)[Alexandre Tranchant](/maintainers/Alexandre-T)[@Alexandre-T](https://github.com/Alexandre-T)

---

Top Contributors

[![Alexandre-T](https://avatars.githubusercontent.com/u/5101481?v=4)](https://github.com/Alexandre-T "Alexandre-T (39 commits)")

---

Tags

geometrygeographyopengispostgisgisspatialiso-13249

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/longitude-one-spatial-types/health.svg)

```
[![Health](https://phpackages.com/badges/longitude-one-spatial-types/health.svg)](https://phpackages.com/packages/longitude-one-spatial-types)
```

###  Alternatives

[longitude-one/doctrine-spatial

Doctrine multi-platform support for spatial types and functions, compliant with Doctrine 2.19, 3.1, and dev ones (3.2 and 4.0).

891.4M1](/packages/longitude-one-doctrine-spatial)[creof/doctrine2-spatial

Doctrine2 multi-platform support for spatial types and functions

2763.3M11](/packages/creof-doctrine2-spatial)[martin-georgiev/postgresql-for-doctrine

Extends Doctrine with native PostgreSQL support for arrays, JSONB, ranges, PostGIS geometries, text search, ltree, uuid, and 100+ PostgreSQL-specific functions.

4485.3M4](/packages/martin-georgiev-postgresql-for-doctrine)[jsor/doctrine-postgis

Spatial and Geographic Data with PostGIS and Doctrine.

2191.6M1](/packages/jsor-doctrine-postgis)[brick/geo

GIS geometry library

245862.1k15](/packages/brick-geo)[geokit/geokit

Geo-Toolkit for PHP

251924.7k6](/packages/geokit-geokit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
