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: 2024-11-20 15:39:10 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

Copyright (c) 2014-2022 Jan Sorgalla. Released under the MIT License.