Skip to content

Commit 2d33916

Browse files
authored
Merge pull request #75 from vmora/fix_array_type
fixed bad conversion of custom types
2 parents 19b4a0b + b95d317 commit 2d33916

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/struct/buffer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ buffer *buffer_encode_json_str(const char * str)
574574
buffer_add(buf, *str);
575575
}
576576
}
577-
578577
return buf;
579578
}
580579

src/wfs/wfs_get_feature.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,9 +545,13 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer
545545
}
546546
/* Columns are written in quotation marks */
547547
else {
548+
if (wr->format == WFS_GEOJSON)
549+
buffer_add_str(select, "to_json(");
548550
buffer_add_str(select, "\"");
549551
buffer_copy(select, an->key);
550552
buffer_add_str(select, "\"");
553+
if (wr->format == WFS_GEOJSON)
554+
buffer_add_str(select, ")");
551555
}
552556

553557
if (an->next) buffer_add_str(select, ",");
@@ -853,11 +857,10 @@ static void wfs_geojson_display_results(ows * o, wfs_request * wr, mlist * reque
853857
else buffer_add_str(prop, ", \"");
854858

855859
buffer_copy(prop, an->key);
856-
buffer_add_str(prop, "\": \"");
860+
buffer_add_str(prop, "\": ");
857861
value_enc = buffer_encode_json_str(PQgetvalue(res, i, j));
858862
buffer_copy(prop, value_enc);
859863
buffer_free(value_enc);
860-
buffer_add(prop, '"');
861864
}
862865
}
863866

0 commit comments

Comments
 (0)