## geotools-gt2-users

 [Geotools-gt2-users] Question about scale From: Michael geotools - 2010-01-28 21:39:48 ```Hi, Question from geotools novice ) Could someone pls tell me meanings of the numbers on the JMapFrame status bar, after coords of the current mouse position (Min, Span)? "Min" - lower left coords of the displayed area? But why without "Max"? :) And what is "Span"? It's something like scale? In which units? If not, how i can calculate the scale of the displayed map? Thank you very much! -- View this message in context: http://n2.nabble.com/Question-about-scale-tp4476212p4476212.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ```
 [Geotools-gt2-users] [SPAM] Question about scale From: - 2010-01-28 20:05:51 ```Hi, Question from geotools novice ) Could someone pls tell me meanings of the numbers on the JMapFrame status bar, after coords of the current mouse position (Min, Span)? "Min" - lower left coords of the displayed area? But why without "Max"? :) And what is "Span"? It's something like scale? In which units? If not, how i can calculate the scale of the displayed map? Thank you very much! ```
 Re: [Geotools-gt2-users] Question about scale From: Michael Bedward - 2010-01-29 03:33:09 ```Hello, > Question from geotools novice ) Answer from someone who always feels like a novice... > "Min" - lower left coords of the displayed area? The min value of each ordinate - this will usually be the lower left corner but, depending on your CRS, is not guaranteed to be. > And what is "Span"? span = max ordinate - min ordinate ie. It's just the length of the displayed area along each axis. The term span is used in other places in the GeoTools API, for example: http://geotools.org/javadocs/org/geotools/geometry/jts/ReferencedEnvelope.html#getSpan(int) > If not, how i can calculate the scale of the displayed map? One way is: myMapFrame.getMapPane().getWorldToScreenTransform().getScaleX(); As an aside, I think the present display in the map frame status bar is pretty clunky. I'd be happy to get suggestions for how to improve it. Hope this helps. Michael ```
 Re: [Geotools-gt2-users] Question about scale From: Michael Bedward - 2010-02-02 00:53:22 ```Hello Michael, > Seems its works too, i get the "degree" symbol. This value depends on the shape file parameters? You probably have a .prj file associated with your shapefile. This is a text file that contains the details of the map projection that applies to your data. > But how i can translate degrees to meters? Could you please show me the right way? It depends on what you want to do and also on the extent of your map. For local or small regional areas you can reproject your data "on the fly" from lat-lon coordinates into a projection that uses metres (e.g. an appropriate UTM zone for your area). Have a look at this example... http://geotools.org/examples/crslab.html If you want to measure the distance, in metres, between two lat-lon positions the GeodeticCalculator class is your friend... http://geotools.org/javadocs/org/geotools/referencing/GeodeticCalculator.html Hope this helps, Michael ```