PHPackages                             wgirhad/geophp - 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. wgirhad/geophp

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

wgirhad/geophp
==============

Open-source native PHP library for doing geometry operations. Can read and write a wide variety of formats: (E)WKT, (E)WKB, TWKB, GeoJSON, KML, GPX, GeoRSS. Works with all Simple-Feature geometries (Point, LineString, Polygon...) and can be used to get centroids, bounding-boxes, area, etc.

v3.0.0(3y ago)349.9k↓15.2%5GPL-2.0-or-laterPHPPHP ^7.1|^8.0

Since Feb 24Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wgirhad/geoPHP)[ Packagist](https://packagist.org/packages/wgirhad/geophp)[ Docs](https://github.com/wgirhad/geoPHP)[ RSS](/packages/wgirhad-geophp/feed)WikiDiscussions main Synced 1mo ago

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

[![Build Status](https://camo.githubusercontent.com/abfd120e45a5b3989bd3f9a51bafab73d524bb3156a8f2af1243a5d6078ec6ef/68747470733a2f2f7472617669732d63692e636f6d2f776769726861642f67656f5048502e7376673f6272616e63683d646576656c6f706d656e74)](https://travis-ci.com/wgirhad/geoPHP)[![Coverage Status](https://camo.githubusercontent.com/44ad8e9042616abb6d11dd0134d8b351d57558d42866b62722ff680fe3d17d47/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f776769726861642f67656f5048502f62616467652e7376673f6272616e63683d646576656c6f706d656e74)](https://coveralls.io/github/wgirhad/geoPHP?branch=development)

GeoPHP is a open-source native PHP library for doing geometry operations. It is a fork of famous [geoPHP](https://github.com/phayes/geoPHP) library by Patrick Hayes.

Notice about this repo
----------------------

[](#notice-about-this-repo)

*This fork aims to unify the most relevant forks from the original work of phayes/geoPHP*

### Goals

[](#goals)

- Maintain compatibility with current [supported versions of PHP](https://www.php.net/supported-versions.php)
- Keep the unit tests compatible with the latest PHPUnit
- Merge contributions from other [geoPHP forks](https://github.com/phayes/geoPHP/forks), like [funiq](https://github.com/funiq/geoPHP), [swen100](https://github.com/swen100/geoPHP) and others

It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: WKT (EWKT), WKB (EWKB), TWKB, GeoJSON, KML, GPX, and GeoRSS. It works with all Simple-Feature geometries (Point, LineString, Polygon, GeometryCollection etc.) and can be used to get centroids, bounding-boxes, area, and a wide variety of other useful information.

GeoPHP also helpfully wraps the GEOS php extension so that applications can get a transparent performance increase when GEOS is installed on the server. When GEOS is installed, geoPHP also becomes fully compliant with the OpenGIS® Implementation Standard for Geographic information. With GEOS you get the full-set of openGIS functions in PHP like Union, IsWithin, Touches etc. This means that applications get a useful "core-set" of geometry operations that work in all environments, and an "extended-set"of operations for environments that have GEOS installed.

See the *getting started* section below for references and examples of everything that geoPHP can do.

Forks and contributions are welcome. Please open [issues](https://github.com/wgirhad/geoPHP/issues), send [pull](https://github.com/wgirhad/geoPHP/pulls) requests and I will merge them into the main branch.

Getting Started
---------------

[](#getting-started)

### Example usage

[](#example-usage)

```
