2

I currently have a geoserver instance with a working wms time dimension layer. I am able to ask for the raster geotiff for a specific day (2016-1-14) with the following request and geoserver responds correctly.

http://myserver/geoserver/workspace/wms?service=WMS&request=GetMap&layers=layername&time=2016-1-14&bbox=-125.020833333333,24.0625,-66.479166666662,49.937500000002&width=1600&height=800&srs=EPSG:4269&format=image/geotiff

Now I want to get the same functionality from wcs but geoserver always returns the raster geotiff for the last available date which is currently the 24th instead of the date that I pass in via the time param which is the 14th. My wcs request looks like this (again I want the 14th, but geoserver responds with the 24th):

http://myserver/geoserver/gdd/wcs?service=WCS&version=2.0.1&request=GetCoverage&CoverageId=mycoverage&time=2016-1-14&format=image/geotiff

If I have the coverage described via

http://myserver/geoserver/ows?service=WCS&version=2.0.1&request=DescribeCoverage&coverageId=mycoverage

I do see the different days listed:

<gmlcov:metadata>
<gmlcov:Extension>
<wcsgs:TimeDomain default="2016-01-24T00:00:00.000Z">
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_0">
<gml:timePosition>2015-01-01T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_1">
<gml:timePosition>2015-01-02T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_2">
<gml:timePosition>2015-01-03T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_3">
<gml:timePosition>2015-01-04T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_4">
<gml:timePosition>2015-01-05T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_5">
<gml:timePosition>2015-01-06T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant>
<gml:TimeInstant gml:id="gdd__agdd_anomaly_td_6">
<gml:timePosition>2015-01-07T00:00:00.000Z</gml:timePosition>
</gml:TimeInstant> ... up to 2016-01-24T00:00:00.000Z

I've also tried setting &TIME=2016-01-14T00:00:00.000Z but still no dice.

  • what does the log file say? – Ian Turton Jan 19 '16 at 11:41
  • Did you try this as a SUBSET request like: http://myserver/geoserver/gdd/wcs?service=WCS&version=2.0.1&request=GetCoverage&CoverageId=mycoverage&format=image/geotiff&SUBSET=time=("2016-01-14T00:00:00.000Z")& – nmtoken Jan 19 '16 at 11:59
  • @mmtoken I did in fact and it worked. Post it up as an answer and I'll accept. Do you know if you can have subset for params other than time, elevation, lat and long? Those are the one's I've gotten to work so far, but it'd be nice to be able to specify like SUBSET=dayofyear=(235) or something similar. – apricity Jan 19 '16 at 16:56
3

The correct date format (in this instance) is I think as advertised in your DescribeCoverage response like 2016-01-14T00:00:00.000‌​Z.

To get at a date in your coverage you need to apply a 'Slice' along the Time Dimension. In WCS 2.0 this slicing is carried out by means of a domain subsetting operation.

With GET/KVP requests the parameter name is SUBSET so your request would be in the format:

http://myserver/geoserver/gdd/wcs?
 service=WCS&
 version=2.0.1&
 request=GetCoverage‌​&
 CoverageId=mycoverage&
 format=image/geotiff&
 SUBSET=time("2016-01-14T00:00:00.000‌​Z")&

For a POST/XML request it would be something like:

<?xml version="1.0" encoding="UTF-8"?>
<wcs:GetCoverage xmlns:wcs="http://www.opengis.net/wcs/2.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.opengis.net/wcs/2.0 
        http://schemas.opengis.net/wcs/2.0/wcsAll.xsd"
    service="WCS" version="2.0.1">
    <wcs:CoverageId>mycoverage</wcs:CoverageId>
    <wcs:DimensionSlice>
        <wcs:Dimension>time</wcs:Dimension>
        <wcs:SlicePoint>2016-01-14T00:00:00.000‌​Z</wcs:SlicePoint>
    </wcs:DimensionSlice>
    <wcs:format>image/geotiff</wcs:format>
</wcs:GetCoverage>

You can apply domain subsetting on any of the axes defined in DescribeCoverage response for your coverage, in any combination. A subset parameter may only act on one dimension (so if you want to subset on two dimensions you need to supply two subset=value& parameters) and there can only be one subset parameter per axis (so if you want to get values between two dates you need to specify this in a single parameter for the time dimension ~ a trimming operation).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.