You are here

function WKB::writeLineString in geoPHP 7

Same name and namespace in other branches
  1. 8 geoPHP/lib/adapters/WKB.class.php \WKB::writeLineString()
3 calls to WKB::writeLineString()
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.
WKB::writePolygon in geoPHP/lib/adapters/WKB.class.php

File

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

Class

WKB
PHP Geometry/WKB encoder/decoder

Code

function writeLineString($line) {

  // Set the number of points in this line
  $wkb = pack('L', $line
    ->numPoints());

  // Set the coords
  foreach ($line
    ->getComponents() as $point) {
    $wkb .= pack('dd', $point
      ->x(), $point
      ->y());
  }
  return $wkb;
}