[mapserver-users] Mapserver WCS - how to return native pixel resolution data?

Roger André randre at gmail.com
Thu Mar 19 16:55:12 EDT 2009


Sure thing.  Here are the OUTPUTFORMAT declarations I have:

OUTPUTFORMAT
  NAME "GEOTIFF_FLOAT"
  DRIVER 'GDAL/GTiff'
  MIMETYPE 'image/tiff'
  IMAGEMODE FLOAT32
  EXTENSION 'tif'
END

OUTPUTFORMAT
  NAME "ASCII_GRID"
  DRIVER 'GDAL/AAIGrid'
  MIMETYPE 'image/grid'
  IMAGEMODE FLOAT32
  EXTENSION 'asc'
END

I'll have to check my output data more closely to see if the 1/2 pixel
offset exists.  I've only looked at it in a cursory way so far.  The
version of MapServer I'm using is 5.2.0
--

On Thu, Mar 19, 2009 at 12:14 PM, Alexander Petkov <greenkov at gmail.com> wrote:
> On Thu, Mar 19, 2009 at 12:48 PM, Roger André <randre at gmail.com> wrote:
>> Sorry for the spam, I think I found the answer.  Both RESX and RESY
>> need to be positive values.  Using that, I am able to get back data
>> that matches the original data.
>>
>> Thanks,
>>
>> Roger
>> --
>>
>> On Thu, Mar 19, 2009 at 11:36 AM, Roger André <randre at gmail.com> wrote:
>>> Hi Alexander,
>>>
>>> Thanks for the response.  Yes, I am using a GetCoverage request that
>>> looks like this:
>>>
>>> http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/netCDF/netcdf.map
>>> &SERVICE=wcs
>>> &VERSION=1.0.0
>>> &REQUEST=GetCoverage
>>> &COVERAGE=elev
>>> &CRS=EPSG:4326
>>> &BBOX=125,50,130,55
>>> &WIDTH=600
>>> &HEIGHT=600
>>> &FORMAT=image/grid
>>>
>>> The source is a single-band image, and the data is correctly returned
>>> as either a single-band GeoTIFF, or an ASCII Grid, depending on which
>>> FORMAT I specify in the WCS string.
>>>
>>> What I would like to do is eliminate the WIDTH and HEIGHT parameters
>>> from the request, and just return whatever is available in the BBOX
>>> area.  When I remove them from the request, I get an error that says I
>>> either need HEIGHT and WIDTH, or RESX and RESY.  When I restructure
>>> the command to include RESX and RESY (see below), I get an "Out of
>>> memory" error.
>>>
>>> http://localhost/cgi-bin/mapserv?map=/var/www/mapfiles/netCDF/netcdf.map
>>> &SERVICE=wcs
>>> &VERSION=1.0.0
>>> &REQUEST=GetCoverage
>>> &COVERAGE=elev
>>> &CRS=EPSG:4326
>>> &BBOX=125,50,130,55
>>> &FORMAT=image/grid
>>> &RESX=.033&RESY=-.033
>>>
>>> I believe I should be able to use the pixel dimensions that are
>>> reported back to me in a DescribeCoverage request, which show them to
>>> be:
>>>
>>> <gml:offsetVector>0.033333333333333 0</gml:offsetVector>
>>> <gml:offsetVector>0 -0.033333333333333</gml:offsetVector>
>>>
>>> Thanks for the help,
>>>
>>> Roger
>
> Hi Roger:
>
> Glad to know that you got the problem solved. Do you mind sharing your
> OUTPUTFORMAT configurations in your mapfile if you have them
> configured, particularly for the ASCII grid format.
>
> Also, are you using a mapserver release older than any of the 5.4
> betas? I am using 5.2.1 and I see the result of the GetCoverage
> request being offset by a half pixel (the pixel size of my data). Bug
> reports indicate that this offset will be fixed for the 5.4 release.
>
>
> Thanks in advance,
> Alex
>


More information about the mapserver-users mailing list