[geotk] Re: Get envelope for a scale

theuns theunsheydenrych at gmail.com
Mon Sep 7 09:54:34 EDT 2009


Thanks for all the help Martin

On Mon, 2009-09-07 at 15:36 +0200, Martin Desruisseaux wrote:
> Theuns Heydenrych a écrit :
> > AffineTransform objectiveToDisplay = (AffineTransform) 
> > mapWidget.getCanvas().getObjectiveToDisplayTransform();
> > //Amount of inches in one meter
> > double inchesInOneMeter = 39.3700787
> > //physical size of pixel on screen
> > double pixelPhysicalSize = (1/72.0) ;
> > //physical size of screen pixel in meter
> > double physicalSizeInMeter = pixelPhysicalSize / inchesInOneMeter;
> > //The current scale of the projected map
> > double currentScale = XAffineTransform.getScale(objectiveToDisplay);
> > //The size of one pixel on the map in meter
> > double onePixelInMeter = 1/currentScale ;
> > //The map scale
> > double MapScale = onePixelInMeter / physicalSizeInMeter ;
> > 
> > Result is then 1:MapScale
> 
> Yes I think it is about that. Sometime I do error by putting a division instead 
> than a multiplication or vis-versa, but I think you will spot such mistake from 
> the numerical values. At least all the required steps are as above (as far as I 
> known).
> 
> 	Martin
> 



More information about the Geotoolkit mailing list