Binary to double without loosing precision?
| From: | Nathan Rixham | Date: | Sat, 26 Jan 2008 03:59:31 +0000 |
| Subject: | Binary to double without loosing precision? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-268145@lists.php.net to get a copy of this message | ||
Spatial Joys!
Quite simply I need to unpack wkb binary from mysql back to it's double-precision...
problem is this:
Array
(
[order] => 0
[type] => 16777216
[latitude] => -7.1466311596962E-292
[longitude] => 1.7568969921627E-47
)
should be:
Array
(
[order] => 0
[type] => 16777216
[latitude] => 3144.1639291789037156
[longitude] => 4044.3600286609968055
)
when using:
unpack("corder/Ltype/dlatitude/dlongitude", $mysqlwkb);
any idea's just how to get the wkb back to something usable with php?
Nathan