3liz / qgis-wfsOutputExtension

QGIS Server plugin to add Output Formats to WFS GetFeature request.
GNU General Public License v2.0
10 stars 6 forks source link

Field format altered text to numeric when exporting in csv/xlsx #31

Closed Doctor-Who closed 2 years ago

Doctor-Who commented 2 years ago

Description

When downloading a layer in csv or xlsx, type of field is changed. From text to numeric. Very annoying on insee code cause dep Aisne : initially 02 became 2

Please, look at this example : https://geocatalogue.hautsdefrance.fr/geonetwork/srv/fre/catalog.search;jsessionid=54BF46D02CD9744DD1523E68AB154BD1?node=srv#/metadata/4b5f8e1b-de37-47cd-9203-37a59f318b09

Context

Doctor-Who commented 2 years ago

Up ?

u-cav commented 2 years ago

We are also seeing this issue with Lizmap 3.5.0. The same layer is exported correctly from QGIS Desktop (with leading zeroes, if the field type is text).

pcav commented 2 years ago

@rldhont @Gustry this seems a rather serious issue. Does it belong to the plugin or the server?

rldhont commented 2 years ago

@pcav it is an issue due to the way GDAL is sniffing field type.

Doctor-Who commented 2 years ago

@rldhont Could it be fix ? Which side ? Do we suppose to open a issue on GDAL project ?

rldhont commented 2 years ago

@Doctor-Who it is not a GDAL issue. We have deactivated Schema request to avoid GDAL from wfsOutputExtension in QGIS Server requesting QGIS Server (something like QGIS Server requesting QGIS server). I don't know if .gfs file can help here. https://gdal.org/drivers/vector/gml.html

rldhont commented 2 years ago

A way to fix it :

  1. Get the XSD file with a DescribeFeatureType request
  2. Open the GML file with the XSD file
u-cav commented 2 years ago

@Gustry @rldhont Thank you very much for the fix, it works perfectly.

Doctor-Who commented 2 years ago

@u-cav Fix funded by region of Hauts-de-France // https://www.hautsdefrance.fr/ poke @Gustry @rldhont ;)

u-cav commented 2 years ago

@Doctor-Who Great to know, thank you and thanks to la Région Hauts-de-France!

Gustry commented 2 years ago

Thanks for the reminder @Doctor-Who ! Thanks !

https://twitter.com/etrimaille/status/1507270134997598213