Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WCS Server - Map Level Projection Object Potential Bug #4079

Merged
merged 1 commit into from Aug 28, 2012
Merged

WCS Server - Map Level Projection Object Potential Bug #4079

merged 1 commit into from Aug 28, 2012

Conversation

tbonfort
Copy link
Member

Reporter: loisg00
Date: 2011/11/14 - 15:27
Trac URL: http://trac.osgeo.org/mapserver/ticket/4079
Hi,

The issue was first described here : http://lists.osgeo.org/pipermail/mapserver-users/2011-November/070672.html

You might want to take a look if you are in need of any information I could have missed. I'll try to cover everything here, of course.

OS : Windows XP
MapServer version : 6.0.1, prebuilt from MS4W.

MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
SUPPORTS=PR
OJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=FRIBIDI
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT
SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS
SUPPO
RTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Faulty MapFile :
http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111104/78e5fa24/2011102811-0001.obj

Some GetCoverage requests along with their result :

http://localhost/cgi-bin/mapserv.exe?SERVICE=WCS&map=D:/Guillaume/ProjetCourantsGlaces/WCSproblem/2011102811.map&COVERAGE=thelayer&VERSION=1.0.0&REQUEST=GetCoverage&BBOX=-67.5,48.922499263758255,-64.6875,50.736455137010665&CRS=EPSG:4326&WIDTH=256&HEIGHT=256&FORMAT=GTiff

(with or without "&RESPONSE_CRS=EPSG:4326", the native projection)
Gives the following error :


msWCSGetCoverage(): WCS server error. Requested BBOX (-178.835708198757,2803.05273104522,179.552848002437,2906.98474680556) is outside requested coverage BBOX (-70,45,-55,52)

Notice how the Requested BBOX in the error doesn't make sense.

Adding "&RESPONSE_CRS=EPSG:900913" (or 3857) instead to the request should logically still give an error, because the BBOX itself isn't changed (it's the response_CRS, not the CRS...). Yet, it returns a geotiff. The file is all black (0 0 0), though :

http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111104/78e5fa24/wcsoutput-0001.tif

My inability to create a correct GeoTiff output was the original issue. Rahkonen Jukka found the solution :
Adding a projection object to the layer level allowed me to get a good GeoTiff, similar to the one obtained with a WMS request (http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111104/78e5fa24/wmsoutput-0001.tif).

PROJECTION
'init=epsg:4326'
END

However, this is an unexpected behaviour. The Map level projection object should be used when the layer is lacking one. I've been asked to create a ticket regarding the issue.

http://lists.osgeo.org/pipermail/mapserver-users/2011-November/070700.html

Although the original problem was about GeoTiff, it can probably be extended to other output formats.

The HDF5 source file can be found here :
http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111104/78e5fa24/data-0001.obj

The problem may or may not be specific to this input format. I don't know how MapServer handles this.

Logs produced by MapServer for several requests seen in this ticket are here :
http://lists.osgeo.org/pipermail/mapserver-users/attachments/20111104/78e5fa24/mapserv_errors-0001.obj

I tried to fit in as much information as I could. I'm sorry if I forgot something or haven't respected conventions I was unaware of. You can contact me if you need to at loiselle.guillaume@gmail.com .

Guillaume Loiselle

P.S. The "New Ticket" link found in the sentence "To enter an issue use the New Ticket button." from http://trac.osgeo.org/mapserver/ redirects to http://trac.osgeo.org/mapserver/mapserver/newticket, which is wrong and gives this error :

Error: Not Found

No handler matched request to /mapserver/newticket

The correct URL is http://trac.osgeo.org/mapserver/newticket. Is there a metaticket system to create tickets on ticket issues? :p

@mapserver-bot
Copy link
Author

Author: loisg00
Date: 2011/11/28 - 15:02
Replying to [ticket:4079 loisg00]:

Another user had an issue with projection within the WCS server. It shares some similarities with mine and could have the same source. I'm adding a link to this discussion and I will invite him to add more information here himself :

http://lists.osgeo.org/pipermail/mapserver-users/2011-November/070872.html

@ghost ghost assigned sdlime Apr 5, 2012
@tbonfort
Copy link
Member

@sdlime @dmorissette mapcache and the native mapserver tile mode both use a function called msMapSetLayerProjections which will set all the map's layer's projection to the map's projection if they were intially missing a projection. Would there be any side effects if this function was called in msLoadMap() rather than at multiple places in the code ?

@dmorissette
Copy link
Contributor

Yes, the possible side-effect is that projections are not required unless you plan on doing reprojections, and if you don't then the unnecessary projection blocks in all layers trigger extra tests based on msProjectionsDiffer() to decide if reprojection should kick in. While these tests should in theory not be too expensive, that would have to be verified. Plus loading init=epsg:xxxx codes for every layer is not exactly free, so that will add up as well for cases where no reprojection is needed.

Also, users of MapScript may have empty layers defined in their mapfile for various purposes, or may do some stuff based on the assumption that layers do not have a projection set, and unexpectedly setting the PROJECTION in those layers may possibly lead to unexpected side-effects that they may have to work around.

@tbonfort
Copy link
Member

@dmorissette OK I see your point. I will check that the WCS code does something similar than what the wms code does in https://github.com/mapserver/mapserver/blob/rel-6-2-0-beta2/mapwms.c#L1374

@ghost ghost assigned tbonfort Aug 20, 2012
@tbonfort
Copy link
Member

cc @Schpidi : any objections concerning this patch ?

@Schpidi
Copy link
Member

Schpidi commented Aug 20, 2012

Nope, seems reasonable and I guess you successfully run the wcs tests in msautotest ;)

@Schpidi
Copy link
Member

Schpidi commented Aug 20, 2012

Just seen you added this in the 6.2 branch. Shouldn't this be fixed in the 6.0 too?

@tbonfort
Copy link
Member

msautoWHAT ??? :)

On Mon, Aug 20, 2012 at 3:25 PM, Stephan Meissl notifications@github.comwrote:

Nope, seems reasonable and I guess you successfully run the wcs tests in
msautotest ;)


Reply to this email directly or view it on GitHubhttps://github.com//pull/4079#issuecomment-7868908.

@tbonfort
Copy link
Member

@Schpidi The autotests seem fine (failures don't seem related to this change at all). I'll let you merge the pull request if you're ok, I'll backport to 6-0 once you're done.

@Schpidi
Copy link
Member

Schpidi commented Aug 28, 2012

Finally found some time to look at this and run the tests. Seems fine.

Schpidi added a commit that referenced this pull request Aug 28, 2012
WCS Server - Map Level Projection Object Potential Bug
@Schpidi Schpidi merged commit e0be254 into MapServer:branch-6-2 Aug 28, 2012
Schpidi added a commit to EOX-A/mapserver that referenced this pull request Aug 28, 2012
Schpidi added a commit to EOX-A/mapserver that referenced this pull request Aug 28, 2012
mkofahl pushed a commit to faegi/mapserver that referenced this pull request Apr 9, 2013
mkofahl pushed a commit to faegi/mapserver that referenced this pull request Apr 9, 2013
WCS Server - Map Level Projection Object Potential Bug
mkofahl pushed a commit to faegi/mapserver that referenced this pull request Apr 9, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants