You are here

function WKB::writeMulti in geoPHP 8

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

Class

WKB
PHP Geometry/WKB encoder/decoder

Code

function writeMulti($geometry) {

  // Set the number of components
  $wkb = pack('L', $geometry
    ->numGeometries());

  // Write the components
  foreach ($geometry
    ->getComponents() as $component) {
    $wkb .= $this
      ->write($component);
  }
  return $wkb;
}