Steve (and others), Several months ago one of our engineers had a few spare cycles, so I posed a question: 'Can mapserver be used to generate large-format ( >, 8 inches wide) maps to a plotter?' We selected PDF as the output format (I can't recall why, but it may be because of the vector rendering symbology issues mentioned). Here's part of his results: ========================== The purpose of investigating mapserver was to determine if it could be used for creating automated maps at specific scales for plotting to paper. Given raster and vector data, mapserver can create an output map (jpeg, tiff, pdf). Given that pdf files can store both vector and raster data, it was determined that we would use pdf files as our format of choice. The current version of mapserver (4.6.0) does not support raster images of more than 256 colours. Some modifications were made to mapserver to create 24 bit colour images in PDF. (Note: These changes were not submitted back to the public version of mapserver) Creating a pdf for printing: In order to create a map at a specified scale and paper size, some calculations are needed. The following are steps to calculate values for input to mapserver: 1.. Decide paper size we want to print. Ex. 12'x12' 2.. decide scale. Ex. 1:50000 3.. find out resolution of imagery ex. Landsat - 12.5m/pixel 4.. calculate coverage in metres that paper size and scale will equate to. Ex. 50000x(12'x2.54/100) = 15240 m (so coverage is 15240m x 15240 m) 5.. calculate # of pixels of image that is equivalent to coverage area. Ex. 15240m / 12.5m/pixel = 1219.2 pixels 6.. since we can't make an image that is not an integer # of pixels, we round up to 1220 x 1220 pixels. However, this means the coverage area needs to be increased by 0.8 pixels. i.e. 12.5m/pixel * 0.8 pixels = 10 m. so the coverage is now 15250 x 15250 m 7.. in the mapserver '.map' file, we specify the size of the image as 1220 x 1220 and set the extent xmin ymin xmax ymax (to cover the area of interest that is 15250 x 15250 metres) 8.. run mapserver 9.. Mapserver should produce a map that when printed onto a sheet of paper that is 12'x12' with no scaling, will be 1:50000 scale. The steps that have been described above should produce a map, when printed with no scaling, of 1:50,000. However, this is not the case. For some reason, mapserver creates a pdf file that when opened in Adobe acrobat reader shows that the map is 1.4 times the size of what our calculations have come out to be. i.e. acrobat says the map is ~ 16.8' x 16.8'. This has something to do with the pdf file being created at 72dpi. ========================== He had made a few other changes to our copy of mapserver to work-around the PDF scaling issue, but we were distracted by some paying work so we did not post the code back to the mapserver community. If someone (Steve L? Frank W?, anyone?) is interested in picking it up to review the changes (and make improvements to our hacks!), I'll gladly send them the modified 4.6.0 source.... Brent Fraser ----- Original Message ----- From: 'Stephen Woodbridge' <, >, Sent: Wednesday, January 25, 2006 2:22 PM Subject: Re: [UMN_MAPSERVER-USERS] Change image resolution in mapfile >, Source.

Яндекс.Метрика Рейтинг Free Web Counter
page counter
Last Modified: August 28, 2015 @ 12:00 am