Permalink
Browse files

Added Simplify,SimplityPT and Generalize geomtransform

  • Loading branch information...
1 parent 9bbbfda commit c5a2921ecefc7c63dad0ea05ae7a9d17980ff7f9 Alan Boudreault committed Feb 1, 2013
Showing with 2,828 additions and 2,381 deletions.
  1. +10 −3 mapgeomtransform.c
  2. +3 −0 maplayer.c
  3. +1,870 −1,819 maplexer.c
  4. +7 −0 maplexer.l
  5. +797 −527 mapparser.c
  6. +37 −27 mapparser.h
  7. +38 −1 mapparser.y
  8. +8 −4 mapserver.h
  9. +58 −0 maputil.c
View
@@ -177,17 +177,24 @@ int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image
p.expr = &(style->_geomtransform);
p.expr->curtoken = p.expr->tokens; /* reset */
p.type = MS_PARSE_TYPE_SHAPE;
+ p.dblval = map->cellsize/MS_MAX(image->width, image->height);
status = yyparse(&p);
if (status != 0) {
msSetError(MS_PARSEERR, "Failed to process shape expression: %s", "msDrawTransformedShape", style->_geomtransform.string);
return MS_FAILURE;
}
-
tmpshp = p.result.shpval;
- /* TODO: check resulting shape type and draw accordingly */
- msDrawShadeSymbol(symbolset, image, tmpshp, style, scalefactor);
+ switch (tmpshp->type) {
+ case MS_SHAPE_POINT:
+ case MS_SHAPE_POLYGON:
+ msDrawShadeSymbol(symbolset, image, tmpshp, style, scalefactor);
+ break;
+ case MS_SHAPE_LINE:
+ msDrawLineSymbol(symbolset, image, tmpshp, style, scalefactor);
+ break;
+ }
msFreeShape(tmpshp);
msFree(tmpshp);
View
@@ -510,6 +510,9 @@ int msTokenizeExpression(expressionObj *expression, char **list, int *listsize)
case MS_TOKEN_BINDING_SHAPE:
node->token = token;
break;
+ case MS_TOKEN_BINDING_MAP_CELLSIZE:
+ node->token = token;
+ break;
case MS_TOKEN_FUNCTION_FROMTEXT: /* we want to process a shape from WKT once and not for every feature being evaluated */
if((token = msyylex()) != 40) { /* ( */
msSetError(MS_PARSEERR, "Parsing fromText function failed.", "msTokenizeExpression()");
View
Oops, something went wrong.
View
@@ -185,6 +185,9 @@ char path[MS_MAXPATHLEN];
<EXPRESSION_STRING>buffer { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_BUFFER); }
<EXPRESSION_STRING>difference { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_DIFFERENCE); }
+<EXPRESSION_STRING>simplify { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_SIMPLIFY); }
+<EXPRESSION_STRING>simplifypt { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_SIMPLIFYPT); }
+<EXPRESSION_STRING>generalize { MS_LEXER_RETURN_TOKEN(MS_TOKEN_FUNCTION_GENERALIZE); }
<EXPRESSION_STRING>intersects { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_INTERSECTS); }
<EXPRESSION_STRING>disjoint { MS_LEXER_RETURN_TOKEN(MS_TOKEN_COMPARISON_DISJOINT); }
@@ -498,6 +501,10 @@ char path[MS_MAXPATHLEN];
/* attribute binding - shape (fixed value) */
return(MS_TOKEN_BINDING_SHAPE);
}
+<EXPRESSION_STRING>\[map_cellsize\] {
+ /* attribute binding - cellsize */
+ return(MS_TOKEN_BINDING_MAP_CELLSIZE);
+}
<EXPRESSION_STRING>\[[^\]]*\] {
/* attribute binding - numeric (no quotes) */
msyytext++;
Oops, something went wrong.

0 comments on commit c5a2921

Please sign in to comment.