Fix #14588 - export all geometry objects as hex
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
parent
b50a85bb04
commit
335ae4fe13
@ -240,6 +240,7 @@ class ExportJson extends ExportPlugin
|
||||
DatabaseInterface::QUERY_UNBUFFERED
|
||||
);
|
||||
$columns_cnt = $GLOBALS['dbi']->numFields($result);
|
||||
$fields_meta = $GLOBALS['dbi']->getFieldsMeta($result);
|
||||
|
||||
$columns = array();
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
@ -265,6 +266,10 @@ class ExportJson extends ExportPlugin
|
||||
$data = array();
|
||||
|
||||
for ($i = 0; $i < $columns_cnt; $i++) {
|
||||
if ($fields_meta[$i]->type === 'geometry') {
|
||||
// export GIS types as hex
|
||||
$record[$i] = '0x' . bin2hex($record[$i]);
|
||||
}
|
||||
$data[$columns[$i]] = $record[$i];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user