lizmapWkt
in package
Tags
Table of Contents
Properties
- $regExes : array<string, string>
Methods
- check() : array<string|int, mixed>|false
- Check if the WKT string is well formed.
- parse() : null|array<string|int, mixed>
- Return a geometry array likes it is defined in GeoJSON.
- parseLineString() : null|array<string|int, mixed>
- Return a LineString coordinates array.
- parseMultiLineString() : null|array<string|int, mixed>
- Return a Multi LineString coordinates array.
- parseMultiPoint() : null|array<string|int, mixed>
- Return a Multi Point coordinates array.
- parseMultiPolygon() : null|array<string|int, mixed>
- Return a Multi Polygon coordinates array.
- parsePoint() : null|array<string|int, mixed>
- Return a Point coordinates array.
- parsePolygon() : null|array<string|int, mixed>
- Return a Polygon coordinates array.
Properties
$regExes
protected
static array<string, string>
$regExes
= array(
'typeStr' => '/^\s*(\w+)\s*(\w+)?\s*\(\s*(.*)\s*\)\s*$/',
'spaces' => '/\s+/',
'parenComma' => '/\)\s*,\s*\(/',
'doubleParenComma' => '/\)\s*\)\s*,\s*\(\s*\(/',
// can't use {2} here
'trimParens' => '/^\s*\(?(.*?)\)?\s*$/',
'checkCoordinates' => '/^[0-9 \(\)\.,]*$/',
)
Methods
check()
Check if the WKT string is well formed.
public
static check(string $wkt) : array<string|int, mixed>|false
Parameters
- $wkt : string
-
A WKT string
Return values
array<string|int, mixed>|false —The WKT string is well formed
parse()
Return a geometry array likes it is defined in GeoJSON.
public
static parse(string $wkt) : null|array<string|int, mixed>
Parameters
- $wkt : string
-
A WKT string
Return values
null|array<string|int, mixed> —The geometry as described in GeoJSON
parseLineString()
Return a LineString coordinates array.
protected
static parseLineString(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the LineString
Tags
Return values
null|array<string|int, mixed> —The LinString coordinates, array of Points
parseMultiLineString()
Return a Multi LineString coordinates array.
protected
static parseMultiLineString(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the Multi LineString
Tags
Return values
null|array<string|int, mixed> —The Multi LineString coordinates, array of LineStrings
parseMultiPoint()
Return a Multi Point coordinates array.
protected
static parseMultiPoint(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the Multi Point
Tags
Return values
null|array<string|int, mixed> —The Multi Point coordinates, array of Points
parseMultiPolygon()
Return a Multi Polygon coordinates array.
protected
static parseMultiPolygon(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the Multi Polygon
Tags
Return values
null|array<string|int, mixed> —The Multi Polygon coordinates, array of Polygones
parsePoint()
Return a Point coordinates array.
protected
static parsePoint(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the Point
Tags
Return values
null|array<string|int, mixed> —The Point coordinates, array of coordinates
parsePolygon()
Return a Polygon coordinates array.
protected
static parsePolygon(string $str) : null|array<string|int, mixed>
Parameters
- $str : string
-
A WKT fragment representing the Polygon
Tags
Return values
null|array<string|int, mixed> —The Polygon coordinates, array of LinearRings