| Current Path : /var/www/v3.cesa.co.za/vendor/creof/wkt-parser/ |
| Current File : /var/www/v3.cesa.co.za/vendor/creof/wkt-parser/README.md |
# creof/wkt-parser [](https://codeclimate.com/github/creof/wkt-parser) [](https://codeclimate.com/github/creof/wkt-parser/coverage) [](https://travis-ci.org/creof/wkt-parser) Lexer and parser library for WKT/EWKT spatial object strings. ## Usage Pass value to be parsed in the constructor, then call parse() on the created object. ```php $input = 'POLYGON((0 0,10 0,10 10,0 10,0 0))'; $parser = new Parser($input); $value = $parser->parse(); ``` ## Return The parser will return an array with the keys ```srid```, ```type```, and ```value```. - ```srid``` is the SRID if EWKT was passed in the constructor, null otherwise. - ```type``` is the spatial object type. - ```value``` will contain an array with 2 numeric values, or nested arrays containing these depending on the spatial object type.