Ticket #1706 (closed defect: fixed)
cast to integer in image coordinates
| Reported by: | patrickmachado@… | Owned by: | assefa |
|---|---|---|---|
| Priority: | normal | Milestone: | 5.4 release |
| Component: | Output-SVG | Version: | 5.0 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
The output-svg module casts point coordinates to integers, when outputing
results in full resolution (and conversion to image coordinates).
This is a drawback because resolution is lost (e.g. when you want to zoom the
map later). Furthermore, the lines are poorly antialiased this way.
I looked into the code and it seems that the right way is already there, but
commented. Is there any reason for that?
Here follows the relevant code:
/* full resolution, pixel output */
if (bFullRes && !bUseGeoCoord)
{
if(shape->type == MS_SHAPE_LINE || shape->type == MS_SHAPE_POLYGON)
{
for(i=0; i<shape->numlines; i++)
{
for(j=0; j < shape->line[i].numpoints; j++ )
{
/*
shape->line[i].point[j].x =
(shape->line[i].point[j].x - extent.minx)/cellsize;
shape->line[i].point[j].y =
(extent.maxy - shape->line[i].point[j].y)/cellsize;
*/
shape->line[i].point[j].x =
MS_MAP2IMAGE_X(shape->line[i].point[j].x,
extent.minx,
cellsize);
shape->line[i].point[j].y = MS_MAP2IMAGE_Y(
shape->line[i].point[j].y,
extent.maxy,
cellsize);
}
}
return;
}
}
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

