[OpenLayers-Users] Value of map.getExtent() is not precise?

Pedro Simonetti Garcia pedrosimonetti at gmail.com
Tue Apr 29 17:27:21 EDT 2008


Christopher,

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.

Driver: GTiff/GeoTIFF
Files: GV_2005.tif
Size is 18196, 28659
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["unnamed",
        DATUM["unknown",
            SPHEROID["unretrievable - using WGS84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT[,0.0174532925199433]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",-39],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",10000000],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","29184"]]
Origin = (340166.000000000000000,7785287.000000000000000)
Pixel Size = (2.000000000000000,-2.000000000000000)
Metadata:
  AREA_OR_POINT=Area
  TIFFTAG_SOFTWARE=IMAGINE TIFF Support
Copyright 1991 - 1999 by ERDAS, Inc. All Rights Reserved
@(#)$RCSfile: etif.c $ $Revision: 1.10.1.9.1.9.2.11 $ $Date: 2004/09/15 18:42:01
EDT $
  TIFFTAG_XRESOLUTION=1
  TIFFTAG_YRESOLUTION=1
  TIFFTAG_RESOLUTIONUNIT=1 (unitless)
Image Structure Metadata:
  INTERLEAVE=PIXEL
Corner Coordinates:
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,

Pedro Simonetti.

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.
>
>  Regards,
>  --
>  Christopher Schmidt
>  MetaCarta
>



More information about the Users mailing list