[mapserver-users] Using Mapserver to generate higher resolution maps

Ed McNierney ed at topozone.com
Thu May 2 21:45:23 EDT 2002


David -

MapServer doesn't produce images "at screen resolution of 72 dpi".  It just produces images.  Those images can be displayed or printed, and the number of pixels in an inch on the screen or on the paper depends on the output resolution of *that device*, not MapServer.

Let's say you want to create a "72 dpi" map that's 1 mile by 1 mile at a scale of 1:24,000.  Since 1 mile is 63,360 inches, that scale will mean the map is 63,360 / 24,000 inches or 2.64 inches by 2.64 inches.  If you want there to be 72 pixels in each inch of the output image, then there will be 72 * 2.64 or 190 pixels in the width and height of the image.  You're asking MapServer to create a map that's 190 pixels by 190 pixels to cover 5,280 feet by 5,280 feet.  You do that by specifying the extents of the map area (in map space units) and the size of the output image in pixels.  The result is that each pixel will represent 5,280 / 190 feet or 27.79 feet.  Remember that - it's a useful measurement.

Now let's do the same exercise to create a "300 dpi" map.  Using the same numbers, you start with a 2.64 inch map that you now want to have 300 pixels per inch, so its 2.64 * 300 or 792 pixels on a side.  Nothing else changes.  You will ask MapServer to create a map that's 792 pixels by 792 pixels to cover 5,280 feet by 5,280 feet.  You specify the extents of the map again (one mile) and the size of the output image in pixels (792).  Notice that there's no "dpi" involved here.  You just ask for a greater number of pixels to be used to represent the same area on the ground.  The result is that each pixel will represent 5,280 / 792 feet or 6.667 feet per pixel.  This is a much better way of thinking about the "scale" of the map.  Whether you display that map on a low-resolution monitor or print it on a high-resolution page, it will always be 6.667 feet per pixel.  The number of pixels in an inch on the current output device will tell you how many feet per inch there are on the output device and therefore give you the scale ratio (1:24,000 or whatever).

	- Ed

Ed McNierney
Chief Mapmaker
TopoZone.com / Maps a la carte, Inc.
ed at topozone.com


-----Original Message-----
From: David Kriske [mailto:David_Kriske at Hilton.com]
Sent: Thursday, May 02, 2002 5:55 PM
To: 'mapserver-users at lists.gis.umn.edu'
Subject: [mapserver-users] Using Mapserver to generate higher resolution
maps







Hello,



I am using PHP Mapscript3.6 for PHP 4.1.2 to generate 8.5 x 11 PDF documents
that can then be printed on a high resolution color printer and included in
reports.  I notice that the mapserverengine produces images at screen resolution
of 72 dpi, but heard mention on the mailing list that this can be changed in the
code.  My questions are:



1), would printing a 300 dpi image rather than 72 dpi extend the rendering time
considerably,

2) wouldit be practical to add an argument to the map-draw() function in
mapscript(actually PHP mapscript) to specify output dpi

3) if not, would it be possible to load a separate mapscriptdllin my phppage for
rendering PDF?srather than viewing maps

4) wouldit be difficult for someone to compile a separate windows binary with
this functionality (mapserver3.6 for php4.1.2).  I am not very versed in
compiling stuff in MS Visual C.



Thank you for your input!



David



David L. Kriske

Database Analyst, G.I.S.

Hilton Hotels Corporation

310.205.4602

310.205.3289 (fax)

mailto:david_kriske at hilton.com








More information about the mapserver-users mailing list