pg_featureserv
pg_featureserv copied to clipboard
Support unnesting of JSONB fields
Minor fix to unnest values from JSONB fields in GeoJSON output.
Output before:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
8.9000685,
53.1099145
],
[
8.9001737,
53.109878
],
[
8.9002618,
53.1099697
],
[
8.9001565,
53.1100061
],
[
8.9000685,
53.1099145
]
]
]
},
"properties": {
"osm_id": 249727578,
"osm_type": "W",
"tags": "{\"club\": \"sport\", \"name\": \"BTC - Borgfelder Tennisclub\", \"building\": \"yes\"}" <-- HERE
}
}
],
"numberReturned": 1,
"timeStamp": "2024-03-31T19:25:21+02:00",
"links": [
{
"href": "http://localhost:9000/collections/postgisftw.osm_feature_info/items",
"rel": "self",
"type": "application/json",
"title": "This document as JSON"
},
{
"href": "http://localhost:9000/collections/postgisftw.osm_feature_info/items.html",
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML"
}
]
}
Output after:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
8.9000685,
53.1099145
],
[
8.9001737,
53.109878
],
[
8.9002618,
53.1099697
],
[
8.9001565,
53.1100061
],
[
8.9000685,
53.1099145
]
]
]
},
"properties": {
"osm_id": 249727578,
"osm_type": "W",
"tags": { <-- HERE
"building": "yes",
"club": "sport",
"name": "BTC - Borgfelder Tennisclub"
}
}
}
],
"numberReturned": 1,
"timeStamp": "2024-03-31T19:22:09+02:00",
"links": [
{
"href": "http://localhost:9000/collections/postgisftw.osm_feature_info/items",
"rel": "self",
"type": "application/json",
"title": "This document as JSON"
},
{
"href": "http://localhost:9000/collections/postgisftw.osm_feature_info/items.html",
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML"
}
]
}
@JakobMiksch Kudos on the PR! I think I'll need this before I can move forward evaluating pg_featureserv any chance we can get this merged?
I would be happy to merge it as well. We should ask @dr-jts for his opinion