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

Disable GPX export for polygons #4

Open igeofr opened 5 years ago

igeofr commented 5 years ago

Hello, It would be interesting to add the gpx format to the list in order to easily load the data into a GPS.

'gpx':{
        'contentType': 'application/gpx+xml',
        'filenameExt': 'gpx',
        'forceCRS': 'EPSG:4326',
        'ogrProvider': 'GPX',
        'ogrDatasourceOptions':None,
        'zip': False,
        'extToZip': []
    },

Thanks

Gustry commented 4 years ago

@igeofr Did you try to add this code in the python file? Did it work?

igeofr commented 4 years ago

No, I didn't try because I rent a Lizmap server from you and I don't have the possibility to do the test.

Gustry commented 4 years ago

Ah yes, it makes sense, sorry. I will try ;-)

Gustry commented 4 years ago

Done : https://github.com/3liz/qgis-wfsOutputExtension/commit/55912fdb040b278ca6fe6d30c4038a1c4c19eb28

The GPX has some restrictions on field names.

igeofr commented 4 years ago

That's great. Thanks

Gustry commented 3 years ago

According to a unittest added, GPX is failing : https://travis-ci.org/github/3liz/qgis-wfsOutputExtension/jobs/734199354#L246

Gustry commented 3 years ago

@igeofr Is the GPX working well for you ?

I have just renabled GPX tests in 51c9f1c72a401388578ef99d29346db915ad943c

igeofr commented 3 years ago

Yes, it works perfectly for points and lines. For polygons an empty file is generated. Is it possible to deactivate this format for polygonal layers?

Gustry commented 3 years ago

Indeed, it's correct. I will have some work on WfsOutputExtension in the coming week, I will do that.

Gustry commented 3 years ago

@rldhont, @igeofr I tried to deactivate this export for polygons.

For now the, the list of format generated by this QGIS Server plugin is inserted at the root WFS service (global for all layers provided by the WFS Server) and is not configured per layer. It seems possible according to the specs

  <FeatureTypeList>
    <FeatureType>
      <Name xmlns:gn="urn:x-inspire:specification:gmlas:GeographicalNames:3.0">gn:NamedPlace</Name>
      <Title>gn:NamedPlace</Title>
      <DefaultCRS>urn:ogc:def:crs:EPSG::4326</DefaultCRS>
      <OutputFormats>
        <Format>application/xml; subtype="gml/3.2.1"</Format>
      </OutputFormats>

http://opengeospatial.github.io/e-learning/wfs/text/operations.html#response

But then I'm not sure this will be used by LWC. So I will let this feature request open and I have renamed it.