aodn / aodn-portal

AODN Open Geospatial Portal
https://portal.aodn.org.au/
GNU General Public License v3.0
21 stars 13 forks source link

Shape file download fails when filtering applied #2455

Closed bhasin85 closed 7 years ago

bhasin85 commented 7 years ago

It works fine when we add maxFeatures parameter to the request from the portal.

Valid Request

http://geoserver-123.aodn.org.au/geoserver/imos/ows?
service=WFS&
version=1.0.0&
request=GetFeature&
typeName=imos:soop_auscpr_zoop_trajectory_map&
maxFeatures=50&
outputFormat=SHAPE-ZIP
jonescc commented 7 years ago

One of the reasons we are using metadata to control whether we display the shape file option in the portal rather than making the shapefile option available generally for any wfs download is because the shape file option will not work properly for many of our layers.

The soop_auscpr_zoop_trajectory_map layer above for example has 54225 records in the database. When you request a shapefile containing only the first 50 records, then geoserver is quite capable of creating the shapefile quickly and then streaming it back to the user. If you ask for a shapefile containing the full 54225 records, then I imagine geoserver takes too long too create the shape file before trying to stream it back to the user and a timeout is occurring.

We shouldn't just give the user the first 50 records - we should only display the option if its actually possible to provide a shapefile download option that works as expected for that layer. I think the layer above is not suitable for your testing.

jonescc commented 7 years ago

Actually, tried this again (carefully increasing number of records included) and it works fine with current limit set in geoserver - although it takes around 25 seconds to start streaming the file. I could include all records in the shapefile. So not sure what the problem was you were having.

Perhaps clarify exactly what wasn't working for you.

jonescc commented 7 years ago

Perhaps related to https://github.com/aodn/issues/issues/29

bhasin85 commented 7 years ago

@jonescc The WFS request to download without maxFeatures parameter is absolutely fine.

If you ask for a shapefile containing the full 54225 records, then I imagine geoserver takes too long too create the shape file before trying to stream it back to the user and a timeout is occurring.

This is what I believe is happening and I think you are right that maybe the layer above is not suitable for testing. I think we will need to decide if we want to handle the case like soop_auscpr_zoop_trajectory_map layer because the online resource can be added to any record which may result in error.

julian1 commented 7 years ago

Maybe a separate issue - but I think it should be soop_auscpr_zoop_trajectory_data not soop_auscpr_zoop_trajectory_map for anything WFS related.

smancini commented 7 years ago

For the AusCPR collection, the "_map" layer is used for both WMS and WFS purposes because the data would be the same in both layers.

bhasin85 commented 7 years ago

Look like the issue was related to https://github.com/aodn/issues/issues/29 as @jonescc suggested. Unable to reproduce.