[Mapserver-users] Controlling PDF file size?

Stephen Woodbridge woodbri at swoodbridge.com
Fri May 14 08:25:44 EDT 2004


Antti,

I didn't implement any of this code, but since mapserver does not really 
have arc's and all the data is just draw from simple vectors my guess is 
that there is no thinning of vectors because this would be extremely 
time consuming to do. If you have 3 point making up a 2 lines, how do 
you decide where to draw the middle point or not? Yes you could look at 
the angle between them but is you had 100's of points forming a polyline 
how do you then determine which points to remove and which to retain.

This is a doable problem and I have code that I wrote for reducing the 
point density of shapefiles based on removing points that have minimal 
effect on shape, but it is a complicated algorithm and you have to have 
all the points before you start drawing.

In mapserver you get vectors and draw them. In the output format handler 
that writes the PDF I think you only get the clipped vector fragments 
and you don't the whole polyline so you can reduce it easily without 
reconstructing the polyline. Doing this would slow down map generation, 
but that might be ok doe some applications that are not interactive.

I think this would be a good thing to do and you should probably write a 
bug on it so the idea does not get lost.

-Steve W.

Antti.Roppola at brs.gov.au wrote:

> Hi all,
> 
> I am generating PDF maps and am not having much luck in controlling
> the output data density. I have tried manipulating the "SIZE" parameter
> in the map file and the "imgsize" argument when calling mapserver, while
> the page dimensions change, the output file sizes do not differ appreciably.
> 
> Examination of produced files shows that altering SIZE and IMGSIZE have
> no apparent effect on the number of vertices contained in the PDF map.
> 
> (having 1,000's of vertices in a page inch of line is just silly)
> 
> Is it possible to control the point density of arcs when generating PDF?
> I'd kind of assumed that SIZE would have a similar effect on vertex
> discards as it does in the raster renderer.
> 
> Thanks,
> 
> Antti
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 




More information about the mapserver-users mailing list