Ticket #1800: bug1800.patch

File bug1800.patch, 7.9 kB (added by dmorissette, 1 year ago)

Patch updated to work with current (4.99) SVN trunk

  • mapfile.c

    old new  
    6565** Must be kept in sync with enumerations and defines found in map.h. 
    6666*/ 
    6767static char *msUnits[8]={"INCHES", "FEET", "MILES", "METERS", "KILOMETERS", "DD", "PIXELS", "PERCENTAGES"}; 
    68 static char *msLayerTypes[8]={"POINT", "LINE", "POLYGON", "RASTER", "ANNOTATION", "QUERY", "CIRCLE", "TILEINDEX"}; 
     68static char *msLayerTypes[9]={"POINT", "LINE", "POLYGON", "RASTER", "ANNOTATION", "QUERY", "CIRCLE", "TILEINDEX","CHART"}; 
    6969char *msPositionsText[MS_POSITIONS_LENGTH] = {"UL", "LR", "UR", "LL", "CR", "CL", "UC", "LC", "CC", "AUTO", "XY", "FOLLOW"}; /* msLabelPositions[] also used in mapsymbols.c (not static) */ 
    7070static char *msBitmapFontSizes[5]={"TINY", "SMALL", "MEDIUM", "LARGE", "GIANT"}; 
    7171static char *msQueryMapStyles[4]={"NORMAL", "HILITE", "SELECTED", "INVERTED"}; 
     
    27772777      if((layer->transform = getSymbol(11, MS_TRUE,MS_FALSE, MS_UL,MS_UC,MS_UR,MS_CL,MS_CC,MS_CR,MS_LL,MS_LC,MS_LR)) == -1) return(-1); 
    27782778      break; 
    27792779    case(TYPE): 
    2780       if((layer->type = getSymbol(8, MS_LAYER_POINT,MS_LAYER_LINE,MS_LAYER_RASTER,MS_LAYER_POLYGON,MS_LAYER_ANNOTATION,MS_LAYER_QUERY,MS_LAYER_CIRCLE,TILEINDEX)) == -1) return(-1); 
     2780      if((layer->type = getSymbol(9, MS_LAYER_POINT,MS_LAYER_LINE,MS_LAYER_RASTER,MS_LAYER_POLYGON,MS_LAYER_ANNOTATION,MS_LAYER_QUERY,MS_LAYER_CIRCLE,MS_LAYER_CHART,TILEINDEX)) == -1) return(-1); 
    27812781      if(layer->type == TILEINDEX) layer->type = MS_LAYER_TILEINDEX; /* TILEINDEX is also a parameter */ 
    27822782      break;     
    27832783    case(UNITS): 
  • mappostgis.c

    old new  
    10581058                    break; 
    10591059 
    10601060                case MS_LAYER_POLYGON: 
     1061                                         case MS_LAYER_CHART: 
    10611062                    result = force_to_polygons(wkb, shape); 
    10621063                    break; 
    10631064 
     
    12521253        wkb = (char *) PQgetvalue(query_result, 0, layer->numitems);   
    12531254        /* layer->numitems is the wkt column */ 
    12541255        switch(layer->type) { 
     1256                                case MS_LAYER_CHART: 
    12551257            case MS_LAYER_POINT: 
    12561258                result = force_to_points(wkb, shape); 
    12571259                break; 
  • mapmygis.c

    old new  
    13621362                                                wkb_force_to_lines(wkb, shape) : 
    13631363                                                force_to_lines(row, layerinfo->query_result, shape, record); 
    13641364                                        break; 
     1365                                case MS_LAYER_CHART: 
    13651366                                case MS_LAYER_POLYGON: 
    13661367                                        result = wkbdata ? 
    13671368                                                wkb_force_to_polygons(wkb, shape) : 
  • map.h

    old new  
    320320enum MS_FILE_TYPE {MS_FILE_MAP, MS_FILE_SYMBOL}; 
    321321enum MS_UNITS {MS_INCHES, MS_FEET, MS_MILES, MS_METERS, MS_KILOMETERS, MS_DD, MS_PIXELS, MS_PERCENTAGES}; 
    322322enum MS_SHAPE_TYPE {MS_SHAPE_POINT, MS_SHAPE_LINE, MS_SHAPE_POLYGON, MS_SHAPE_NULL}; 
    323 enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX}; 
     323enum MS_LAYER_TYPE {MS_LAYER_POINT, MS_LAYER_LINE, MS_LAYER_POLYGON, MS_LAYER_RASTER, MS_LAYER_ANNOTATION, MS_LAYER_QUERY, MS_LAYER_CIRCLE, MS_LAYER_TILEINDEX, MS_LAYER_CHART}; 
    324324enum MS_FONT_TYPE {MS_TRUETYPE, MS_BITMAP}; 
    325325 
    326326#define MS_POSITIONS_LENGTH 12 
     
    17771777MS_DLL_EXPORT int *msGetGDALBandList( layerObj *layer, void *hDS, int max_bands, int *band_count ); 
    17781778MS_DLL_EXPORT double msGetGDALNoDataValue( layerObj *layer, void *hBand, int *pbGotNoData ); 
    17791779 
     1780/* in mapchart.c */ 
     1781MS_DLL_EXPORT int msDrawChartLayer(mapObj *map, layerObj *layer, imageObj *image); 
     1782MS_DLL_EXPORT int msDrawChartLayerGD(mapObj *map, layerObj *layer, imageObj *image); 
     1783 
    17801784/* ==================================================================== */ 
    17811785/*      End of prototypes for functions in mapgd.c                      */ 
    17821786/* ==================================================================== */ 
  • Makefile.in

    old new  
    241241 
    242242RM= /bin/rm -f 
    243243 
    244 OBJS= maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o mapmygis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o mapdraw.o mapgd.o mapagg.o mapoutput.o mapgdal.o mapswf.o mapimagemap.o mapows.o mapwfs.o mapwfslayer.o mapcontext.o maphttp.o mapdrawgdal.o mappdf.o mapjoin.o mapgraticule.o mapcopy.o mapogcfilter.o mapogcsld.o maptime.o mapwcs.o mapcpl.o cgiutil.o maprasterquery.o mapobject.o mapgeos.o classobject.o layerobject.o mapio.o mappool.o mapsvg.o mapregex.o mappluginlayer.o mapogcsos.o mappostgresql.o mapcrypto.o mapowscommon.o $(EPPL_OBJ)  
     244OBJS= maptemplate.o mapbits.o maphash.o mapshape.o mapxbase.o mapparser.o maplexer.o maptree.o mapsearch.o mapstring.o mapsymbol.o mapfile.o maplegend.o maputil.o mapscale.o mapquery.o maplabel.o maperror.o mapprimitive.o mapproject.o mapraster.o mapsde.o mapogr.o mappostgis.o mapmygis.o maplayer.o mapresample.o mapwms.o mapwmslayer.o maporaclespatial.o mapgml.o mapprojhack.o mapthread.o mapdraw.o mapgd.o mapagg.o mapoutput.o mapgdal.o mapswf.o mapimagemap.o mapows.o mapwfs.o mapwfslayer.o mapcontext.o maphttp.o mapdrawgdal.o mappdf.o mapjoin.o mapgraticule.o mapcopy.o mapogcfilter.o mapogcsld.o maptime.o mapwcs.o mapcpl.o cgiutil.o maprasterquery.o mapobject.o mapgeos.o classobject.o layerobject.o mapio.o mappool.o mapsvg.o mapregex.o mappluginlayer.o mapogcsos.o mappostgresql.o mapcrypto.o mapowscommon.o mapchart.o $(EPPL_OBJ)  
    245245 
    246246EXE_LIST =      shp2img shp2pdf legend mapserv shptree shptreevis \ 
    247247                shptreetst scalebar sortshp mapscriptvars tile4ms \ 
  • mapdraw.c

    old new  
    678678  { 
    679679      retcode = msDrawRasterLayer(map, layer, image_draw); 
    680680  } 
     681  else if(layer->type == MS_LAYER_CHART) 
     682  { 
     683                retcode = msDrawChartLayer(map, layer, image_draw); 
     684  } 
    681685  /* Must be a Vector layer */ 
    682686  else { 
    683687      retcode = msDrawVectorLayer(map, layer, image_draw); 
     
    11011105} 
    11021106 
    11031107/** 
     1108 * Generic function to render chart layers. 
     1109 */ 
     1110int msDrawChartLayer(mapObj *map, layerObj *layer, imageObj *image)  
     1111{ 
     1112    if (image && map && layer) 
     1113    { 
     1114        if( MS_RENDERER_GD(image->format) ) 
     1115            return msDrawChartLayerGD(map, layer, image); 
     1116    } 
     1117 
     1118    return MS_FAILURE; 
     1119} 
     1120 
     1121 
     1122/** 
    11041123 * msDrawWMSLayer() 
    11051124 * 
    11061125 * Draw a single WMS layer.   
  • maplegend.c

    old new  
    126126      break; 
    127127    case MS_LAYER_CIRCLE: 
    128128    case MS_LAYER_RASTER: 
     129         case MS_LAYER_CHART: 
    129130    case MS_LAYER_POLYGON: 
    130131      for(i=0; i<class->numstyles; i++)      
    131132        msDrawShadeSymbolGD(&map->symbolset, img, &box, class->styles[i], lp->scalefactor); 
  • maplexer.l

    old new  
    285285<INITIAL>butt                                  { return(MS_CJC_BUTT); } 
    286286<INITIAL>cartoline                             { return(MS_SYMBOL_CARTOLINE); } 
    287287<INITIAL,VALUE_STRING>cc                       { return(MS_CC); } 
     288<INITIAL,VALUE_STRING>chart                    { return(MS_LAYER_CHART); } 
    288289<INITIAL,VALUE_STRING>circle                   { return(MS_LAYER_CIRCLE); } 
    289290<INITIAL,VALUE_STRING>cl                       { return(MS_CL); } 
    290291<INITIAL,VALUE_STRING>cr                       { return(MS_CR); }