Skip to content

Commit

Permalink
Merge pull request #100 from SDIS62/main
Browse files Browse the repository at this point in the history
Fix JSON encoding
  • Loading branch information
jmckenna authored Dec 1, 2022
2 parents c300090 + 71305ef commit 1e61f2b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/wfs/wfs_get_feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,13 +545,9 @@ static buffer *wfs_retrieve_sql_request_select(ows * o, wfs_request * wr, buffer
}
/* Columns are written in quotation marks */
else {
if (wr->format == WFS_GEOJSON)
buffer_add_str(select, "to_json(");
buffer_add_str(select, "\"");
buffer_copy(select, an->key);
buffer_add_str(select, "\"");
if (wr->format == WFS_GEOJSON)
buffer_add_str(select, ")");
}

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

buffer_copy(prop, an->key);
buffer_add_str(prop, "\": ");
buffer_add_str(prop, "\": \"");
value_enc = buffer_encode_json_str(PQgetvalue(res, i, j));
buffer_copy(prop, value_enc);
buffer_free(value_enc);
buffer_add(prop, '"');
}
}

Expand Down

0 comments on commit 1e61f2b

Please sign in to comment.