Opened 17 years ago

Closed 14 years ago

#2069 closed defect (fixed)

Query on classed rasters

Reported by: ixcer Owned by: warmerdam
Priority: normal Milestone: FUTURE
Component: MapServer CGI Version: 4.10
Severity: normal Keywords: raster, query
Cc: dmorissette

Description

Bug reported:
In querying classed raster layers the following error occurs:
msDrawShape(): General error message. Unknown layer type.
The same error does not occur if raster layers are not classed.

The following zip file can be downloaded to test bug occurrency: http://www.marcocerruti.it/MS4W_test.zip

In the zip there are:

  • minimal mapfile (only two classified raster layers presenting the problem)
  • raster data (a couple of mbytes)
  • query templates (problem is on queries, I think you need them)
  • map template, html legend template, and a few of necessary files to let everything properly work (css, images, scripts)

URL triggering the problem:
[yourlocalhost] /cgi-bin/mapserv.exe?map=/ms4w/apps/valgrande_test/vg.map&layer=dem&layer=class_2000&mode=browse Just select query mode (question mark) and try to query these two layers.

Change History (8)

comment:1 by warmerdam, 17 years ago

Milestone: 5.0 release
Owner: changed from sdlime to warmerdam
Priority: highnormal
Severity: blockernormal
Version: 4.10

I'll take this one.

comment:2 by warmerdam, 17 years ago

Status: newassigned

I have tried:

mapserv QUERY_STRING='map=vg.map&layer=dem&layer=class_2000&mode=browse'

but an html result is returned.

I think the problem is that I wasn't supplied with the actual url that fails, but instead with an url that leads to a page that I am supposed to do something interactive on before the error is triggered.

Marco, can you capture the actual query request url that triggers the problem and put it in here? Thanks.

in reply to:  2 comment:3 by ixcer, 17 years ago

Replying to warmerdam:

Url triggering the problem is any query performed on the already provided "browse-mode" map, like the following.

[yourlocalhost]/cgi-bin/mapserv.exe?map=/ms4w/apps/valgrande_test/vg.map&layer=dem&layer=class_2000&mode=nquery&zoom=0&imgxy=300.0+250.0&imgext=439204.100000+5087047.000000+481028.900000+5121901.000000&savequery=true&img.x=271&img.y=392

comment:4 by warmerdam, 17 years ago

OK, I have successfully reproduced the error report with the command:

mapserv QUERY_STRING='map=vg.map&layer=dem&layer=class_2000&mode=nquery&zoom=0&imgxy=300.0+250.0&imgext=439204.100000+5087047.000000+481028.900000+5121901.000000&savequery=true&img.x=271&img.y=392'

I could potentially modify msDrawShape() to treat raster layers as point layers since the features returned by a query on the raster layer will be points. But I'm really not too comfortable with this. Really, I'm not sure that it makes a lot of sense to drawing a map of raster query results. And if we decide this is worth doing, it is problematic to have a raster layer treated as a raster for some purposes, and as a point layer for others. In particular, how do we provide styling info that will be appropriate in these fairly different circumstances.

I'm tempted to modify msDrawQueryLayer() to do nothing raster layers, but to issue a debug message indicating that the layer is being skipped since drawing raster query results is considered an unclear request. I will post to mapserver-dev to see if any of the other developers have an opinion.

If you see a very valuable use case for plotting raster query results, perhaps you could explain it here.

comment:5 by dmorissette, 17 years ago

Cc: dmorissette added

in reply to:  4 comment:6 by ixcer, 17 years ago

I understood, and I fully agree a raster layer can't be treated as a point layer just (!) in queries. In my case the trouble was easily workarounded (rasters converted into vector layers, and queries on classed vectors work fine), but what for me (beginner user) is a problem is that what I can overlay and see in browse mode (classed rasters, like a classed DEM, as a base map for vector layers) can't give proper results in query mode just because one raster is classed.

By the way, GFOSS italian list assured me that this problem is only in the case of MS4W ... so one answer could be to change my OS.

comment:7 by warmerdam, 17 years ago

Milestone: 5.0 releaseFUTURE

comment:8 by warmerdam, 14 years ago

Resolution: fixed
Status: assignedclosed

I believe the handling of this has been changed in response to other tickets, though I'm not sure or not if it works well in msDrawShape(). The sample dataset is now gone, so I can't easily attempt to reproduce it now.

Note: See TracTickets for help on using tickets.