X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 26 Jul 2019 10:28 AM by  kwod12
Plot 3d data on map projection with continents
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

kwod12



New Member


Posts:5
New Member


--
12 Jul 2019 09:34 AM
    Is there any way to plot 3D data on a map projection with continents. If I set up a map and use the PLOT() function to plot a line, the line appears:

    m = MAP( 'Equirectangular' )
    c = MAPCONTINENTS()
    p = PLOT( [-180, 180], [-90, 90], /OVERPLOT )

    However, if I try to plot a 3D line over the map, the line does not appear

    m = MAP( 'Equirectangular' )
    c = MAPCONTINENTS()
    p = PLOT3D( [-180, 180], [-90, 90], [0, 10], /OVERPLOT )

    If I don't call MAPCONTINENTS() before PLOT3D(), then the line appears. However, the line disappears after MAPCONTINENTS() is called.

    Ben Castellani



    Basic Member


    Posts:130
    Basic Member


    --
    22 Jul 2019 04:28 PM
    The PLOT3D line is actually plotting, but it is extremely small since PLOT3D only accepts Cartesian coordinates (meters from the origin point). Using the below code will plot a 3D line:

    m = MAP( 'Equirectangular')
    c = MAPCONTINENTS()
    p = PLOT3D( [-1800000, 180], [-9000000, 90], [0, 100000000], /overplot,color='red',thick=3)

    In this case you need to convert your 3D points for the line to be in (x,y,z) coordinates in meters. You can brute force this with trigonometry, or use build in coordinate converters within IDL. Check into:

    MAP_PROJ_INIT, MAP_PROJ_IMAGE, MAP_GRID are your best bet.

    kwod12



    New Member


    Posts:5
    New Member


    --
    26 Jul 2019 10:28 AM
    Thank you Ben, that did the trick. Follow-up question, is there a way to display the z-axis on the plot? I can manipulate the properties of MAPGRID to move the lat/lon labels, but I cannot figure out how to show the vertical axis.

    Best
    You are not authorized to post a reply.