Skip to content

Commit 8dc6bce

Browse files
committed
Fix empty point binary output representation
1 parent 3806038 commit 8dc6bce

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/adapters/WKB.class.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,11 @@ public function write(Geometry $geometry, $write_as_hex = FALSE) {
202202
}
203203

204204
function writePoint($point) {
205-
// Set the coords
206-
if (!$point->isEmpty()) {
207-
$wkb = pack('dd',$point->x(), $point->y());
208-
return $wkb;
209-
} else {
210-
return '';
205+
if ($point->isEmpty()) {
206+
return pack('dd', NAN, NAN);
211207
}
208+
209+
return pack('dd', $point->x(), $point->y());
212210
}
213211

214212
function writeLineString($line) {

0 commit comments

Comments
 (0)