[mapserver-commits] r9459 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Oct 14 15:50:07 EDT 2009


Author: tbonfort
Date: 2009-10-14 15:50:05 -0400 (Wed, 14 Oct 2009)
New Revision: 9459

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapdraw.c
Log:
more resolution fixes for resolution scaling (symbolscale case) (#3157)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-10-14 19:38:17 UTC (rev 9458)
+++ trunk/mapserver/HISTORY.TXT	2009-10-14 19:50:05 UTC (rev 9459)
@@ -15,6 +15,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- more resolution fixes for resolution scaling (symbolscale case) (#3157)
+
 - Make sure layer extents are saved when a mapfile is written (#2969)
 
 - Fixed CurvePolygons from oracle not drawn (#2772)

Modified: trunk/mapserver/mapdraw.c
===================================================================
--- trunk/mapserver/mapdraw.c	2009-10-14 19:38:17 UTC (rev 9458)
+++ trunk/mapserver/mapdraw.c	2009-10-14 19:50:05 UTC (rev 9459)
@@ -278,7 +278,7 @@
       if(GET_LAYER(map, i)->sizeunits != MS_PIXELS)
         GET_LAYER(map, i)->scalefactor = (msInchesPerUnit(GET_LAYER(map, i)->sizeunits,0)/msInchesPerUnit(map->units,0)) / geo_cellsize;
       else if(GET_LAYER(map, i)->symbolscaledenom > 0 && map->scaledenom > 0)
-        GET_LAYER(map, i)->scalefactor = GET_LAYER(map, i)->symbolscaledenom/map->scaledenom;
+        GET_LAYER(map, i)->scalefactor = GET_LAYER(map, i)->symbolscaledenom/map->scaledenom*map->resolution/map->defresolution;
       else
         GET_LAYER(map, i)->scalefactor = map->resolution/map->defresolution;
     }
@@ -2438,6 +2438,7 @@
         cacheslot = &(map->labelcache.slots[priority]);
 
         for(l=cacheslot->numlabels-1; l>=0; l--) {
+          double scalefactor,size;
           cachePtr = &(cacheslot->labels[l]); /* point to right spot in the label cache */
 
           layerPtr = (GET_LAYER(map, cachePtr->layerindex)); /* set a couple of other pointers, avoids nasty references */
@@ -2448,9 +2449,14 @@
 
           if(msGetLabelSize(image,cachePtr->text, labelPtr, &r, &(map->fontset), layerPtr->scalefactor, MS_TRUE,NULL) == -1)
             return(-1);
+          
+          size = labelPtr->size * layerPtr->scalefactor;
+          size = MS_MAX(size, labelPtr->minsize*image->resolutionfactor);
+          size = MS_MIN(size, labelPtr->maxsize*image->resolutionfactor);
+          scalefactor = size / labelPtr->size;
 
-          label_offset_x = labelPtr->offsetx*layerPtr->scalefactor;
-          label_offset_y = labelPtr->offsety*layerPtr->scalefactor;
+          label_offset_x = labelPtr->offsetx*scalefactor;
+          label_offset_y = labelPtr->offsety*scalefactor;
           label_buffer = labelPtr->buffer*image->resolutionfactor;
           label_mindistance = labelPtr->mindistance*image->resolutionfactor;
           



More information about the mapserver-commits mailing list