You are here

protected function WKT::trimParens in geoPHP 8

Same name and namespace in other branches
  1. 7 geoPHP/lib/adapters/WKT.class.php \WKT::trimParens()

Trim the parenthesis and spaces

7 calls to WKT::trimParens()
WKT::parseGeometryCollection in geoPHP/lib/adapters/WKT.class.php
WKT::parseLineString in geoPHP/lib/adapters/WKT.class.php
WKT::parseMultiLineString in geoPHP/lib/adapters/WKT.class.php
WKT::parseMultiPoint in geoPHP/lib/adapters/WKT.class.php
WKT::parseMultiPolygon in geoPHP/lib/adapters/WKT.class.php

... See full list

File

geoPHP/lib/adapters/WKT.class.php, line 172

Class

WKT
WKT (Well Known Text) Adapter

Code

protected function trimParens($str) {
  $str = trim($str);

  // We want to only strip off one set of parenthesis
  if ($this
    ->beginsWith($str, '(')) {
    return substr($str, 1, -1);
  }
  else {
    return $str;
  }
}