@lipagas/storefront-engine
Version:
Headless Commerce & Marketplace Extension for Fleetbase
43 lines (31 loc) • 1.18 kB
Markdown
Geo I/O WKB Parser
==================
[](https://travis-ci.org/geo-io/wkb-parser)
[](https://coveralls.io/github/geo-io/wkb-parser?branch=master)
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
-------
Geo I/O WKB Parser is released under the [MIT License](LICENSE).