Setting as "Well-known Text" with x/y or lng/lat.
@example "POINT(-174.9999 4.9923)"

@param string $wktString
774809
function setAsWKT($wktString) {
		parent::setAsWKT($wktString);
		// check the wkt now
		preg_match('/^POINT\(([0-9.\-]+) ([0-9.\-]+)\)$/', $this->wkt, $matches);
		if(!$matches) return false;

		$this->x = (float)$matches[1];
		$this->y = (float)$matches[2];

		$this->isChanged = true;
	}
607262
public static function confirm($text)
    {
        top:
        $input = strtolower(static::input("$text [y/n]: "));
        if (!in_array($input, array('y', 'n'))) goto top;
        return $input === 'y' ? true : false;
    }
1097197
public function setPointer($charOffset)
    {
        if ($this->charCount < $charOffset) {
            $charOffset = $this->charCount;
        }
        $this->currentPos = $charOffset;
    }
267763
public void setLocation(String latitude, String longitude) {
        this.latitude = new BigDecimal(latitude);
        this.longitude = new BigDecimal(longitude);
    }
1353705
public function getStringPositionSql($substring, $string)
	{
		$this->connect();

		$query = "SELECT POSITION( $substring IN $string )";
		$this->setQuery($query);
		$position = $this->loadRow();

		return $position['position'];
	}
198398
function fromString( $contentObjectAttribute, $string )
    {
    	$data = $string !== '' && strpos( $string, '|#' ) !== false ? explode( '|#', $string ) : array( 0 );

    	if ( $data[0] != 0 )
    	{
            $location = new eZGmapLocation( array(
                            'contentobject_attribute_id' => $contentObjectAttribute->attribute('id'),
                            'contentobject_version' => $contentObjectAttribute->attribute('version'),
                            'latitude' => $data[1],
                            'longitude' => $data[2],
                            'address' => $data[3]
                         ));
            $contentObjectAttribute->setContent( $location );
    	}
    	$contentObjectAttribute->setAttribute( 'data_int', $data[0] );
    }
603321
private static Geometry parseWkt(String wkt) throws WktException {
		if (wkt != null) {
			int i1 = wkt.indexOf('(');
			int i2 = wkt.indexOf(' ');
			// allow both '(' and ' ('
			int i = Math.min(i1, i2);
			if (i < 0) {
				i = (i1 > 0 ? i1 : i2);
			}
			String type = null;
			if (i >= 0) {
				type = typeWktToGeom(wkt.substring(0, i).trim());
			}
			if (type == null) {
				throw new WktException(ERR_MSG + "type of geometry not supported");
			}
			if (wkt.indexOf("EMPTY") >= 0) {
				return new Geometry(type, 0, 0);
			}
			Geometry geometry = new Geometry(type, 0, 0);
			String result = parse(wkt.substring(wkt.indexOf('(')), geometry);
			if (result.length() != 0) {
				throw new WktException(ERR_MSG + "unexpected ending \"" + result + "\"");
			}
			return geometry;
		}
		throw new WktException(ERR_MSG + "illegal argument; no WKT");
	}
971429
def simple_trace_to_wkt_linestring(trace):
    '''
    
    '''
    trace_str = ""
    for point in trace:
        trace_str += ' %s %s,' % (point.longitude, point.latitude)
    trace_str = trace_str.lstrip(' ')
    return 'LINESTRING (' + trace_str.rstrip(',') + ')'
74394
function kmp(s, w) {
    if (kmp.isNumber(w)) w = ''+w;
    if (kmp.isNumber(s)) s = ''+s;
    if (!(kmp.isString(s) || kmp.isArray(s))) return -1;
    if (!(kmp.isString(w) || kmp.isArray(w))) return -1;
    var m = 0; // start of s
    var i = 0; // start of w
    var t = kmp.table(w);

    while (m + i < s.length) {
      if (w[i] === s[m+i]) {
        if (i === w.length - 1) {
          return m;
        }
        i = i + 1;
      } else {
        if (t[i] > -1) {
          m = m+i - t[i];
          i = t[i];
        } else {
          i = 0;
          m = m + 1;
        }
      }
    }

    return -1;
  }
