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, for completeness, I checked the DeeGree algorithm too... the
comment says it applies what suggested by the SLD spec 1.0, but
if you really look at it, it's not really true in the lat/lon case,
where the scale is computed using the real world size of a small
segment in the center of the map (where real world distance is
the great circle distance assuming a spherical earth).
Using the real world distance means again computing a scale that
changes as you pan over the earth surface.
The SLD specification is this case tells us to use another formula
from what I can see, that is:

standardLonWidth = lonWidth * r * 2 * PI / 360
scale = standardLonWith / imageWidthPixels / 0.00028

where lonWidth is the width of the display area, no matter where is
it positioned (that's what I can see from the SLD spec at least,
02-070_Styled_Layer_Descriptor_Implementation_Specification.pdf, page 29).

For completeness, the MapBuilder algorithm seems to be the only
one applying the SLD suggestion by the letter. The algorithm is
in Extent.js:

var Rearth=6378137.0;var degToMeter=Rearth*2*Math.PI/360;
var mbScaleFactor=3571.428
var minScale=1000;
var maxScale=200000;
var pixRes=null;
...
this.getScale=function(){
var pixRes=null;
switch(this.model.getSRS()){
case "EPSG:4326":case "EPSG:4269":
pixRes=this.res[0]*degToMeter;
break;
default:pixRes=this.res[0];
break;
}

where res[0] is boundsWidth/imageWidth.

Holy cow....
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