Skip to content

Commit

Permalink
Fixed a bug (see #5157) where converting points from pixel to image c…
Browse files Browse the repository at this point in the history
…oordinates with the shpxy tag was happening twice.
  • Loading branch information
sdlime committed Sep 1, 2015
1 parent 855fa17 commit 745f172
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions maptemplate.c
Expand Up @@ -1953,13 +1953,11 @@ static int processShpxyTag(layerObj *layer, char **line, shapeObj *shape)


double scale_x, scale_y; double scale_x, scale_y;



char *projectionString=NULL; char *projectionString=NULL;


shapeObj tShape; shapeObj tShape;
char *coords=NULL, point[128]; char *coords=NULL, point[128];



if(!*line) { if(!*line) {
msSetError(MS_WEBERR, "Invalid line pointer.", "processShpxyTag()"); msSetError(MS_WEBERR, "Invalid line pointer.", "processShpxyTag()");
return(MS_FAILURE); return(MS_FAILURE);
Expand Down Expand Up @@ -2061,7 +2059,6 @@ static int processShpxyTag(layerObj *layer, char **line, shapeObj *shape)
if(argValue) if(argValue)
if(strcasecmp(argValue,"true") == 0) centroid = MS_TRUE; if(strcasecmp(argValue,"true") == 0) centroid = MS_TRUE;



argValue = msLookupHashTable(tagArgs, "proj"); argValue = msLookupHashTable(tagArgs, "proj");
if(argValue) projectionString = argValue; if(argValue) projectionString = argValue;
} }
Expand Down Expand Up @@ -2123,9 +2120,7 @@ static int processShpxyTag(layerObj *layer, char **line, shapeObj *shape)


switch(tShape.type) { switch(tShape.type) {
case(MS_SHAPE_POINT): case(MS_SHAPE_POINT):
/* at this point we only convert the first point of the first shape */ /* no clipping necessary */
tShape.line[0].point[0].x = MS_MAP2IMAGE_X(tShape.line[0].point[0].x, layer->map->extent.minx, layer->map->cellsize);
tShape.line[0].point[0].y = MS_MAP2IMAGE_Y(tShape.line[0].point[0].y, layer->map->extent.maxy, layer->map->cellsize);
break; break;
case(MS_SHAPE_LINE): case(MS_SHAPE_LINE):
msClipPolylineRect(&tShape, layer->map->extent); msClipPolylineRect(&tShape, layer->map->extent);
Expand Down

0 comments on commit 745f172

Please sign in to comment.