3d displaying with x=longitude, y=latitude, z=altitude, but not yet working (T_T) [message #53754] |
Wed, 02 May 2007 05:57  |
kim20026
Messages: 54 Registered: November 2006
|
Member |
|
|
Good day, everyone. I would like to ask a question on 3d displaying.
I have this data file.
dat1.txt:
Sokcho 38.2500 128.5667 17.8
Cheorwon 38.1500 127.3000 154.2
Dongducheon 37.9000 127.0667 112.5
Daeguallyeong 37.6833 128.7667 842.5
Chuncheon 37.9000 127.7333 76.8
I read this file as follows.
readcol, 'dat1.txt', city, lat, lon, alt, format = 'A, 3F'
And then I am going to display these data into 3d.
x = lon,
y = lat,
z = alt
Based on the a procedure on www.dfanning.com, I tried this way below
but the results was not what I wanted to. Is there anyone to help
me?
Harry
------------------------------------------------------------ -----------------------
PRO SCATTER3D_altitude
; Read the data file.
readcol, 'dat1.txt', city, lat, lon, alt, format='A, 3F7.2'
n=n_elements(lat)
vsym, 24 , /fill
; Load a color table and create colors for the scatterplot.
LOADCT, 38, NCOLORS=!D.N_COLORS-1
TVLCT, 70, 70, 70, !D.N_COLORS-1
zcolors = BYTSCL(alt, TOP=!D.N_COLORS-2)
; Set the 3D coordinate space with axes.
SURFACE, DIST(5), /NODATA, /SAVE, XRANGE=[125,132], $
YRANGE=[33,39], ZRANGE=[0, 900], CHARSIZE=1.5, COLOR=!D.N_COLORS-2,
BACKGROUND=!D.N_COLORS-1, $
; Plot the random points in 3D space with a diamond shape.
PLOTS, lon, lat, alt, PSYM=4, COLOR=zcolors, /T3D
; Connect the data points to the XY plane of the plot.
FOR j=0, n-1 DO PLOTS, [lon(j), lon(j)], [lat(j), lat(j)], [0,
alt(j)], COLOR=zcolors(j), /T3D
END
|
|
|
Re: 3d displaying with x=longitude, y=latitude, z=altitude, but not yet working (T_T) [message #53811 is a reply to message #53754] |
Wed, 02 May 2007 15:17  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
DirtyHarry writes:
> David, What I want to do is to display altitude in 3d:
>
> x = lon
> y = lat
> z = alt
>
> and if it is possible, I want to present this on the Korean map...
>
> I found the scatter3D routine in your website, and tried to do this
> with it, but still not working. Please give me some suggestions.
Well, the code is "working" in the sense that it more or
less does what code like that is suppose to do: illustrate
a technique. You don't see the largest line, since it is
being drawn in the same color as the background color. :-(
What I would do is set up a 3D transformation, using something
like SCALE3D. Then use MAP_SET with the /T3D keyword set
to draw your map in the XY plane. Then just use the PLOTS
portion of this code (with better colors) to draw your
height lines.
Should work great. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|