[OpenLayers-Users] Value of map.getExtent() is not precise?
Pedro Simonetti Garcia
pedrosimonetti at gmail.com
Tue Apr 29 17:27:21 EDT 2008
Thanks for your feedback.
So, are you saying that the value of map.getExtent() is supposed to be the
precise extent of the visible area of the map on the screen, isn't?
Another thing, I'm using a non-default projection, and I'm wondering if this
can somehow be related to a misconfiguration of projections in my files.
In fact I'm a little bit confused about the values should I use for
projection and maxResolution. Here's the gdalinfo of my tiff file.
Size is 18196, 28659
Coordinate System is:
SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
Origin = (340166.000000000000000,7785287.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
TIFFTAG_SOFTWARE=IMAGINE TIFF Support
Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: etif.c $ $Revision: 188.8.131.52.184.108.40.206 $ $Date: 2004/09/15 18:42:01
Image Structure Metadata:
Upper Left ( 340166.000, 7785287.000) ( 40d31'40.99"W, 20d 1'21.39"S)
Lower Left ( 340166.000, 7727969.000) ( 40d31'59.28"W, 20d32'25.33"S)
Upper Right ( 376558.000, 7785287.000) ( 40d10'48.72"W, 20d 1'30.97"S)
Lower Right ( 376558.000, 7727969.000) ( 40d11'2.85"W, 20d32'35.18"S)
Center ( 358362.000, 7756628.000) ( 40d21'22.92"W, 20d16'58.55"S)
Band 1 Block=18196x1 Type=Byte, ColorInterp=Red
Band 2 Block=18196x1 Type=Byte, ColorInterp=Green
Band 3 Block=18196x1 Type=Byte, ColorInterp=Blue
What exactly projection and maxResolution values should I use?
thanks in advance,
2008/4/29 Christopher Schmidt <crschmidt at metacarta.com>:
> On Tue, Apr 29, 2008 at 03:50:50PM -0300, Pedro Simonetti Garcia wrote:
> > Hi all,
> > I need a little help here. I'm developing a printing system, but I'm
> > getting some
> > problem with the extents.
> > I'm trying to print the map viewport, so I'm using the map.getExtent() and
> > map.getCurrentSize() values and passing it to the server, which calls the
> > mapserver and generates the image with the specified extent and size.
> > The problem is that the printed area is not exactly the same as showed at
> > the viewport. The output area is around 20% larger.
> > What I'm doing wrong? How can I precisely calculate the viewport extents?
> I can't think of any reason why this shouldn't work.
> Christopher Schmidt
More information about the Users