687269
def point_from_string(string = "0x0")
      string = "0x0" if string.empty?
      raise ArgumentError if !string.match(/(\d*x)|(x\d*)/)

      x, y = string.scan(/(\d*)x(\d*)/)[0].map(&:to_i)

      x = 0 if x.nil?
      y = 0 if y.nil?
      {
        x: x,
        y: y
      }
    end
1268632
def set_query_latlon(self):
        '''
        
        '''

        if (isinstance(self.longitude, list) and
                isinstance(self.latitude, list)):
            self.lbox = True
            # west, east, south, north
            self.query.lonlat_box(self.longitude[0], self.longitude[1],
                                  self.latitude[0], self.latitude[1])
        else:
            self.lbox = False
            self.query.lonlat_point(self.longitude, self.latitude)
421797
public static function WGStoCHy($lat, $long)
    {

        // Converts decimal degrees sexagesimal seconds
        $lat = self::DECtoSEX($lat);
        $long = self::DECtoSEX($long);

        // Auxiliary values (% Bern)
        $lat_aux = ($lat - 169028.66) / 10000;
        $long_aux = ($long - 26782.5) / 10000;

        // Process Y
        $y = 600072.37
            + 211455.93 * $long_aux
            - 10938.51 * $long_aux * $lat_aux
            - 0.36 * $long_aux * pow($lat_aux, 2)
            - 44.54 * pow($long_aux, 3);

        return $y;
    }
1352944
private static String multiPointCoordinatesFromWkt(String wkt) {
        wkt = removeBrackets(wkt,1);
        boolean isSecondVersionMultiPoint = wkt.contains("(");
        String coordinates = "";
        if(isSecondVersionMultiPoint){
            //(10 40), (40 30), (20 20)-> 10 40, 40 30, 20 20
            wkt = wkt.replaceAll("\\(|\\)" ,"");
        }
        coordinates = getJsonArrayFromListOfPoints(wkt);
        return coordinates;
    }
1234215
function WGStoCHx(lat, lng) {

  // Converts degrees dec to sex
  lat = DECtoSEX(lat);
  lng = DECtoSEX(lng);

  // Converts degrees to seconds (sex)
  lat = DEGtoSEC(lat);
  lng = DEGtoSEC(lng);

  // Axiliary values (% Bern)
  const lat_aux = (lat - 169028.66) / 10000;
  const lng_aux = (lng - 26782.5) / 10000;

  // Process X
  const x = 200147.07 +
      308807.95 * lat_aux +
      3745.25 * Math.pow(lng_aux, 2) +
      76.63 * Math.pow(lat_aux, 2) -
      194.56 * Math.pow(lng_aux, 2) * lat_aux +
      119.79 * Math.pow(lat_aux, 3);

  return x;

}
83426
def point_from_string(s)
      byte = s.bytes.first
      m = from_nibble(byte >> 4)
      x = from_nibble(byte & 0x0f)
      y = int_from_be(s[1..-1])
      [m, x, y]
    end
214631
def simple_edge_to_wkt_linestring(edge):
    '''
    
    '''
    trace_str = ""
    for point in edge:
        trace_str += ' %s %s %s,' % (point.longitude, point.latitude,
                                     point.depth)
    trace_str = trace_str.lstrip(' ')
    return 'LINESTRING (' + trace_str.rstrip(',') + ')'
483745
public function setFromString($coordinates)
    {
        if (!is_string($coordinates)) {
            throw new InvalidArgumentException('The given coordinates should be a string !');
        }

        try {
            $inDecimalDegree = $this->toDecimalDegrees($coordinates);
            $this->setLatitude($inDecimalDegree[0]);
            $this->setLongitude($inDecimalDegree[1]);
        } catch (InvalidArgumentException $e) {
            throw $e;
        }
    }