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

Steve Lime Steve.Lime at dnr.state.mn.us
Thu Mar 19 19:13:41 PDT 2009


Sorry for the hassles. Changing the pixel model between versions is a
pain. Now MapServer matches WCS 1.0 and GDAL matches WCS 1.1 I believe.

Steve

>>> Roger André <randre at gmail.com> 03/19/09 6:55 PM >>>
Hi Steve,

You're right.  Version 1.0.0 requests don't show a 1/2 pixel offset
when overlaid on a static data image, version 1.1.0 does.  However,
once they're overlaid, I do see a difference in data values.  I'm
going to have to figure that one out next.

Roger
--

On Thu, Mar 19, 2009 at 3:04 PM, Steve Lime <Steve.Lime at dnr.state.mn.us>
wrote:
> Are you seeing the issue with both WCS 1.0 and WCS 1.1? I could have
> sworn I fixed WCS 1.0 back at the 5.0 but
> perhaps the merge of the WCS 1.1 support broke that. There is code in
> mapwcs.c to account for the differences in
> various pixel models (MapServer, WCS 1.0 and WCS 1.1).
>
> Steve
>
>>>> On 3/19/2009 at 3:59 PM, in message
> <9c2015090903191359y4c54cb4dne65f87645d79617 at mail.gmail.com>, Roger
> André
> <randre at gmail.com> wrote:
>> You're right, 1/2 pixel offset is definitely present. What a pain.
>> Any idea when the 5.4 stable release is expected?  I see that a beta
>> release is available currently.
>> --
>>
>> On Thu, Mar 19, 2009 at 1:55 PM, Roger André <randre at gmail.com>
> wrote:
>>> 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:o>>>> 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
>>>>
>>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>




More information about the MapServer-users mailing list