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

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

swen100/geophp
==============

GeoPHP is an open-source native PHP library for doing geometry operations. It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: (E)WKT, (E)WKB, GeoJSON, KML, GPX, 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.

v1.0.10(3y ago)788.2k↓11.8%4GPL-3.0-or-laterPHPPHP &gt;=7.0.0

Since Feb 13Pushed 3y ago2 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (12)Used By (0)

[![Build Status](https://camo.githubusercontent.com/561b59b8cdb51f11d3ea4ea919b3c6d2b92cde837cda8ca9301483f6405c1a6c/68747470733a2f2f7472617669732d63692e6f72672f7377656e3130302f67656f5048502e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/swen100/geoPHP)[![Code Intelligence Status](https://camo.githubusercontent.com/c3b24486d82738506d48149865ef8ad06fb95991742c346598a583cb24d3eecd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7377656e3130302f67656f5048502f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/288088d08835991df99a4d19ffd4b352b878166cba8ffd9e74d1272433713e7c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7377656e3130302f67656f5048502f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/swen100/geoPHP/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/9bbcfc2884e19d68c6a77b95ea39b5d55c48a4a70663c865977575a133232b2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7377656e3130302f67656f7068702e737667)](https://packagist.org/packages/swen100/geophp)

[geophp.net](https://geophp.net "GeoPHP homepage")

GeoPHP is an open-source native PHP library for doing geometry operations. It is written entirely in PHP and can therefore run on shared hosts. It can read and write a wide variety of formats: WKT (including EWKT), WKB (including EWKB), 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.

This is a fork of the famous [geoPHP](https://github.com/phayes/geoPHP) library by Patrick Hayes.

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

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

[](#getting-started)

- Examples
    - Using geoPHP as a GIS format converter:
- Other Interesting Links:
    - Learn about GEOS integration at:

### Example usage

[](#example-usage)

```
