In article <3r28t9$4bpe@enzu.unm.edu> rdhunt@unm.edu writes:
> I am having trouble drawing filled circles on a map in IDL 4.0.
...
Actually your problem quite simple. Assuming RSI hasn't yet
fixed their map_set routine, it simply doesn't draw things
ere it says they are--e.g., features are drawn at the wrong
coordinates.
I devised a junky solution, which served my own needs, bypassing
map_set altogether, and using a very simple projection.
------------------------CUT HERE---------------------------------
;----------------------------------------------------------- -----------------
; Routine to Draw a map.
;----------------------------------------------------------- -----------------
pro draw_map,latmin,latmax,lonmin,lonmax,title
;Draw a map. It will then be possible to
; plot over the map using
; PLOTS,LON,LAT,NOCLIP=0
; (LON and LAT are arrays in degrees).
;latmin,latmax=minimum,maximum latitude (>0=north)
;lonmin,lonmax=minimum,maximum longitude (>0=east)
;title=plot title
;By Mitchell Grunes.
;Simplified from userlib procedure map_set.pro,
; because I could not figure out a way to get
; map_set.pro to give a simple rectangular
; projection, and because it seemed to be drawing
; things in the wrong places.
latmin2=latmin
latmax2=latmax
lonmin2=lonmin
lonmax2=lonmax
;Adjust aspect, lat and lon boundaries so that
;the lat and lon scales will be the same at map
;center. Approximately valid for default postscript
;in landscape mode.
aspect=8.3125/6.125/cos((latmin+latmax)/2.*!pi/180)
if (lonmax-lonmin) lt (latmax-latmin)*(aspect*.98) then begin
d=(latmax-latmin)*aspect-(lonmax-lonmin)
lonmin2=lonmin2-d/2
lonmax2=lonmax2+d/2
endif else if (latmax-latmin) lt (lonmax-lonmin)/(aspect*.98) then begin
d=(lonmax-lonmin)/aspect-(latmax-latmin)
latmin2=latmin2-d/2
latmax2=latmax2+d/2
endif
xticks=fix(lonmax2-lonmin2)
yticks=fix(latmax2-latmin2)
if xticks lt 3 or xticks gt 15 or lonmin2 ne fix(lonmin2) $
or lonmax2 ne fix(lonmax2) then xticks=0
if yticks lt 3 or yticks gt 15 or latmin2 ne fix(latmin2) $
or latmax2 ne fix(latmax2) then yticks=0
plot,[lonmin2,lonmin2,lonmax2,lonmax2,lonmin2], $
[latmin2,latmax2,latmax2,latmin2,latmin2],xstyle=1,ystyle=1, title=title, $
ticklen=1,xticks=xticks,yticks=yticks
close,1
openr,1,FILEPATH('supmap.dat',subdir = "maps"),/xdr,/stream
fbyte = [ 0, 71612L, 165096L]
nsegs = [ 283, 325, 594 ]
ij=2 ;0=course resolution map,1=U.S. only,2=All
point_lun, 1, fbyte(ij)
for i=1,nsegs(ij) do begin
npts = 0L
maxlat=0. & minlat=0. & maxlon=0. & minlon=0.
readu,1,npts,maxlat,minlat,maxlon,minlon
npts = npts / 2 ;# of points
xy = fltarr(2,npts)
readu,1,xy
if (maxlat lt latmin2) or (minlat gt latmax2) then goto,skipit
if (maxlon lt lonmin2) or (minlon gt lonmax2) then BEGIN
if (lonmax2 gt 180 and maxlon + 360 ge lonmin2) then goto,goon
if ( lonmin2 lt -180 and minlon -360 le lonmax2) then goto,goon
goto, skipit
endif
goon:
lat = xy(0,*) & lon = xy(1,*)
plots, lon,lat,NOCLIP=0,color=3*!d.n_colors/9
empty
skipit:
endfor
end
|