PHPackages                             agencelimitless/wkb-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/wkb-parser

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

agencelimitless/wkb-parser
==========================

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

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

Since Nov 16Pushed 6y agoCompare

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

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

creof/wkb-parser
================

[](#creofwkb-parser)

[![Build Status](https://camo.githubusercontent.com/1de3675667a03e9ba4fd6bee395cea0ec226cac4a28db046811b816f3b72eaa8/68747470733a2f2f7472617669732d63692e6f72672f6372656f662f776b622d7061727365722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/creof/wkb-parser)[![Code Climate](https://camo.githubusercontent.com/9fd4332f61a593f0f9391b16f4008507befb51afdaf1994a237b037918a7e379/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6372656f662f776b622d7061727365722f6261646765732f6770612e737667)](https://codeclimate.com/github/creof/wkb-parser)[![Test Coverage](https://camo.githubusercontent.com/67d000cb23370aeff8b47dd4f1c9d4afff037f5f51c5daded2780f469ec65324/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6372656f662f776b622d7061727365722f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/creof/wkb-parser/coverage)[![Coverage Status](https://camo.githubusercontent.com/3140942173a6bc6928a766e68c352448902ae7c0f6b37d6888edd62de1d0fdec/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6372656f662f776b622d7061727365722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/creof/wkb-parser?branch=master)

Parser library for 2D, 3D, and 4D Open Geospatial Consortium (OGC) WKB or PostGIS EWKB spatial object data.

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:

```
$parser = new Parser($input);

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

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

```
$parser = new Parser();

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

### Input value

[](#input-value)

#### Encoding

[](#encoding)

The parser currently supports 3 WKB encodings:

- OGC v1.1
- OGC v1.2
- PostGIS EWKB

#### Format

[](#format)

The parser supports a number of input formats:

- Binary string (as returned from database or `pack('H*', $hexString)`)
- Bare hexadecimal text string (`'01010000003D0AD7A3.....'`)
- Hexadecimal test string prepended with `x`, `X`, `0x`, or `0X` (`'0x01010000003D0AD7A3.....'`, etc.)

Return
------

[](#return)

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

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

Exceptions
----------

[](#exceptions)

The `Reader` and `Parser` will throw exceptions implementing interface `CrEOF\Geo\WKB\Exception\ExceptionInterface`.

References
----------

[](#references)

- PostGIS EWKB -
- OGC Simple Feature Access, Part 1 -
- OGC Simple Feature Access, Part 2 -

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 99.3% 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 ~225 days

Recently: every ~338 days

Total

7

Last Release

2471d ago

Major Versions

1.0.1 → 2.0.02015-11-18

v2.3.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 (140 commits)")[![Gurdarrag](https://avatars.githubusercontent.com/u/18448952?v=4)](https://github.com/Gurdarrag "Gurdarrag (1 commits)")

---

Tags

stringparsertextgeometrygeographyspatialwkbewkb

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[creof/wkb-parser

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

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

Parser for geography coordinate strings

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

Parser for well-known text (WKT) object strings

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

Well-known binary (WKB) Parser.

786.0M48](/packages/geo-io-wkb-parser)[fanatique/php-fixed-length-file-parser

A parser class for handling fixed length text files in PHP

159.3k](/packages/fanatique-php-fixed-length-file-parser)[laurentvw/scrapher

A web scraper for PHP to easily extract data from web pages

192.5k1](/packages/laurentvw-scrapher)

PHPackages © 2026

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