Skip to content

Commit

Permalink
Merge pull request #75 from vmora/fix_array_type
Browse files Browse the repository at this point in the history
fixed bad conversion of custom types
  • Loading branch information
jmckenna authored Jun 11, 2021
2 parents 19b4a0b + b95d317 commit 2d33916
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/struct/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,6 @@ buffer *buffer_encode_json_str(const char * str)
buffer_add(buf, *str);
}
}

return buf;
}

Expand Down
7 changes: 5 additions & 2 deletions src/wfs/wfs_get_feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,13 @@ 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 @@ -853,11 +857,10 @@ 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 2d33916

Please sign in to comment.