2017 © Pedro Peláez
 

library wkt-parser

Parser for well-known text (WKT) object strings

image

creof/wkt-parser

Parser for well-known text (WKT) object strings

  • Monday, May 9, 2016
  • by djlambert
  • Repository
  • 1 Watchers
  • 14 Stars
  • 362,610 Installations
  • PHP
  • 5 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 12 % Grown

The README.md

creof/wkt-parser

Code Climate Test Coverage Build Status, (*1)

Lexer and parser library for 2D, 3D, and 4D WKT/EWKT spatial object strings., (*2)

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:, (*3)

$input = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';

$parser = new Parser($input);

$value = $parser->parse();

If many values need to be parsed, a single Parser instance can be used:, (*4)

$input1 = 'POLYGON((0 0,10 0,10 10,0 10,0 0))';
$input2 = 'POINT(0,0)';

$parser = new Parser();

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

Return

The parser will return an array with the keys type, value, srid, and dimension. - type string, the spatial object type (POINT, LINESTRING, etc.) without any dimension. - value array, contains integer or float values for points, or nested arrays containing these based on spatial object type. - srid integer, the SRID if EWKT value was parsed, null otherwise. - dimension string, will contain Z, M, or ZM for the respective 3D and 4D objects, null otherwise., (*5)

Exceptions

The Lexer and Parser will throw exceptions implementing interface CrEOF\Geo\WKT\Exception\ExceptionInterface., (*6)

The Versions

09/05 2016

dev-develop

dev-develop

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt

03/05 2016

dev-master

9999999-dev

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt

03/05 2016

2.2.0

2.2.0.0

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt

10/04 2016

2.1.0

2.1.0.0

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt

18/11 2015

2.0.0

2.0.0.0

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt

12/11 2015

1.0.0

1.0.0.0

Parser for well-known text (WKT) object strings

  Sources   Download

MIT

The Requires

 

The Development Requires

by Derek J. Lambert

parser text lexer string geometry geography spatial wkt ewkt