Open tbonfort opened 12 years ago
Author: fwarmerdam Date: 2006/08/16 - 21:57
I'll try and address this for 4.10.
Author: warmerdam Date: 2007/09/05 - 22:11 Well, perhaps I'll try and reproduce this for 5.0.1.
Author: warmerdam Date: 2007/12/01 - 04:50 With some work I managed to reproduce the error using the materials in bug1842.zip (attached). The error gives this traceback:
#0 msSetError (code=12, message_fmt=0x547043 "Unknown layer type.",
routine=0x546fa9 "msDrawShape()") at maperror.c:319
#1 0x0000000000468815 in msDrawShape (map=0x67fe40, layer=0x687230,
shape=0x7fffffc8b120, image=0x723780, style=-1) at mapdraw.c:1644
#2 0x00000000004655ec in msDrawQueryLayer (map=0x67fe40, layer=0x687230,
image=0x723780) at mapdraw.c:1067
#3 0x00000000004633d7 in msDrawMap (map=0x67fe40, querymap=1)
at mapdraw.c:431
#4 0x000000000041866f in msReturnTemplateQuery (msObj=0x67f1d0,
pszMimeType=0x682860 "text/html", papszBuffer=0x0) at maptemplate.c:200
#5 0x000000000041633d in main (argc=2, argv=0x7fffffc8bd88) at mapserv.c:1585
(gdb)
Basically, query that result in generating a map are not supported for queries against a raster layer since there is no apparent information on how to draw raster query results. This is a known limitation though I hadn't quite connected the pieces to understand how we get to this point.
Author: warmerdam Date: 2007/12/01 - 05:09 I have bolded the portion in the Raster Data Access document discussing that raster layers are not supported for drawing query maps. I have also made a change in trunk (6895f9d5054d79888c6599e9c8ed9c7e5aaa7564 (r7132)) in msDrawQueryLayer() to report the error more clearly as:
msDrawQueryLayer(): Query error. Unable to draw raster layers (such as chlaYYMMDDsat) as part of a query result.
I haven't migrated this change into 5.0 branch as I'd appreciate some review by folks familiar with this part of the code first.
Author: warmerdam Date: 2008/01/04 - 17:38 I'm not that comfortable with this fix going into 5.0.x without more vetting, so I'm going to retarget it to 5.2 and close it. The fix only improves error reporting anyways, it doesn't make something work that wasn't working.
Author: warmerdam Date: 2008/01/23 - 05:21 I have discovered this error is interfering with the operation of WMS GetFeatureInfo as tested in msautotest/wxs/tomk_workshop.map - this request:
# Generate WMS GetFeatureInfo HTML format on raster data
# RUN_PARMS: wms_get_feature_info_raster.html [MAPSERV] QUERY_STRING="map=[MAPFILE]&version=1.1.1&service=WMS&request=GetFeatureInfo&srs=EPSG:4326&bbox=-180,-90,180,90&format=image/png&layers=land_shallow_topo_2048,rivers&styles=,&transparent=true&width=500&height=300&query_layers=land_shallow_topo_2048&info_format=text/html&x=141&y=91&radius=10" > [RESULT]
#
I'm not exactly clear why this GetFeatureInfo results in a map being drawn. It does not appear it gets used for anything after dumping it in the tmp directory.
Author: tomkralidis Date: 2008/02/09 - 03:32 Replying to [comment:6 warmerdam]:
I have discovered this error is interfering with the operation of WMS GetFeatureInfo as tested in msautotest/wxs/tomk_workshop.map - this request:
# Generate WMS GetFeatureInfo HTML format on raster data # RUN_PARMS: wms_get_feature_info_raster.html [MAPSERV] QUERY_STRING="map=[MAPFILE]&version=1.1.1&service=WMS&request=GetFeatureInfo&srs=EPSG:4326&bbox=-180,-90,180,90&format=image/png&layers=land_shallow_topo_2048,rivers&styles=,&transparent=true&width=500&height=300&query_layers=land_shallow_topo_2048&info_format=text/html&x=141&y=91&radius=10" > [RESULT] #
I'm not exactly clear why this GetFeatureInfo results in a map being drawn. It does not appear it gets used for anything after dumping it in the tmp directory.
The reason a map is being drawm is because given INFO_FORMAT=text/html, output is based on the templates (HEADER/TEMPLATE/FOOTER). In these particular templates, an image is called via HTML img tag.
Author: warmerdam Date: 2009/10/24 - 02:38 Ok, I'm now starting to regret just producing an error for drawing raster query maps. I have an alternate approach that instead treats the raster layer as a point layer and allows control to proceed through the query map drawing without apparent problems (though it isn't clear if the results are particularly useful). Should we consider this approach instead? I kind of hate to flip like this as such a late date.
Index: mapdraw.c
===================================================================
--- mapdraw.c (revision 9505)
+++ mapdraw.c (working copy)
@@ -1121,11 +1121,6 @@
if(!msLayerIsVisible(map, layer)) return(MS_SUCCESS); /* not an error, just nothing to do */
- if( layer->type == MS_LAYER_RASTER ) {
- msSetError( MS_QUERYERR, "Unable to draw raster layers (such as %s) as part of a query result.", "msDrawQueryLayer()", layer->name );
- return MS_FAILURE;
- }
-
/* set annotation status */
annotate = msEvalContext(map, layer, layer->labelrequires);
if(map->scaledenom > 0) {
@@ -1828,6 +1823,7 @@
}
break; /* end MS_LAYER_ANNOTATION */
+ case MS_LAYER_RASTER:
case MS_LAYER_POINT:
#ifdef USE_PROJ
Author: dmorissette Date: 2009/11/25 - 04:42 Let's do this in 6.0. If we can confirm that the change is safe we can always consider backporting to 5.6.x if necessary.
Tom, can you please test Frank's patch and confirm it solves your issue?
Author: tomkralidis
Date: 2009/11/25 - 19:58
After testing, this looks like it fixes the issue (testing msautotest/wxs/tomk_workshop.map
). There are some small HTML formatting issues, but the main issue is gone. I will update the msautotest/expected result once the code is committed.
Author: warmerdam Date: 2010/03/29 - 16:15 I have incorporated the suggested patch and confirmed that the getfeatureinfo test in msautotest now does something useful though there are some differences in the results from the expected.
Author: warmerdam Date: 2010/03/29 - 16:16 I should note the change is 89ff7736e38f3a4cb734f96216b4e49c4de6e206 (r10026) in trunk only.
Reporter: Henrik.Stutz@fimr.fi Date: 2006/07/25 - 08:00