geo-io/wkt-parser

Well-known text (WKT) Parser.

v1.0.1 2015-11-09 12:35 UTC

This package is auto-updated.

Last update: 2021-07-05 11:44:39 UTC


README

Build Status Coverage Status

A parser which transforms Well-known text (WKT) representations into geometric objects.

class MyFactory implements GeoIO\Factory
{
    public function createPoint($dimension, array $coordinates, $srid = null)
    {
        return MyPoint($coordinates['x'], $coordinates['y']);
    }

    public function createLineString($dimension, array $points, $srid = null)
    {
        return MyLineString($points);
    }

    // ...
}

$factory = MyFactory();
$parser = new GeoIO\WKT\Parser\Parser($factory);

$myLineString = $parse->parse('LINESTRING(1 2, 2 2, 1 1)');

Installation

Install through composer. Check the packagist page for all available versions.

composer require geo-io/wkt-parser

License

Geo I/O WKT Parser is released under the MIT License.