https://github.com/geo-io/wkb-parser
Well-known binary (WKB) Parser.
https://github.com/geo-io/wkb-parser
geo geography geometry parser spatial wkb
Last synced: 3 days ago
JSON representation
Well-known binary (WKB) Parser.
- Host: GitHub
- URL: https://github.com/geo-io/wkb-parser
- Owner: geo-io
- License: mit
- Created: 2014-02-25T20:56:23.000Z (about 12 years ago)
- Default Branch: main
- Last Pushed: 2022-01-20T09:48:25.000Z (about 4 years ago)
- Last Synced: 2025-08-19T16:07:31.194Z (8 months ago)
- Topics: geo, geography, geometry, parser, spatial, wkb
- Language: PHP
- Homepage:
- Size: 36.1 KB
- Stars: 77
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Geo I/O WKB Parser
==================
[](https://github.com/geo-io/wkb-parser/actions/workflows/ci.yml)
[](https://coveralls.io/github/geo-io/wkb-parser?branch=main)
A parser which transforms
[Well-known binary (WKB)](http://en.wikipedia.org/wiki/Well-known_text#Well-known_binary)
representations into geometric objects.
```php
class MyFactory implements GeoIO\Factory
{
public function createPoint($dimension, array $coordinates, $srid = null)
{
return MyPoint($coordinates['x'], $coordinates['y']);
}
// ...
}
$factory = MyFactory();
$parser = new GeoIO\WKB\Parser\Parser($factory);
$myPoint = $parser->parse('000000000140000000000000004010000000000000'); // POINT(2.0 4.0)
```
Installation
------------
Install [through composer](http://getcomposer.org). Check the
[packagist page](https://packagist.org/packages/geo-io/wkb-parser) for all
available versions.
```bash
composer require geo-io/wkb-parser
```
License
-------
Copyright (c) 2014-2022 Jan Sorgalla. Released under the [MIT License](LICENSE).