geosolutions-it / evo-odas

Code Repository for the EVO-ODAS
https://waffle.io/geosolutions-it/evo-odas
MIT License
31 stars 15 forks source link

DHUS Plugin broken after update to sentinelsat 0.12 #180

Closed torse closed 7 years ago

torse commented 7 years ago

Due to a change in the sentinelsat api, search and download requests are broken:

sentinelsat.sentinel.SentinelAPIError: HTTP status 500 Internal Server Error: IOException : Server returned HTTP response code: 400 for URL: http://localhost:30333//solr/dhus/select?q=end_date:2017-08-01T09:00:00Z%20filename:S2A_MSIL1C*%20initial_date:2017-08-01T08:00:00Z%20platformname:Sentinel-2%20footprint:"Intersects(POLYGON((6.2622%2052.0660,5.9326%2051.8222,5.7349%2050.9723,6.3721%2049.2535,7.8223%2048.8213,7.2729%2047.4875,10.3711%2047.2494,13.4473%2047.5024,13.7769%2048.7345,12.4805%2050.1347,15.0073%2050.9307,14.1943%2053.9561,13.5132%2054.7246,11.6016%2054.5338,9.5581%2054.9398,8.1079%2054.9650,6.2622%2053.6316,7.0093%2053.1072,6.2622%2052.0660)))"&wt=xslt&tr=opensearch_atom.xsl&dhusLongName=Sentinels+Scientific+Data+Hub&dhusServer=https%3A%2F%2Fscihub.copernicus.eu%2Fdhus%2F&originalQuery=end_date%3A2017-08-01T09%3A00%3A00Z+filename%3AS2A_MSIL1C*+initial_date%3A2017-08-01T08%3A00%3A00Z+platformname%3ASentinel-2+footprint%3A%22Intersects%28POLYGON%28%286.2622+52.0660%2C5.9326+51.8222%2C5.7349+50.9723%2C6.3721+49.2535%2C7.8223+48.8213%2C7.2729+47.4875%2C10.3711+47.2494%2C13.4473+47.5024%2C13.7769+48.7345%2C12.4805+50.1347%2C15.0073+50.9307%2C14.1943+53.9561%2C13.5132+54.7246%2C11.6016+54.5338%2C9.5581+54.9398%2C8.1079+54.9650%2C6.2622+53.6316%2C7.0093+53.1072%2C6.2622+52.0660%29%29%29%22&rows=100&start=0&sort=ingestiondate+desc

The reason for this is, that the before 0.12 the api call looks like this:

        products = api.query(
            footprint,
            initial_date=self.startdate,
            end_date=self.enddate,
            platformname=self.platformname,
            filename=self.filename
        )

However the initial_date and end_date should now be replaced with date=(self.startdate, self.enddate). The initial_date and end_date are in 0.12 treated as "search_keyword" be the server but they are not valid (hence the error above).

While fixing this consider supporting arbritary search keywords as defined in Copernicus Open Access Hub Documentation.

PR is incoming.

torse commented 7 years ago

PR ready https://github.com/geosolutions-it/evo-odas/pull/181, please review.