Hi Seth: It’s an interesting idea. In theory one could do the same thing with PostGIS since if can natively export some formats. I suppose we should sketch out the existing processing chain to see if there’s a logical place to change behavior. Acting directly on a result set (which is just a collection of feature ids) would be one way I suppose. —Steve<br><br>On Saturday, July 4, 2020, Seth G <<a href="mailto:sethg@geographika.co.uk">sethg@geographika.co.uk</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi devs,<br>
<br>
I've been using MapServer more and more as an export service, providing links to dump out data to a Shapefile (or TAB, Spatialite, etc.) using the WFS protocol with a OUTPUTFORMAT. Creating a MapServer LAYER for this purpose, and configuring an OUTPUTFORMAT provides the functionality of ogr2ogr but via a web-enabled interface directly with MapServer. <br>
<br>
However MapServer loads the data into shapeObjs via the WFS interface and then exports it back out, which seems to cause a big performance hit. The equivalent ogr2ogr export operations can be up to 5-6x faster. <br>
<br>
Are there any insurmountable technical reasons why a layer could not be outputted directly using OGR?<br>
<br>
A MapServer LAYER can have lots of additional configuration - FILTERs, native filters, fields limited via METADATA etc. which would likely have to be ignored, or translated into OGR parameters. The following criteria would probably have to apply as a a minimum:<br>
<br>
1. Only applicable to layers with CONNECTIONTYPE OGR [1]<br>
2. Only valid for OGR OUTPUTFORMATs [2]<br>
<br>
If these are met, perhaps a PROCESSING directive could be added to a layer to enable direct OGR output, something like: "PROCESSING" "OGR_BYPASS=ON" or "OGR_DIRECT_EXPORT=ON". <br>
<br>
At the moment this is just an idea, but I may try and prototype something in Python and get some performance benchmarks. <br>
<br>
Seth<br>
<br>
[1] <a href="https://mapserver.org/input/vector/ogr.html" target="_blank">https://mapserver.org/input/<wbr>vector/ogr.html</a><br>
[2] <a href="https://mapserver.org/output/ogr_output.html#outputformat-declarations" target="_blank">https://mapserver.org/output/<wbr>ogr_output.html#outputformat-<wbr>declarations</a><br>
<br>
--<br>
web:<a href="http://geographika.co.uk" target="_blank">http://geographika.co.uk</a><br>
twitter: @geographika<br>
______________________________<wbr>_________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org">mapserver-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/mapserver-dev</a></blockquote>