[mapserver-commits] r11472 - in trunk/mapserver: . mapscript/php mapscript/swiginc

svn at osgeo.org svn at osgeo.org
Tue Apr 5 22:48:18 EDT 2011


Author: dmorissette
Date: 2011-04-05 19:48:18 -0700 (Tue, 05 Apr 2011)
New Revision: 11472

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapfile.c
   trunk/mapserver/mapogcsld.c
   trunk/mapserver/mapogcsld.h
   trunk/mapserver/mapscript/php/symbol.c
   trunk/mapserver/mapscript/swiginc/symbol.i
   trunk/mapserver/mapsymbol.c
   trunk/mapserver/mapsymbol.h
Log:
Removed GAP, PATTERN, LINECAP/JOIN and POSITION from symbolObj (#3797)

Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/HISTORY.TXT	2011-04-06 02:48:18 UTC (rev 11472)
@@ -15,18 +15,21 @@
 Current Version (SVN trunk): 
 ---------------------------- 
 
+- Removed GAP, PATTERN, LINECAP/JOIN and POSITION from symbolObj (#3797)
+
 - Fixed handling of STYLEITEM AUTO label position codes 10,11,12 (#3806)
 
 - Fixed msGEOSGeometry2Shape to handle 'GEOMETRYCOLLECTION EMPTY' 
   as null geometry instead of raising an error (#3811)
 
-- Re-added the MYSQL JOIN support. Had been removed with the MYGIS deprecated driver.
+- Re-added the MYSQL JOIN support. Had been removed with the MYGIS 
+  deprecated driver.
 
 - Add opacity to legend (#3740)
 
 - Updated PHP/MapScript with the new objects properties (#3735)
 
-- KML: set layeer's projection when it is not defined (#3809)
+- KML: set layer's projection when it is not defined (#3809)
 
 - Updated xml mapfile schema and xsl with the new lexer properties (#3735)
 

Modified: trunk/mapserver/mapfile.c
===================================================================
--- trunk/mapserver/mapfile.c	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapfile.c	2011-04-06 02:48:18 UTC (rev 11472)
@@ -5243,7 +5243,6 @@
 
 static int loadMapInternal(mapObj *map)
 {
-  int i,j,k;
   int foundMapToken=MS_FALSE; 
   int token; 
 
@@ -5303,40 +5302,6 @@
 
       if (msResolveSymbolNames(map) == MS_FAILURE) return MS_FAILURE;
       
-      /*backwards compatibility symbol to style merging*/
-      for(i=0; i<map->numlayers; i++) {
-        layerObj *layer = GET_LAYER(map, i);
-        for(j=0; j<layer->numclasses; j++) {
-          classObj *class = layer->class[j];
-          for(k=0; k<class->numstyles; k++) {
-            styleObj *style = class->styles[k];
-            if(style->symbol != 0) {
-              symbolObj *symbol = map->symbolset.symbol[style->symbol];
-              if (symbol)
-              {
-                  if(style->gap == 0)
-                    style->gap = symbol->gap;
-                  if(style->patternlength == 0) {
-                      int idx;
-                      style->patternlength = symbol->patternlength;
-                      for(idx=0;idx<style->patternlength;idx++)
-                        style->pattern[idx] = (double)(symbol->pattern[idx]);
-                  }
-                  if(style->position == MS_CC)
-                    style->position = symbol->position;
-                  if(style->linecap == MS_CJC_ROUND)
-                    style->linecap = symbol->linecap;
-                  if(style->linejoin == MS_CJC_NONE)
-                    style->linejoin = symbol->linejoin;
-                  if(style->linejoinmaxsize == 3)
-                    style->linejoinmaxsize = symbol->linejoinmaxsize;
-              }
-            }
-          }
-        }
-      }
-      
-      
 
 #if defined (USE_GD_TTF) || defined (USE_GD_FT)
       if(msLoadFontSet(&(map->fontset), map) == -1) return MS_FAILURE;

Modified: trunk/mapserver/mapogcsld.c
===================================================================
--- trunk/mapserver/mapogcsld.c	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapogcsld.c	2011-04-06 02:48:18 UTC (rev 11472)
@@ -1772,8 +1772,7 @@
                     
                 
                 /* Get the corresponding symbol id  */
-                psStyle->symbol = msSLDGetMarkSymbol(map, pszSymbolName, 
-                                                     bFilled, pszDashValue);
+                psStyle->symbol = msSLDGetMarkSymbol(map, pszSymbolName, bFilled);
                 if (psStyle->symbol > 0 &&
                     psStyle->symbol < map->symbolset.numsymbols)
                   psStyle->symbolname = 
@@ -1799,12 +1798,9 @@
 /*      square, circle, triangle, star, cross, x.                       */
 /*      If the symbol does not exsist add it to the symbol list.        */
 /************************************************************************/
-int msSLDGetMarkSymbol(mapObj *map, char *pszSymbolName, int bFilled,
-                       char *pszDashValue)
+int msSLDGetMarkSymbol(mapObj *map, char *pszSymbolName, int bFilled)
 {
     int nSymbolId = 0;
-    char **aszValues = NULL;
-    int nDash, i;
     symbolObj *psSymbol = NULL;
 
     if (!map || !pszSymbolName)
@@ -1900,20 +1896,6 @@
         psSymbol->sizex = 1;
         psSymbol->sizey = 1; 
         
-        if (pszDashValue)
-        {
-            nDash = 0;
-            aszValues = msStringSplit(pszDashValue, ' ', &nDash);
-            if (nDash > 0)
-            {
-                psSymbol->patternlength = nDash;
-                for (i=0; i<nDash; i++)
-                  psSymbol->pattern[i] = atoi(aszValues[i]);
-
-                msFreeCharArray(aszValues, nDash);
-            }
-        }
-
         if (strcasecmp(pszSymbolName, "square") == 0)
         {
             if (bFilled)

Modified: trunk/mapserver/mapogcsld.h
===================================================================
--- trunk/mapserver/mapogcsld.h	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapogcsld.h	2011-04-06 02:48:18 UTC (rev 11472)
@@ -69,8 +69,7 @@
 
 int msSLDGetLineSymbol(mapObj *map);
 int msSLDGetDashLineSymbol(mapObj *map, char *pszDashArray);
-int msSLDGetMarkSymbol(mapObj *map, char *pszSymbolName, int bFilled,
-                       char *pszDashValue);
+int msSLDGetMarkSymbol(mapObj *map, char *pszSymbolName, int bFilled);
 int msSLDGetGraphicSymbol(mapObj *map, char *pszFileName, char *extGraphicName, int nGap);
 
 int msSLDSetColorObject(char *psHexColor, colorObj *psColor);

Modified: trunk/mapserver/mapscript/php/symbol.c
===================================================================
--- trunk/mapserver/mapscript/php/symbol.c	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapscript/php/symbol.c	2011-04-06 02:48:18 UTC (rev 11472)
@@ -123,14 +123,12 @@
     else IF_GET_DOUBLE("sizey", php_symbol->symbol->sizey) 
     else IF_GET_LONG("numpoints", php_symbol->symbol->numpoints) 
     else IF_GET_LONG("filled", php_symbol->symbol->filled) 
-    else IF_GET_LONG("patternlength", php_symbol->symbol->patternlength) 
     else IF_GET_STRING("imagepath", php_symbol->symbol->imagepath)
     else IF_GET_LONG("transparent", php_symbol->symbol->transparent) 
     else IF_GET_LONG("transparentcolor", php_symbol->symbol->transparentcolor) 
     else IF_GET_STRING("character", php_symbol->symbol->character)
     else IF_GET_LONG("antialias", php_symbol->symbol->antialias) 
     else IF_GET_STRING("font", php_symbol->symbol->font)
-    else IF_GET_LONG("position", php_symbol->symbol->position) 
     else 
     {
         mapscript_throw_exception("Property '%s' does not exist in this object." TSRMLS_CC, property);
@@ -166,7 +164,6 @@
     else IF_SET_STRING("character", php_symbol->symbol->character, value)
     else IF_SET_LONG("antialias", php_symbol->symbol->antialias, value) 
     else IF_SET_STRING("font", php_symbol->symbol->font, value)
-    else IF_SET_LONG("position", php_symbol->symbol->position, value) 
     else if ( (STRING_EQUAL("numpoints", property)) ||
          (STRING_EQUAL("patternlength", property)) ||
          (STRING_EQUAL("imagepath", property)))
@@ -269,83 +266,8 @@
 }
 /* }}} */
 
-/* {{{ proto int symbol.setpattern(array points)
-   Set the pattern of the symbol ) */ 
-PHP_METHOD(symbolObj, setPattern)
-{
-    zval *zpattern, **ppzval;
-    HashTable *pattern_hash = NULL;
-    zval *zobj = getThis();
-    int index = 0, numelements = 0;
-    php_symbol_object *php_symbol;
 
-    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
-    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a",
-                              &zpattern) == FAILURE) {
-        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
-        return;
-    }
-    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
-    
-    php_symbol = (php_symbol_object *) zend_object_store_get_object(zobj TSRMLS_CC);
-    pattern_hash = Z_ARRVAL_P(zpattern);
 
-    numelements = zend_hash_num_elements(pattern_hash);
-    if (numelements == 0)
-    {
-        mapscript_report_php_error(E_WARNING, 
-                                   "symbol->setpoints : invalid array of %d element(s) as parameter." TSRMLS_CC, numelements);
-        RETURN_LONG(MS_FAILURE);
-    }
-
-    for(zend_hash_internal_pointer_reset(pattern_hash); 
-        zend_hash_has_more_elements(pattern_hash) == SUCCESS; 
-        zend_hash_move_forward(pattern_hash))
-    { 
-        
-        zend_hash_get_current_data(pattern_hash, (void **)&ppzval);
-        if (Z_TYPE_PP(ppzval) != IS_LONG)
-            convert_to_long(*ppzval);
-	     
-        php_symbol->symbol->pattern[index] = Z_LVAL_PP(ppzval);
-        index++;
-    }
-
-    php_symbol->symbol->patternlength = numelements;
-
-    RETURN_LONG(MS_SUCCESS);
-}
-/* }}} */
-
-/* {{{ proto int symbol.getPatternArray()
-   Returns an array containing the pattern.*/
-PHP_METHOD(symbolObj, getPatternArray)
-{
-    zval *zobj = getThis();
-    php_symbol_object *php_symbol;
-    int index;
-
-    PHP_MAPSCRIPT_ERROR_HANDLING(TRUE);
-    if (zend_parse_parameters_none() == FAILURE) {
-        PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
-        return;
-    }
-    PHP_MAPSCRIPT_RESTORE_ERRORS(TRUE);
-    
-    php_symbol = (php_symbol_object *) zend_object_store_get_object(zobj TSRMLS_CC);
-    
-    array_init(return_value);
-    
-    if (php_symbol->symbol->patternlength > 0)
-    {
-        for (index=0; index < php_symbol->symbol->patternlength; index++)
-        {
-            add_next_index_long(return_value, php_symbol->symbol->pattern[index]);
-        }
-    }
-}
-/* }}} */
-
 /* {{{ proto int symbol.setimagepath(char *imagefile)
    loads a new symbol image  ) */ 
 PHP_METHOD(symbolObj, setImagePath)
@@ -385,8 +307,6 @@
     PHP_MALIAS(symbolObj, set, __set, NULL, ZEND_ACC_PUBLIC)
     PHP_ME(symbolObj, setPoints, symbol_setPoints_args, ZEND_ACC_PUBLIC)
     PHP_ME(symbolObj, getPointsArray, NULL, ZEND_ACC_PUBLIC)
-    PHP_ME(symbolObj, setPattern, symbol_setPattern_args, ZEND_ACC_PUBLIC)
-    PHP_ME(symbolObj, getPatternArray, NULL, ZEND_ACC_PUBLIC)
     PHP_ME(symbolObj, setImagePath, symbol_setImagePath_args, ZEND_ACC_PUBLIC)
     {NULL, NULL, NULL}
 };

Modified: trunk/mapserver/mapscript/swiginc/symbol.i
===================================================================
--- trunk/mapserver/mapscript/swiginc/symbol.i	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapscript/swiginc/symbol.i	2011-04-06 02:48:18 UTC (rev 11472)
@@ -88,17 +88,8 @@
         line->numpoints = self->numpoints;
         return line;
     }
+    
 
-    int setPattern(int index, int value) 
-    {
-        if (index < 0 || index > MS_MAXPATTERNLENGTH) {
-            msSetError(MS_SYMERR, "Can't set pattern at index %d.", "setPattern()", index);
-            return MS_FAILURE;
-        }
-        self->pattern[index] = value;
-        return MS_SUCCESS;
-    }
-
     %newobject getImage;
     imageObj *getImage(outputFormatObj *input_format)
     {

Modified: trunk/mapserver/mapsymbol.c
===================================================================
--- trunk/mapserver/mapsymbol.c	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapsymbol.c	2011-04-06 02:48:18 UTC (rev 11472)
@@ -104,7 +104,6 @@
   s->type = MS_SYMBOL_VECTOR;
   s->transparent = MS_FALSE;
   s->transparentcolor = 0;
-  s->patternlength = 0; /* solid line */
   s->sizex = 1;
   s->sizey = 1;
   s->filled = MS_FALSE;
@@ -114,19 +113,13 @@
   s->pixmap_buffer=NULL;
   s->imagepath = NULL;
   s->name = NULL;
-  s->gap = 0;
   s->inmapfile = MS_FALSE;
   s->antialias = MS_FALSE;
   s->font = NULL;
   s->full_font_path = NULL;
   s->full_pixmap_path = NULL;
   s->character = NULL;
-  s->position = MS_CC;
 
-  s->linecap = MS_CJC_BUTT;
-  s->linejoin = MS_CJC_NONE;
-  s->linejoinmaxsize = 3;
-  
   s->svg_text = NULL;
 }
 
@@ -199,15 +192,6 @@
     case(FONT):
       if(getString(&s->font) == MS_FAILURE) return(-1);
       break;  
-    case(GAP):
-      if((getInteger(&s->gap)) == -1) return(-1);
-      break;
-    case(POSITION):
-      /* if((s->position = getSymbol(3, MS_UC,MS_CC,MS_LC)) == -1)  */
-      /* return(-1); */
-      if((s->position = getSymbol(9, MS_UL,MS_UC,MS_UR,MS_CL,MS_CC,MS_CR,MS_LL,MS_LC,MS_LR)) == -1) 
-	return(-1);
-      break;
     case(IMAGE):
       if(msyylex() != MS_STRING) { /* get image location from next token */
 	msSetError(MS_TYPEERR, "Parsing error near (%s):(line %d)", "loadSymbol()", msyystring_buffer, msyylineno);
@@ -240,49 +224,9 @@
 	    break;
       }
       break;
-    case(LINECAP):
-      if((s->linecap = getSymbol(4,MS_CJC_BUTT, MS_CJC_ROUND, MS_CJC_SQUARE, MS_CJC_TRIANGLE)) == -1)
-        return(-1);
-      break;
-    case(LINEJOIN):
-      if((s->linejoin = getSymbol(4,MS_CJC_NONE, MS_CJC_ROUND, MS_CJC_MITER, MS_CJC_BEVEL)) == -1)
-        return(-1);
-      break;
-    case(LINEJOINMAXSIZE):
-      if((getDouble(&s->linejoinmaxsize)) == -1) return(-1);
-      break;
     case(NAME):
       if(getString(&s->name) == MS_FAILURE) return(-1);
       break;
-    case(STYLE): /* depricated */
-      /* TODO: output warning */
-    case(PATTERN):
-      done = MS_FALSE;
-      for(;;) { /* read till the next END */
-	switch(msyylex()) {  
-	case(END):
-	  if(s->patternlength < 2) {
-	    msSetError(MS_SYMERR, "Not enough pattern elements. A minimum of 2 are required", "loadSymbol()");
-	    return(-1);
-	  }	  
-	  done = MS_TRUE;
-	  break;
-	case(MS_NUMBER): /* read the pattern values */
-	  if(s->patternlength == MS_MAXPATTERNLENGTH) {
-	    msSetError(MS_SYMERR, "Pattern too long.", "loadSymbol()");
-	    return(-1);
-	  }
-	  s->pattern[s->patternlength] = atoi(msyystring_buffer);
-	  s->patternlength++;
-	  break;
-	default:
-	  msSetError(MS_TYPEERR, "Parsing error near (%s):(line %d)", "loadSymbol()", msyystring_buffer, msyylineno);
-	  return(-1);
-	}
-	if(done == MS_TRUE)
-	  break;
-      }      
-      break;
     case(POINTS):
       done = MS_FALSE;
       s->sizex = 0;
@@ -348,24 +292,14 @@
   case(MS_SYMBOL_PIXMAP):
     fprintf(stream, "    TYPE PIXMAP\n");
     if(s->imagepath != NULL) fprintf(stream, "    IMAGE \"%s\"\n", s->imagepath);
-    if (s->gap != 0)
-      fprintf(stream, "    GAP %d\n", s->gap);
     fprintf(stream, "    TRANSPARENT %d\n", s->transparentcolor);
     break;
   case(MS_SYMBOL_TRUETYPE):
     fprintf(stream, "    TYPE TRUETYPE\n");
     if(s->antialias == MS_TRUE) fprintf(stream, "    ANTIALIAS TRUE\n");
     if (s->character != NULL) fprintf(stream, "    CHARACTER \"%s\"\n", s->character);
-    fprintf(stream, "    GAP %d\n", s->gap);
     if (s->font != NULL) fprintf(stream, "    FONT \"%s\"\n", s->font);
-    fprintf(stream, "    POSITION %s\n", msPositionsText[s->position - MS_UL]);
     break;
-  case(MS_SYMBOL_CARTOLINE):
-    fprintf(stream, "    TYPE CARTOLINE\n");
-    fprintf(stream, "    LINECAP %s\n", msCapsJoinsCorners[s->linecap]);
-    fprintf(stream, "    LINEJOIN %s\n", msCapsJoinsCorners[s->linejoin]);
-    fprintf(stream, "    LINEJOINMAXSIZE %g\n", s->linejoinmaxsize);
-    break;
   default:
     if(s->type == MS_SYMBOL_ELLIPSE)
       fprintf(stream, "    TYPE ELLIPSE\n");
@@ -384,15 +318,6 @@
       }
       fprintf(stream, "    END\n");
     }
-
-    /* PATTERN */
-    if(s->patternlength != 0) {
-      fprintf(stream, "    PATTERN\n     ");
-      for(i=0; i<s->patternlength; i++) {
-	fprintf(stream, " %d", s->pattern[i]);
-      }
-      fprintf(stream, "\n    END\n");
-    }
     break;
   }
       
@@ -894,23 +819,13 @@
   
   MS_COPYSTELEM(numpoints);
   MS_COPYSTELEM(filled);
-  MS_COPYSTELEM(patternlength);
 
-  for (i=0; i < src->patternlength; i++) {
-    dst->pattern[i] = src->pattern[i];
-  }
-
   MS_COPYSTRING(dst->imagepath, src->imagepath);
   MS_COPYSTELEM(transparent);
   MS_COPYSTELEM(transparentcolor);
   MS_COPYSTRING(dst->character, src->character);
   MS_COPYSTELEM(antialias);
   MS_COPYSTRING(dst->font, src->font);
-  MS_COPYSTELEM(gap);
-  MS_COPYSTELEM(position);
-  MS_COPYSTELEM(linecap);
-  MS_COPYSTELEM(linejoin);
-  MS_COPYSTELEM(linejoinmaxsize);
   MS_COPYSTRING(dst->full_pixmap_path,src->full_pixmap_path);
 
   return(MS_SUCCESS);

Modified: trunk/mapserver/mapsymbol.h
===================================================================
--- trunk/mapserver/mapsymbol.h	2011-04-06 02:35:02 UTC (rev 11471)
+++ trunk/mapserver/mapsymbol.h	2011-04-06 02:48:18 UTC (rev 11472)
@@ -177,11 +177,6 @@
 #endif /* SWIG */
   int filled;
   
-  
-  /*deprecated, moved to styleObj*/
-  int patternlength;                      /* Number of intervals (eg. dashes) in the pattern (was style, see bug 2119) */
-  int pattern[MS_MAXPATTERNLENGTH];
-
   /*
   ** MS_SYMBOL_PIXMAP options
   */
@@ -210,15 +205,7 @@
   char *character;
   int antialias;
   char *font;
-  int gap; /*deprecated, moved to styleObj*/
-  int position; /*deprecated, moved to styleObj*/
 
-  /*
-  ** MS_SYMBOL_CARTOLINE options
-  */
-  int linecap, linejoin; /*deprecated, moved to styleObj*/
-  double linejoinmaxsize;/*deprecated, moved to styleObj*/
-
   char* svg_text;
 
 } symbolObj;



More information about the mapserver-commits mailing list