geoglobe in Mapping Toolbox

9 vues (au cours des 30 derniers jours)
Robert Mueller
Robert Mueller le 10 Déc 2020
Modifié(e) : Kojiro Saito le 15 Déc 2020
I'm getting started with the Mapping Toolbox and found sample code to try but get an error:
uif = uifigure;
geoglobe(uif)
g = findall(groot,'Type','globe');
Undefined function or variable 'geoglobe'.
The system does not find the function 'geoglobe' (yes, I do have the Mapping toolbox installed). One tip suggested running this code to see if my system has hardware graphics support:
fig = uifigure;
ax = axes(fig);
info = rendererinfo(ax);
info.GraphicsRenderer
ans =
'WebGL'
The result seems to indicate that I do have the hardware required. Suggestions?

Réponses (2)

Kojiro Saito
Kojiro Saito le 11 Déc 2020
geoglobe was introduced in R2020a. Could you check your MATLAB version?
  3 commentaires
Kojiro Saito
Kojiro Saito le 14 Déc 2020
Modifié(e) : Kojiro Saito le 15 Déc 2020
geoplot is available from R2018b.
For example, you can change the basemap of geoplot to satellite which is higher resolution.
latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
gp = geoplot( [latSeattle latAnchorage],[lonSeattle lonAnchorage],'g-*');
gx = gca;
gx.Basemap = 'satellite'; % Available from R2019b
geolimits([45 62],[-149 -123])
You have Mapping Toolbox, you can add your custom using addCustomBasemap function. The help page contains how to change the basemap to OpenStreetMap and USGS National maps.
Kojiro Saito
Kojiro Saito le 15 Déc 2020
Modifié(e) : Kojiro Saito le 15 Déc 2020
My apologies. "satellite" option of geoplot is available from R2019b.
Another way is using webmap and wmline.
latSeattle = 47.62;
lonSeattle = -122.33;
latAnchorage = 61.20;
lonAnchorage = -149.9;
webmap('World Imagery')
wmline( [latSeattle latAnchorage],[lonSeattle lonAnchorage]);
This works well in R2019a, too.

Connectez-vous pour commenter.


Robert Mueller
Robert Mueller le 14 Déc 2020
Thanks, Kojiro... I was able to get the terrain background - excellent feature. However, the 'satellite' Basemap option that you suggest is not available with my MATLAB version. Here's what I get when I run your suggested script verbatim:
Error using matlab.graphics.axis.GeographicAxes/set.Basemap
Expected Basemap to match one of these values:
'darkwater', 'grayland', 'bluegreen', 'grayterrain', 'colorterrain', 'landcover', 'none'
The input, 'satellite', did not match any of the valid values.
Again, I have MATLAB version 2019a Update 8.
All of the Basemap options listed in the error message above worked fine. Thanks again for your help. - Rob

Produits


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by