Zooming to match a raster scale
Nick Dabner
dabner at OPTUSNET.COM.AU
Sun Apr 24 16:16:54 PDT 2005
Got it. - Thanks Bart. My extents were wrong as IMGEXT do not match the
gdalinfo info fo upper-left, lower-right style when applied to
Australia. Seems I have to switch the latitude.
Ok, so just to finish up this thread, found a solution by taking a
point using Mapxy and then applying a scale or buffer. The rasters I am
using have a pixel size of (1.26956817,-1.26956817) and a unit of
0.0174532925199433. By matching the scale as returned in the
template/html file, as close as possible to this pixel size shown by
gdalinfo, the maps start looking pretty good as they have little or no
scaling.
First question: With a given pixel size and unit (metres) above, what
is the formula to work out the scale to input? In the example above, I
found a value of .31267 would give me a matching output scale to pixel
size to 4 decimal places.
Second question: Loading the TIF file up in Apple Preview, it looks
jagged for a moment, until it anti-aliases the file. Once anti-aliased,
the legibility improves noticeably. I take it mapserver cannot perform
any anti-aliasing when scaling rasters. I suspect even nearest
neighbour would be a great improvement. Any plans for this? I guess it
would require JPEG or PNG24 to provide enough colours. Is it possible
for a browser or client app to do this work?
regards,
Nick
On 25/04/2005, at 7:45 AM, Nick Dabner wrote:
> Thanks Bart,
>
> So I take it that scale and mapxy are mutually exclusive with mapext?
> Removing mapext always results in the error:
>
> msDrawMap(): Image handling error. Unable to initialize image.
> msCalculateScale(): General error message. Invalid image extent,
> minx=-1.000000, miny=-1.000000, maxx=-1.000000, maxy=-1.000000
>
> Any idea what I am doing wrong? Also I found out my scale is current
> 3.15 on the output map and needs to be 2.59, hence the poor output.
> Would a resolution tag in the mapfile help?
>
> ND
>
> On 24/04/2005, at 10:45 PM, Bart van den Eijnden wrote:
>
>> Hi Nick,
>>
>> you can probably use a combination of mapxy and scale.
>>
>> See Mapserver CGI reference:
>> http://mapserver.gis.umn.edu/doc44/cgi-reference.html
>>
>> Best regards,
>> Bart
>>
>> On Sun, 24 Apr 2005 22:38:34 +1000, Nick Dabner
>> <dabner at OPTUSNET.COM.AU>
>> wrote:
>>
>>> Hello list,
>>>
>>> I have a set of raster geotiffs tiled and working on mapserver 4.2 on
>>> osx (thanks to william k).
>>>
>>> When viewing the rasters in mapserver, I find they suffer from some
>>> slight scaling and never look anywhere near as good as the original
>>> files. I have given dithering and PNG24 a go, but see that I probably
>>> need to match my mapserver session's scale as close as possible to
>>> the
>>> source data scale. Does this sound right?
>>>
>>> Using CGI mapserver, how can I specify an exact viewing area (to
>>> match
>>> my calculations)? What argument would I choose.
>>>
>>> Attemping to pass IMGEXT=2482199.076569 4407814.492404
>>> 2484230.3854232
>>> 4406291.0107634 just returns an extent error. Oh, I am in Melb Aust,
>>> so
>>> these are real coords.
>>>
>>> Any other ideas? The next step would probably be fixed zoom levels
>>> for
>>> street, area, suburb, municipality and city or similar, with
>>> preprocessed rasters for each level.
>>>
>>> regards,
>>>
>>> Nick
>>>
>>
>>
>>
>> --
>> Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 3343 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050425/980e6c4b/attachment.bin>
More information about the MapServer-users
mailing list