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

Dxf format #27

Open aeduard opened 3 years ago

aeduard commented 3 years ago

Extend export format types with dxf.

gioman commented 1 year ago

I guess that would need to be added as special case because in QGIS Server this format is part of the WMS getmap request and not of the WFS GetFeature one(?).

aeduard commented 1 year ago

I don't understand the differences and details, but it would be a nice feature even today :). We could sponsor the development for this update.

Gustry commented 1 year ago

I see "DXF" when right clicking on a layer → "Save features as", so maybe not ? Have you tried to add it ? https://github.com/3liz/qgis-wfsOutputExtension/blob/master/wfsOutputExtension/definitions.py

gioman commented 1 year ago

Have you tried to add it ? https://github.com/3liz/qgis-wfsOutputExtension/blob/master/wfsOutputExtension/definitions.py

@Gustry I added

    Dxf = Format(
        content_type='application/dxf',
        filename_ext='dxf',
        force_crs=None,
        ogr_provider='AutoCAD DXF',
        ogr_datasource_options=(),
        zip=False,
        ext_to_zip=(),
    )

but resulting file is 0 bytes.

pathmapper commented 1 year ago

Looks like the driver short name is used for ogr_provider, you could try:

ogr_provider='DXF'

https://gdal.org/drivers/vector/dxf.html

gioman commented 1 year ago

Looks like the driver short name is used for ogr_provider, you could try:

nope, still 0 bytes.

gioman commented 1 year ago

@Gustry On the other had this works

https://YOURLIZMAPDEMOSERVER/lizmap/www/index.php/lizmap/service?repository=qgisserverdemos&project=montpellier&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&LAYERS=Quartiers&STYLES=&CRS=EPSG%3A2154&BBOX=765124,6274515,776072,6284267&WIDTH=1042&HEIGHT=811&FORMAT_OPTIONS=MODE:SYMBOLLAYERSYMBOLOGY;SCALE:500;NO_MTEXT:TEXT&FILE_NAME=quartiers.dxf&FORMAT=application/dxf

Gustry commented 1 year ago

Thanks for checking, indeed, it's in the documentation :

https://docs.qgis.org/3.28/en/docs/server_manual/services/wms.html#wms-getmap-format

So WMS GetCapabilities in WMS is missing the DXF format if the layer is also in WFS ?

gioman commented 1 year ago

So WMS GetCapabilities in WMS is missing the DXF format if the layer is also in WFS ?

DXF is part of the WMS capabilities regardless if a layer is published as WFS (as far as I understand)

image

gioman commented 1 year ago

DXF is part of the WMS capabilities regardless if a layer is published as WFS (as far as I understand)

no you are right, only when the layer is published as WFS.

huggla commented 11 months ago

The dxf-export in Qgis (in server through wms-request) does not save feature attributes.

gioman commented 11 months ago

The dxf-export in Qgis (in server through wms-request) does not save feature attributes.

@huggla sure you did the request correctly? This with the demo project (Montpellier) worked for me

https://github.com/3liz/qgis-wfsOutputExtension/issues/27#issuecomment-1784803518

huggla commented 11 months ago

The dxf-export in Qgis (in server through wms-request) does not save feature attributes.

@huggla sure you did the request correctly? This with the demo project (Montpellier) worked for me

#27 (comment)

Normal WMS request: https://kartor.kristianstad.se/qgisserver-shared/ows/planer?with_geometry=true&fi_point_tolerance=20&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&FORMAT=image/png&LAYERS=v_planer_lk&WIDTH=512&HEIGHT=512&SRS=EPSG:3008&BBOX=191093.75999999995%2C6211571.84%2C191237.11999999994%2C6211715.2 Feature attributes: https://kartor.kristianstad.se/qgisserver-shared/ows/planer?REQUEST=GetFeatureInfo&QUERY_LAYERS=v_planer_lk&SERVICE=WMS&VERSION=1.1.1&INFO_FORMAT=application/json&X=266&Y=229&WIDTH=512&HEIGHT=512&SRS=EPSG:3008&BBOX=191093.75999999995%2C6211571.84%2C191237.11999999994%2C6211715.2 DXF export (feature attributes missing): https://kartor.kristianstad.se/qgisserver-shared/ows/planer?REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=v_planer_lk&WIDTH=512&HEIGHT=512&SRS=EPSG:3008&BBOX=191093.75999999995%2C6211571.84%2C191237.11999999994%2C6211715.2&FORMAT_OPTIONS=MODE:SYMBOLLAYERSYMBOLOGY;SCALE:500;NO_MTEXT:TEXT&FILE_NAME=planer.dxf&FORMAT=application/dxf Geojson export (with feature attributes): https://kartor.kristianstad.se/qgisserver-shared/ows/planer?REQUEST=GetFeature&TYPENAME=v_planer_lk&SERVICE=WFS&VERSION=1.0.0&OUTPUTFORMAT=geojson&WIDTH=512&HEIGHT=512&SRSNAME=EPSG:3008&BBOX=191093.75999999995%2C6211571.84%2C191237.11999999994%2C6211715.2

aeduard commented 4 months ago

I've tried the setup in definitions.py (version 1.8.0), also layer is published in QGIS Server WFS capabilities. The resulting dxf has 0 bytes. Any hints?

gioman commented 4 months ago

Any hints?

@aeduard it won't work, as far as I understand, because the DXF is part of QGIS WMS capabilities, not WFS.