Opened 17 years ago

Closed 17 years ago

#2343 closed defect (fixed)

Runtime error querying raster layers

Reported by: mikitessaro Owned by: warmerdam
Priority: normal Milestone: 5.0.1 release
Component: GDAL Support Version: 5.0
Severity: normal Keywords: raster query libmap error
Cc: sdlime

Description (last modified by warmerdam)

Performing queries with mode=nquery on raster layers raises a runtime error. Windows signals an error on libmap.dll at offset 000a26b7 (if can help). Tested un Windows 2003 server with MapServer 5.0, installed from ms4w version 2.2.6 (September 18 2007). Query on raster layers works fine for MapServer 4.10.

Example of query: http://myserver/cgi-bin/mapserv.exe?mode=nquery&mapxy=2343893.06%20205111754.6&map=C%3A%5Cmaptest.map

Map file:

MAP
  SIZE              332 322
  EXTENT            2313596.6 5047374.695 2435539.84 5169317.935
  PROJECTION
    "init=epsg:26592"
    "units=m"
    "pm=greenwich"
    "lon_0=15.0"
  END

  WEB
    MINSCALE        10
    MAXSCALE        1000000000
    LOG             "C:\Temp\mapserver.log"
    IMAGEPATH       "C:\Temp\web\"
    IMAGEURL        "/webmaps/"
  END

  LAYER
    NAME            "DTM"
    DEBUG           ON
    STATUS          DEFAULT
    DATA            "C:\DTM_RegioneColore.tif"
    TYPE            RASTER
    TEMPLATE        "C:\DTMMapQueryTemplate.html"

    CLASS
      NAME          "DTM"
    END
  END
END

File DTMMapQueryTemplate.html

<result>
  <layer name="DTM">
    <extent>
      <top>[shpmaxy]</top>
      <left>[shpminx]</left>
      <bottom>[shpminy]</bottom>
      <right>[shpmaxx]</right>
    </extent>
  </layer>
</result>

Change History (6)

comment:1 by sdlime, 17 years ago

Cc: warmerdam added

comment:2 by warmerdam, 17 years ago

Cc: sdlime added; warmerdam removed
Component: MapServer CGIGDAL Support
Milestone: 5.0.1 release
Owner: changed from sdlime to warmerdam

I'll take this one...

comment:3 by warmerdam, 17 years ago

Status: newassigned

Where can I find a copy of DTM_RegioneColore.tif so that I can reproduce this problem?

comment:4 by mikitessaro, 17 years ago

The image is big (28M). You can download it from http://www.sistemigrafici.insiel.it:8080/Consultatore/DTM_RegioneColore.tif . There is also the tfw file: http://www.sistemigrafici.insiel.it:8080/Consultatore/DTM_RegioneColore.tfw . I think that the problem isn't related to the particular image.

comment:5 by warmerdam, 17 years ago

Description: modified (diff)

comment:6 by warmerdam, 17 years ago

Resolution: fixed
Status: assignedclosed

I have reproduced the problem. The issue is with raster queries against classified raster layers with no styles. Sloppy old code was still accessing styles[0] which worked in 4.10 because things were not dynamic. Now that the styles list is dynamic the pointer is NULL.

The problem has been fixed in trunk (r6931) and 5.0 branch (r6932). The fix will appear in 5.0.1 when issued.

PS.

I think the example query should have been:

http://myserver/cgi-bin/mapserv.exe?mode=nquery&mapxy=2343893.06%205111754.6&map=C%3A%5Cmaptest.map

Otherwise the target is (way) off the image and the problem does not manifest.

Note: See TracTickets for help on using tickets.