WCS from multiple netCDF returning only background image

Jérôme Martin gooogle at FREE.FR
Thu Mar 29 19:37:12 EDT 2007


Hello Edfialk,

When i begin to use mapserv for WCS requests, I had the same probleme as 
you on my DTED tileindex : all my requests were blank. In fact, they 
were with the height 0. But when i tried with my rasters to have png or 
gif, the results were only blank, so exactly like you.

I don't know if what  will explain to you will resolve your problem, but 
i can give my my solution to resolve mine.

When I request tile images on my server WMS, this works perfectly. but 
when I sent the same boundingbox for the DTED on WCS server, I had blank 
files. The error was the ratio X and Y was different so mapserv sent me 
blank file.

In fact the resolution pixel X must be the same as the resolution pixel 
Y, to do not strech on one axe the data.

In WMS Server, this is not a problem :
 - a normal ratio resX/resY on WMS :
http://iceds.ge.ucl.ac.uk/cgi-bin/icedswms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&layers=landsat&width=512&height=512&srs=epsg:4326&bbox=-5,43,2,50&format=image/png
 - a streched ratio X on WMS :
http://iceds.ge.ucl.ac.uk/cgi-bin/icedswms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&layers=landsat&width=512&height=512&srs=epsg:4326&bbox=-5,43,20,50&format=image/png

You can see the results are good without any problem.

In WCS server, you cannot do this, because mapserv refuse to compress 
data on one axe. So if you have blank results, this is maybe because 
your request is not with good ratios.
Personnaly, when i ask a bbox (minx,miny,maxx,maxy) for a size (width x 
height) for example, i have to check the resolution of X and Y (i have 
only 2D data)
resolution_asked_x_pixel = (maxx-minx)/width
resolution_asked_y_pixel = (maxy-miny)/height
if resolution_asked_(x or y) are not equal, then i take one of them (x 
or y, depends what you want) to re-computing width or height value.

An example in WCS request :
a request 512x512 for bbox=-5,43,2,50, normal ratio X/Y for square size :
http://iceds.ge.ucl.ac.uk/cgi-bin/icedswcs?VERSION=1.0.0&SERVICE=WCS&REQUEST=GetCoverage&coverage=srtm&width=512&height=512&bbox=-5,43,2,50&crs=epsg:4326&FORMAT=image/png

The result is good, because the resolution_pixel x and y are the same 
(this layer has native_resolution x and y at (+/-) 0.00083333, has you 
can see with this request :
http://iceds.ge.ucl.ac.uk/cgi-bin/icedswcs?SERVICE=WCS&REQUEST=describecoverage&coverage=srtm 
).

Now if your strech the axe x :
http://iceds.ge.ucl.ac.uk/cgi-bin/icedswcs?VERSION=1.0.0&SERVICE=WCS&REQUEST=GetCoverage&coverage=srtm&width=512&height=512&bbox=-5,43,20,50&crs=epsg:4326&FORMAT=image/png
you can see the picture is always 512x512, but the data as keept the 
same ratio X/Y, and you have blank result on bottom.

Personnaly on my server, i don't have this result for this last request, 
i have only blank file. So I suspect you have the same problem than me.

Other solution could be to keep the size 512x512 but to modify the bbox 
to respect the ratio,
Another solution could be to use the resX=??&resY=?? inside of 
width=??&height=?? in your request, depends on your needs.

To finish, be careful if you have to reproject (like me), by asking 
requests with crs value different from the native crs from data. You 
will have to warn the units (meter / degrees for UTM / latlon), and to 
use resolution_asked_(x/y)_pixel AND native_resolution_(x/y) to 
computing height or width value.

Moreover, take care ! only 1 pixel difference on width or height value 
can give you blank or good results !!

I hope this could be helpful for you,

sincerely,

Jérôme Martin

edfialk a écrit :
> Something else I thought I should add, I seem to have forgotten each netCDF
> file I'm using (1960-2000) contains 12 months worth of data (only 12
> values), but so far I have seen the time extracted from the filename.  
>
> I extracted the year but statically-added 01-01T00 to each, when what I
> really need is MM-01T00...
>
> So I'm curious when I make the request for a certain year (1960-01-01) how
> to control which data comes out or if the netCDF automatically takes care of
> that.
>
> -Ed
>   



More information about the mapserver-users mailing list