Issues running basic geoshow examples from the Mapping Toolbox

11 views (last 30 days)
I am having trouble running some of the basic examples from the Matlab Mapping toolbox
Here is an example straight from the documentation. Using the online run command, it runs no problem.
landAreas = readgeotable("landareas.shp");
row = landAreas.Name == "Africa and Eurasia";
landAreasSubset = landAreas(row,:);
landAreasSubset.Shape
ans =
geopolyshape with properties: NumRegions: 2 NumHoles: 22 Geometry: "polygon" CoordinateSystemType: "geographic" GeographicCRS: [1x1 geocrs]
worldmap([-45 80],[-25 195]);
geoshow(landAreasSubset)
However when I run it locally this is what I get:
Error using geoshow
Expected S to be one of these types:
geopoint, mappoint, geoshape, mapshape
Instead its type was table.
Error in geovectorshow (line 93)
validateattributes(S, {'geopoint', 'mappoint', 'geoshape','mapshape'}, ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in geoshow (line 274)
h = showFcn(varargin{:});
^^^^^^^^^^^^^^^^^^^^^^^^^
Error in test (line 16)
geoshow(landAreasSubset)
^^^^^^^^^^^^^^^^^^^^^^^^
I am getting all sorts of errors on geoshow for other simple scripts.
I am running MATLAB 2014b on Apple Silicone. I have re-installed MATLAB completely to check if it's some issue with the Mapping toolbox
  2 Comments
Steve Eddins
Steve Eddins on 7 Feb 2025
You said that you are running MATLAB R2014b. Is that correct? I wouldn't expect that version to get past the call to readgeotable, which wasn't added until R2021b.
If that was a typo, and you are really running a recent version of MATLAB and Mapping Toolbox, then I suspect you are unintentionally calling an old version of geoshow. Try this to see what you have:
>> which -all geoshow
Phil
Phil on 7 Feb 2025
Hello! That was indeed a typo, but your advice helped me find the problem. I was using an older version of geoshow. Once the new version was used, it all ran as fine. Thank you.

Sign in to comment.

Accepted Answer

Phil
Phil on 7 Feb 2025
@Steve Eddins proposed the solution above. Checking via which -all geoshow indicated that another version of geoshow was being used.

More Answers (0)

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!