[mapserver-commits] r9480 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sun Oct 18 08:55:58 EDT 2009
Author: sdlime
Date: 2009-10-18 08:55:56 -0400 (Sun, 18 Oct 2009)
New Revision: 9480
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapdraw.c
trunk/mapserver/mapshape.c
Log:
Allow processing of single shapefiles with no items (e.g. an empty dbf file). (#3147)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2009-10-17 14:29:08 UTC (rev 9479)
+++ trunk/mapserver/HISTORY.TXT 2009-10-18 12:55:56 UTC (rev 9480)
@@ -15,6 +15,8 @@
Current Version (SVN trunk):
----------------------------
+- Allow processing of single shapefiles with no items (e.g. an empty dbf file) (#3147)
+
- Added resolution scaling for swf, svg, pdf and imagemap drivers (#3157)
- Correct cases where a valid WFS Layer might return errors if
Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c 2009-10-17 14:29:08 UTC (rev 9479)
+++ trunk/mapserver/mapdraw.c 2009-10-18 12:55:56 UTC (rev 9480)
@@ -233,6 +233,8 @@
double cellsize_x = (map->extent.maxx - map->extent.minx)/map->width;
double cellsize_y = (map->extent.maxy - map->extent.miny)/map->height;
+ fprintf(stderr, "ans: %g %g %g %g\n", map->extent.minx, map->extent.miny, map->extent.maxx, map->extent.maxy);
+
if( cellsize_y != 0.0
&& (fabs(cellsize_x/cellsize_y) > 1.00001
|| fabs(cellsize_x/cellsize_y) < 0.99999) )
@@ -318,9 +320,16 @@
if(map->querymap.height != -1) map->height = map->querymap.height;
}
+ fprintf(stderr, "1: %g %g %g %g\n", map->extent.minx, map->extent.miny, map->extent.maxx, map->extent.maxy);
+
msApplyMapConfigOptions(map);
+
+ fprintf(stderr, "2: %g %g %g %g\n", map->extent.minx, map->extent.miny, map->extent.maxx, map->extent.maxy);
+
image = msPrepareImage(map, MS_TRUE);
+ fprintf(stderr, "3: %g %g %g %g\n", map->extent.minx, map->extent.miny, map->extent.maxx, map->extent.maxy);
+
if(!image) {
msSetError(MS_IMGERR, "Unable to initialize image.", "msDrawMap()");
return(NULL);
Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c 2009-10-17 14:29:08 UTC (rev 9479)
+++ trunk/mapserver/mapshape.c 2009-10-18 12:55:56 UTC (rev 9480)
@@ -2578,7 +2578,8 @@
}
layer->numitems = msDBFGetFieldCount(shpfile->hDBF);
- layer->items = msDBFGetItems(shpfile->hDBF);
+ layer->items = msDBFGetItems(shpfile->hDBF);
+ if(layer->numitems == 0) return MS_SUCCESS; /* No items is a valid case (#3147) */
if(!layer->items) return MS_FAILURE;
return msLayerInitItemInfo(layer);
More information about the mapserver-commits
mailing list