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

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

pavloniym/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.

v2.0.3(2y ago)05GPL-2.0-or-laterPHPPHP ^7.1|^8.0

Since Nov 22Pushed 1y agoCompare

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

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

[![Build Status](https://camo.githubusercontent.com/b3a1de1cc34173b4aad05780451adaa503f8cd5814f3a5ee967a9be7f6fd72bd/68747470733a2f2f7472617669732d63692e636f6d2f66756e69712f67656f5048502e7376673f6272616e63683d646576656c6f706d656e74)](https://travis-ci.com/funiq/geoPHP)[![Coverage Status](https://camo.githubusercontent.com/601a98b4c3b5370fa859415b87493a5b259a6621e7daed72e77538f040affd55/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f66756e69712f67656f5048502f62616467652e7376673f6272616e63683d646576656c6f706d656e74)](https://coveralls.io/github/funiq/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.

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/funiq/geoPHP/issues), send [pull](https://github.com/funiq/geoPHP/pulls) requests and I will merge them into the main branch.

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

[](#getting-started)

### Example usage

[](#example-usage)

```
