I have an image mosaic in GeoServer with some .tif which its name are the date of that raster:
20190929.tif
20191004.tif
...
So I can load every raster by passing the date in OpenLayers:
date="2019-09-29";
var myTileLayer = new TileLayer({
source: new TileWMS({
url: 'http://localhost:8080/geoserver/myworkspace/wms',
params: {'LAYERS': 'myworkspace:mylayer','TIME':date,'TILED': true},
serverType: 'geoserver',
}),
extent: extent,
});
The problem is that I want that the user could choose the date for example in a calendar (in the example I put the date manually) but for that I need to know which dates are avalaible in the image mosaic so I was trying to search if there was avalaible any get request in GeoServer to retrieve this information like:
curl -u admin:geoserver -XGET localhost:8080/geoserver/rest/layers/myworkspace:mylayer/time.json
//Of course this doesn't work
Expected return:
{
"time":[20190929,20191004]
}
The other approach I think it would be to save this information in a database but that would more complicated.