Permalink
Browse files

Some modif to geomtransformshape

  • Loading branch information...
1 parent 5c2bd2e commit b3746cf76bef9de3596c6d214ec82bb62a4b818d Alan Boudreault committed Feb 12, 2013
Showing with 6 additions and 6 deletions.
  1. +1 −1 mapdraw.c
  2. +4 −4 mapgeomtransform.c
  3. +1 −1 mapserver.h
View
@@ -1047,7 +1047,7 @@ int msDrawVectorLayer(mapObj *map, layerObj *layer, imageObj *image)
/* Apply GeomTransform */
if(layer->_geomtransform.type != MS_GEOMTRANSFORM_NONE) {
- msGeomTransformShape(&shape, &layer->_geomtransform);
+ msGeomTransformShape(map, layer, &shape);
}
if (cache) {
View
@@ -177,7 +177,6 @@ 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) {
@@ -215,10 +214,11 @@ int msDrawTransformedShape(mapObj *map, symbolSetObj *symbolset, imageObj *image
* - transform directly the shapeobj
* - Only shape depression supported for layers
*/
-int msGeomTransformShape(shapeObj *shape, expressionObj *e)
+int msGeomTransformShape(mapObj *map, layerObj *layer, shapeObj *shape)
{
int i;
-
+ expressionObj *e = &layer->_geomtransform;
+
switch(e->type) {
case MS_GEOMTRANSFORM_EXPRESSION: {
int status;
@@ -229,7 +229,7 @@ int msGeomTransformShape(shapeObj *shape, expressionObj *e)
p.expr = e;
p.expr->curtoken = p.expr->tokens; /* reset */
p.type = MS_PARSE_TYPE_SHAPE;
- //p.dblval = map->cellsize/MS_MAX(image->width, image->height);
+ p.dblval = map->cellsize * (msInchesPerUnit(map->units,0)/msInchesPerUnit(layer->units,0));
status = yyparse(&p);
if (status != 0) {
View
@@ -2663,7 +2663,7 @@ extern "C" {
MS_DLL_EXPORT void msSetGeomTransform(expressionObj *e, char *transform);
MS_DLL_EXPORT char *msStyleGetGeomTransform(styleObj *style);
- MS_DLL_EXPORT int msGeomTransformShape(shapeObj *shape, expressionObj *e);
+ MS_DLL_EXPORT int msGeomTransformShape(mapObj *map, layerObj *layer, shapeObj *shape);
/* ==================================================================== */
/* end of prototypes for functions in mapgeomtransform.c */

0 comments on commit b3746cf

Please sign in to comment.