Esempio n. 1
0
 /**
  * @dataProvider providerTextBinary
  *
  * @param string $text               The WKT of the geometry under test.
  * @param string $bigEndianBinary    The big endian WKB of the geometry under test.
  * @param string $littleEndianBinary The little endian WKB of the geometry under test.
  */
 public function testAsBinary($text, $bigEndianBinary, $littleEndianBinary)
 {
     $machineByteOrder = WKBTools::getMachineByteOrder();
     if ($machineByteOrder === WKBTools::BIG_ENDIAN) {
         $binary = $bigEndianBinary;
     } else {
         $binary = $littleEndianBinary;
     }
     $this->assertSame($binary, bin2hex(Geometry::fromText($text)->asBinary()));
 }
Esempio n. 2
0
 /**
  * Class constructor.
  *
  * @param string $wkb
  */
 public function __construct($wkb)
 {
     $this->wkb = $wkb;
     $this->length = strlen($wkb);
     $this->machineByteOrder = WKBTools::getMachineByteOrder();
 }
Esempio n. 3
0
 /**
  * @throws GeometryIOException
  */
 public function __construct()
 {
     $this->byteOrder = $this->machineByteOrder = WKBTools::getMachineByteOrder();
 }