Skip to content
Snippets Groups Projects
Commit 9284cb16 authored by Patrick Hayes's avatar Patrick Hayes
Browse files

Merge pull request #79 from GJdan/3d-wkt-fix

Bugfix - 3d WKT is incorrectly trimmed trigguring exception in Point constructor
parents 0aae7c3d db424146
Branches
Tags
No related merge requests found
......@@ -45,7 +45,7 @@ class WKT extends GeoAdapter
foreach (geoPHP::geometryList() as $geom_type) {
$wkt_geom = strtoupper($geom_type);
if (strtoupper(substr($wkt, 0, strlen($wkt_geom))) == $wkt_geom) {
$data_string = $this->getDataString($wkt, $wkt_geom);
$data_string = $this->getDataString($wkt);
$method = 'parse'.$geom_type;
if ($srid) {
......@@ -162,8 +162,13 @@ class WKT extends GeoAdapter
return new GeometryCollection($geometries);
}
protected function getDataString($wkt, $type) {
return substr($wkt, strlen($type));
protected function getDataString($wkt) {
$first_paren = strpos($wkt, '(');
if ($first_paren !== FALSE) {
return substr($wkt, $first_paren);
}
return FALSE;
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment