Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#698 closed defect (fixed)

[MapServer]Raster layer with tileindex is not displayed

Reported by: nsavard@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL Support Version: 4.3
Severity: normal Keywords: VERIFIED
Cc:

Description

Raster layer with associated tileindex is not displayed within a MapServer
template.  A tiff layer is loaded correctly within a similar template.


I'll attach the MapServer template, map file and the query templates
(raster_query2.tgz).  Data used is the one that comes with msautotest tests
suite. This data needs to be copied in "raster_query2/" directory.

Fedora Core 1
Mozilla 1.6
MapServer CVS 20040528

Attachments (1)

raster_query2.tgz (2.1 KB ) - added by nsavard@… 20 years ago.
MapServer template and map file

Download all attachments as: .zip

Change History (6)

by nsavard@…, 20 years ago

Attachment: raster_query2.tgz added

MapServer template and map file

comment:1 by mturk@…, 20 years ago

Summary: [MapServer]Raster layer with tileindex is not displayed [MapServer]Raster layer with tileindex is not displayed
Here is the patch:
The bug is caused by the fact that filename is assigned a value later freed by 
closing shapefile.


Index: mapraster.c
===================================================================
RCS file: /data2/cvsroot/mapserver/mapraster.c,v
retrieving revision 1.116
diff -u -r1.116 mapraster.c
--- mapraster.c	28 May 2004 18:34:34 -0000	1.116
+++ mapraster.c	30 May 2004 11:06:57 -0000
@@ -1325,11 +1325,11 @@
       if(status == MS_DONE) break; // no more tiles/images
        
       if(layer->data == NULL) // assume whole filename is in attribute field
-  	    filename = tshp.values[tileitemindex];
+  	    strcpy(tilename, tshp.values[tileitemindex]);
       else {  
 	    sprintf(tilename, "%s/%s", tshp.values[tileitemindex], layer->data);
-	    filename = tilename;
       }
+      filename = tilename;
       
       msFreeShape(&tshp); // done with the shape
     } else {


comment:2 by nsavard@…, 20 years ago

This patch fixed the problem.  Please set it as fixed and commit to CVS.

comment:3 by fwarmerdam, 20 years ago

Resolution: fixed
Status: newclosed
I have reviewed and applied this patch.  Technically the problem is that
the tileindex shape was freed before the filename was used.  This was recently
introduced (by Steve I think) in an effort to fix the leaking of the tileindex
shapes. 

I have verified that this bug did not exist in the 4.2 branch.

comment:4 by fwarmerdam, 20 years ago

Also..

Thanks Mladen!  


comment:5 by nsavard@…, 20 years ago

Keywords: VERIFIED added
Verified on Fedora Core 1.
Note: See TracTickets for help on using tickets.