determining aspect ratio and output map extents
bfraser at GEOANALYTIC.COM
Thu Oct 18 15:17:52 EDT 2007
You could ask mapserver (or shp2img) to generate GeoTIFFs
The GeoTIFFs would have georeferencing information in it,
and a utility such as gdalinfo (or the appropriate function
in the gdal library) would give the extents of the image.
Since mapserver was designed to serve maps on the web,
the image SIZE was considered to be the most important
factor (and the extents were adjusted to fit, along with a
potential small adjustment of the scale). It would be a
nice enhancement to shp2imge to accept a -SCALE option
(or -PIXELSIZE?) and have it automatically calculate the
image size required.
For now, you could calculate the size in your favorite
scripting langauge, and based on your desired extent and
scale, create a temporary mapfile for that output image. Or
use mapserv with the SIZE parameter set in the QUERY_STRING,
or use mapscript...
----- Original Message -----
From: "Nathan Vander Wilt"
<nathan.vanderwilt at ORIONNETWORKSOLUTIONS.COM>
To: <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Thursday, October 18, 2007 10:57 AM
Subject: [UMN_MAPSERVER-USERS] determining aspect ratio and
output map extents
> We are hoping to use MapServer to automate the
rasterization of a
> whole stack of layers. We previously did this using
> export, and although the process was fraught with peril,
> did allow us to export a world file giving the extent of
> images, which we rely on in a later part of our process.
> We've noted that the EXTENT set in the map file does not
> the output, because the output image extents also depend
> aspect ratio of the given SIZE.
> Do the MapServer tools provide any method to determine an
> aspect ratio for the SIZE so that the EXTENT set in the
map file will
> match the extent of the output image after rendering?
> And/or: Is there a way to query the coordinates of the
> from a .map file, either via shp2img, the CGI or some
More information about the mapserver-users