Clear Filters
Clear Filters

mapshow plot order

7 views (last 30 days)
Andrew
Andrew on 4 Apr 2012
I am trying to plot a geotiff and a shapefile together in a map (not unlike the demo in help with the image and roads of Boston). However, when I use the commands, my shapefile ends up plotted behind the geotiff rather than above the image. My command looks like this (edited for simplicity):
mapshow(imagegrid, Rmapref) mapshow(shape)
the georeferencing in both Rmapref and shape is based in geographic (lat/long) coordinates rather than in x/y map coordinates, but memory issues were causing failure when plotting using geoshow. Any advice will help. Thanks.
  1 Comment
Neil Caithness
Neil Caithness on 18 Jun 2012
I was about to post the same question but I'll add another example here.
[Z, R] = sdtsdemread('9129CATD.DDF');
mapshow(Z, R, 'DisplayType', 'surface')
x = [3.15 3.24]*10^5;
y = [4.91 4.91]*10^6;
hold on
plot(x,y,'*-k')
The points and line from the PLOT are obscured by the surface. How to bring these to the front? I think this is a general problem with surfaces and lines/points.

Sign in to comment.

Answers (1)

Neil Caithness
Neil Caithness on 18 Jun 2012
The solution I've found builds on the fact that even 2-d plotting is done in 3-d with an implied z=0. With MAPSHOW the surface is viewed from vertically above the X/Y plane, so any lines/points with a height of z=0 are obscured by map surface values >0.
One solution is to use PLOT3 with suitably large z values. Changing my example above:
[Z, R] = sdtsdemread('9129CATD.DDF');
mapshow(Z, R, 'DisplayType', 'surface')
x = [3.15 3.24]*10^5;
y = [4.91 4.91]*10^6;
z = [1 1] + max(Z(:));
hold on
plot3(x,y,z,'*-k')
Use the rotate button in the figure window to see what's going on.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!