So much for writing a client :P.  So since there doesn't seem to be a  
defacto standard between the other servers I suggest that we make our  
implementation as close to the spec as we can.  And Jody's suggestion  
about a blog isn't a bad one.  I don't expect that we can embarrass  
mapserver into fixing their scale calculation but we should at least  
try.

Jesse


On 30-Jan-07, at 6:19 AM, Andrea Aime wrote:

> Jesse Eichar ha scritto:
>> I've been using SLD 1.0 page 26 for the basis of my research.   
>> But  I'd like to look at map server as well since it is one of the  
>> big Web  Map Servers out there.  If their calculation fits into  
>> the spec it  would be nice to align with them as much as  
>> possible.  I personally  would like to see the scale be calculated  
>> based on the  specification.  As you know I am primarily a client  
>> developer and  having to special case for each server is a real pain.
>> With regard to projection deformations.  Lets see if mapserver  
>> does  that if not then I wouldn't worry about it either.  (at  
>> least if it  is more work).
>
> Oh, had a look at OpenLayers too, here the answer is:
>
> OpenLayers.INCHES_PER_UNIT = {
>     'inches': 1.0,
>     'ft': 12.0,
>     'mi': 63360.0,
>     'm': 39.3701,
>     'km': 39370.1,
>     'dd': 4374754
> };
> OpenLayers.INCHES_PER_UNIT["in"]= OpenLayers.INCHES_PER_UNIT.inches;
> OpenLayers.INCHES_PER_UNIT["degrees"] = OpenLayers.INCHES_PER_UNIT.dd;
> /** A sensible default
>  * @type int */
> OpenLayers.DOTS_PER_INCH = 72;
>
> OpenLayers.Util.getScaleFromResolution = function (resolution,  
> units) {
>
>     if (units == null) {
>         units = "degrees";
>     }
>
>     var scale = resolution * OpenLayers.INCHES_PER_UNIT[units] *
>                     OpenLayers.DOTS_PER_INCH;
>     return scale;
> };
>
> where resolution is, afaik, the image width / bounds width (but I'm  
> not sure).
>
> Cheers
> Andrea


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to