Re: BaseMapAdapter set Lon and Lat range error ?

  • To: "劉育帆" <monica@xxxxxxxxxx>
  • Subject: Re: BaseMapAdapter set Lon and Lat range error ?
  • From: "Tom Whittaker" <tomw@xxxxxxxxxxxxx>
  • Date: Wed, 19 Apr 2006 11:12:53 -0500
Monica:

Sorry I did not get your previous email -- I suspect it was put into
my "junk" email because the return address had "???" in it.

I cannot view your images with the links in your email.  Please ftp them to:
ftp.ssec.wisc.edu and put them into the "pub/incoming" directory and
let me know the filenames (they will only stay there for 48 hours,
though).

Thanks.

tom

On 4/19/06, 劉育帆 <monica@xxxxxxxxxx> wrote:
>
> Dear all :
>         Before I mail the lat and lon range question, but no one answer
> me...
>         so I decide to describe clear...
>
>         The OUTLSUPW file is earth map, and I just use the piece of it to
> match my data.(my data range : -110 ~ 57.5 and -32.5 ~ 55.0)
>         so, the lon : 0 ~ 360 --> lon : -110.0 ~ 57.5
>               the lat : -90 ~ 90 --> lat : -32.5 ~ 55.0
>
>         way 1 : use Display.SelectRange
>             ScalarMap lonRangeMap = new ScalarMap(RealType.Longitude,
> Display.SelectRange);
>             display.addMap(lonRangeMap);
>             RangeControl lonRangeControl = (RangeControl)
> lonRangeMap.getControl();
>             ScalarMap latRangeMap = new
> ScalarMap(RealType.Latitude,Display.SelectRange);
>             display.addMap(latRangeMap);
>             RangeControl latRangeControl = (RangeControl)
> latRangeMap.getControl();
>
>             //Longitude has two coordinate : -180 ~ 180 or 0 ~ 360
>             if (lonRange[0] < -180 || lonRange[0] > 180 || lonRange[1] <
> -180 || lonRange[1] > 180)
>                 lonRangeControl.setRange(new double[]{lonRange[0] - 0 +
> (-180), lonRange[1] - 0 + (-180)});
>             else
>                 lonRangeControl.setRange(lonRange);
>
>             latRangeControl.setRange(latRange);
>
>         I use it can get perfect ficture.(my data range : -110 ~ 57.5 and
> -32.5 ~ 55.0)
>         But I set lonRangeControl and latRangeControl, my data range also
> change.(my data range : 0 ~ 360 and -90 ~ 90)
>         ex4.jpeg :
> http://f3.yahoofs.com/users/41b28e05z853f2932/da07/__sr_/304a.jpg?phYtKREBHU9E2Q1X
>
>
>         way2 : use BaseMapAdapter.setLatLonLimits()
>             baseMapAdapter.setLatLonLimits((float)latRange[0],
> (float)latRange[1], (float)lonRange[0], (float)lonRange[1]);
>
>         (my data range : -110 ~ 57.5 and -32.5 ~ 55.0) and (my data range :
> 0 ~ 360 and -90 ~ 90) lon and data range is correct.
>         But lat Max and lat min will out off the range.
>         ex2.jpeg :
> http://f3.yahoofs.com/users/41b28e05z853f2932/da07/__sr_/e2c9.jpg?phgHHPEBW0MbFGZY
>
>         Is the visad error ? Or I follow error steps?
>         Is there any another better resolve way?
>
>         Thanks a lot...
>
>
>                                                        By Monica
>
> Hello~
>
> I use those code which about visad, and open file "OUTLSUPW" (Earth map)
> But I just get a little zone.(lonRange -110.0 --> 57.5  latRange -32.5 -->
> 55.0)
>
> BaseMapAdapter baseMapAdapter = new BaseMapAdapter(new
> URL("http://iiiserver:81/monica/data/OUTLSUPW";));
>
> double lonRange[] = {-110.0, 57.5};
> double latRange[] = {-32.5, 55.0};
> DataReference maplinesRef = new DataReferenceImpl("MapLines");
> maplinesRef.setData(baseMapAdapter.getData());
>
> And I get ex1.jpeg :
> ex1.jpeg :
> http://f3.yahoofs.com/users/41b28e05z853f2932/da07/__sr_/3cb4.jpg?phw_gPEBpDc1s20.
>
> I read the visad.doc and add this code ...
>
>
> double lonRange[] = {-110.0, 57.5};
> double latRange[] = {-32.5, 55.0};
> DataReference maplinesRef = new DataReferenceImpl("MapLines");
>
> baseMapAdapter.setLatLonLimits((float)latRange[0], (float)latRange[1],
> (float)lonRange[0], (float)lonRange[1]); // add Limit
> maplinesRef.setData(baseMapAdapter.getData());
>
> And I get ex2.jpeg
> ex2.jpeg :
> http://f3.yahoofs.com/users/41b28e05z853f2932/da07/__sr_/e2c9.jpg?phgHHPEBW0MbFGZY
>
> But ex2.jpeg is not I want, I want the consequence like ex3.jpeg :
> ex3.jpeg :
> http://f3.yahoofs.com/users/41b28e05z853f2932/da07/__sr_/5932.jpg?phgHHPEBdfUncWul
>
> I have thought use RangeControl ...
>
> ScalarMap lonRangeMap = new
> ScalarMap(RealType.Longitude,Display.SelectRange);
> display.addMap(lonRangeMap);
> RangeControl lonRangeControl = (RangeControl) lonRangeMap.getControl();
> latRangeMap = new ScalarMap(RealType.Latitude,Display.SelectRange);
> display.addMap(latRangeMap);
> RangeControl latRangeControl = (RangeControl) latRangeMap.getControl();
> lonRangeControl.setRange ( lonRange);
> latRangeControl.setRange ( latRange);
>
> in this case I can get the consequence like ex3.jpeg, but when I get
> (lonRange > 180 or lonRange < -180),
> the view of OUTLSUPW will not show lonRange > 180 or lonRange < -180 and
> the range not symmetry....
>
> Could you tell me how to solve this problem? or give me a direction to find
> answer...
> (I use visad_src-2.0.jar)
>
> Thank you very much~ :)
>
>                                                By monica


--
Tom Whittaker
University of Wisconsin-Madison
SSEC/CIMSS
1225 W. Dayton Street
Madison, WI  53706  USA
ph: 608-262-2759

==============================================================================
To unsubscribe visad, visit:
http://www.unidata.ucar.edu/mailing-list-delete-form.html
==============================================================================