PHPackages                             agencelimitless/wkt-parser - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. agencelimitless/wkt-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

agencelimitless/wkt-parser
==========================

Parser for well-known text (WKT) object strings

3.0.0(6y ago)0401MITPHPPHP &gt;=5.3.3

Since Nov 11Pushed 6y agoCompare

[ Source](https://github.com/agencelimitless/wkt-parser)[ Packagist](https://packagist.org/packages/agencelimitless/wkt-parser)[ RSS](/packages/agencelimitless-wkt-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (7)Used By (1)

creof/wkt-parser
================

[](#creofwkt-parser)

[![Code Climate](https://camo.githubusercontent.com/f90cdbd841d60e0d1b4843e375b136a0e1501f8e51c0620a02104e50ecabbf9b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6372656f662f776b742d7061727365722f6261646765732f6770612e737667)](https://codeclimate.com/github/creof/wkt-parser)[![Test Coverage](https://camo.githubusercontent.com/3915fbd9679d7292b445e3a30ed97b27e2c6e83d632c20bb946ce3e0020d419e/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6372656f662f776b742d7061727365722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/creof/wkt-parser/coverage)[![Build Status](https://camo.githubusercontent.com/3e41b918c909ff8d0d15fb1e5063410cc4226ec2450428a7961f12be0a0c87aa/68747470733a2f2f7472617669732d63692e6f72672f6372656f662f776b742d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/creof/wkt-parser)

Lexer and parser library for 2D, 3D, and 4D WKT/EWKT spatial object strings.

Usage
-----

[](#usage)

There are two use patterns for the parser. The value to be parsed can be passed into the constructor, then parse() called on the returned `Parser` object:

```
$input = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';

$parser = new Parser($input);

$value = $parser->parse();
```

If many values need to be parsed, a single `Parser` instance can be used:

```
$input1 = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';
$input2 = 'POINT(0,0)';

$parser = new Parser();

$value1 = $parser->parse($input1);
$value2 = $parser->parse($input2);
```

Return
------

[](#return)

The parser will return an array with the keys `type`, `value`, `srid`, and `dimension`.

- `type` string, the spatial object type (POINT, LINESTRING, etc.) without any dimension.
- `value` array, contains integer or float values for points, or nested arrays containing these based on spatial object type.
- `srid` integer, the SRID if EWKT value was parsed, `null` otherwise.
- `dimension` string, will contain `Z`, `M`, or `ZM` for the respective 3D and 4D objects, `null` otherwise.

Exceptions
----------

[](#exceptions)

The `Lexer` and `Parser` will throw exceptions implementing interface `CrEOF\Geo\WKT\Exception\ExceptionInterface`.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 98.6% 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

Every ~339 days

Total

5

Last Release

2472d ago

Major Versions

1.0.0 → 2.0.02015-11-18

2.2.0 → 3.0.02019-08-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/b5b37b12f47370cf8ab3d7a35b38b87a6b2e97ecdf105b300dc4da2473e6581e?d=identicon)[agencelimitless](/maintainers/agencelimitless)

---

Top Contributors

[![djlambert](https://avatars.githubusercontent.com/u/1187338?v=4)](https://github.com/djlambert "djlambert (70 commits)")[![Gurdarrag](https://avatars.githubusercontent.com/u/18448952?v=4)](https://github.com/Gurdarrag "Gurdarrag (1 commits)")

---

Tags

stringparserlexertextgeometrygeographyspatialwktewkt

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agencelimitless-wkt-parser/health.svg)

```
[![Health](https://phpackages.com/badges/agencelimitless-wkt-parser/health.svg)](https://phpackages.com/packages/agencelimitless-wkt-parser)
```

###  Alternatives

[creof/wkt-parser

Parser for well-known text (WKT) object strings

554.8M16](/packages/creof-wkt-parser)[creof/geo-parser

Parser for geography coordinate strings

624.4M15](/packages/creof-geo-parser)[creof/wkb-parser

Parser for well-known binary (WKB/EWKB) object data

615.1M16](/packages/creof-wkb-parser)[doctrine/lexer

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.

11.2k910.8M118](/packages/doctrine-lexer)[cerbero/json-parser

Zero-dependencies pull parser to read large JSON from any source in a memory-efficient way.

803474.6k5](/packages/cerbero-json-parser)[geo-io/wkb-parser

Well-known binary (WKB) Parser.

786.0M48](/packages/geo-io-wkb-parser)

PHPackages © 2026

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