You are here

function WKB::writePoint in geoPHP 7

Same name and namespace in other branches
  1. 8 geoPHP/lib/adapters/WKB.class.php \WKB::writePoint()
2 calls to WKB::writePoint()
EWKB::write in geoPHP/lib/adapters/EWKB.class.php
Serialize geometries into an EWKB binary string.
WKB::write in geoPHP/lib/adapters/WKB.class.php
Serialize geometries into WKB string.

File

geoPHP/lib/adapters/WKB.class.php, line 204

Class

WKB
PHP Geometry/WKB encoder/decoder

Code

function writePoint($point) {

  // Set the coords
  if (!$point
    ->isEmpty()) {
    $wkb = pack('dd', $point
      ->x(), $point
      ->y());
    return $wkb;
  }
  else {
    return '';
  }
}