[MapServer-users] WFS output geojson - missing column with null values

PE Lord pe_lord at protonmail.com
Tue Dec 6 11:46:27 PST 2022


I runmapserver7.6.4 compiled with gdal 3.2.1.

When I output various formats (CSV/KML/GPKG) from my layer (gpkg based), the requested features are properly returned.

In the case of an ogroutput in geojson format, some of mycolumns are not returned.The missing column are those with null values.

Here myOUTPUTFORMAT definition

#==============================================
END
OUTPUTFORMAT
NAME "geojson"
DRIVER "OGR/GEOJSON"
FORMATOPTION "LCO:COORDINATE_PRECISION=15"
FORMATOPTION "LCO:WRITE_BBOX=YES"
FORMATOPTION "STORAGE=memory"
FORMATOPTION "FORM=simple"
FORMATOPTION "USE_FEATUREID=true"
FORMATOPTION "FILENAME=%outfile%.geojson"
MIMETYPE "application/geo+json"
#===============================================

I've tested with these 2 additionnal properties without any success....FORMATOPTION "LCO:WRITE_NON_FINITE_VALUES=YES"
FORMATOPTION "LCO:RFC7946=YES"

i've also tried with
gml_types auto
or
gml_val_cam_annee_1 Character (or Real) without success.

Here 2 links with the current issue.

- wfs output (geojson) with missing column --> https://ws.mapserver.transports.gouv.qc.ca/swtq?outfile=requestedColumnIsMissing&service=wfs&version=2.0.0&request=getfeature&typename=ms:circulation_routier&outputformat=geojson&srsname=EPSG:4326&count=1&propertyName=val_cam_annee_1

- wfs output (kml) with requested column --> https://ws.mapserver.transports.gouv.qc.ca/swtq?outfile=requestedcolumIsPresent&service=wfs&version=2.0.0&request=getfeature&typename=ms:circulation_routier&outputformat=kml&srsname=EPSG:4326&count=1&propertyName=val_cam_annee_1

I've found a workaround, I declare a sql syntax with a coalesce(field,'') ... but I look for a proper fix.
I will probably push this fix on december 7. Here the getfeature responses:

- <?xml version="1.0" encoding="utf-8" ?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document id="root_doc">
<Schema name="circulation_routier" id="circulation_routier">
<SimpleField name="val_cam_annee_1" type="float"></SimpleField>
</Schema>
<Folder><name>circulation_routier</name>
<Placemark>
<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>
<LineString><coordinates>.....</coordinates></LineString>
</Placemark>
</Folder>
</Document></kml>

- {
"type": "FeatureCollection",
"name": "circulation_routier",
"bbox": [ -72.5617697276407, 45.6593622104288, -72.4990762933546, 45.7595067353991 ],
"features": [
{ "type": "Feature", "id": 1, "properties": { }, "bbox": [ ... ], "geometry": { "type": "LineString", "coordinates": [ ... ] } }
]}

PE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20221206/4df8364d/attachment.htm>


More information about the MapServer-users mailing list