Filter löschen
Filter löschen

problem with Geoplot reading table from NUTS shp file

5 Ansichten (letzte 30 Tage)
AlexG
AlexG am 8 Jan. 2023
Kommentiert: AlexG am 16 Jan. 2023
Hi,
trying to create a EU Choropleth map from NUTS.shp file.
It should display different colors in each region proportional to climatic data (stored in HDD_geoT.HDD )
Problem seems when geoplot is reading the shapes from HDD_geoT.Shape
my code:
EU_geoT = readgeotable('NUTS_RG_03M_2021_3035.shp');
% building HDD map on EU_geoT from common fields NUTS_ID and Region
HDD_geoT = outerjoin(EU_geoT, HDD_1721,"LeftKey","NUTS_ID","RightKey","Region");
HDD_geoT = rmmissing(HDD_geoT);
figure
%geoplot (with error!!)
geoplot(HDD_geoT, ColorVariable="HDD");
getting error (same on R2022b online):
geoplot(HDD_geoT, ColorVariable="HDD");
Error using map.graphics.chart.primitive.Polygon
Value must be numeric.
Error in map.graphics.internal.geotableplot (line 49)
h = objectConstructor('Parent', parent, 'SourceTable', tbl, 'ShapeVariable', 'Shape', pvpairs{:});
Error in geoplot (line 68)
obj = map.graphics.internal.geotableplot(gx, args);
Please help!
Alex
***************
here the substructure of the polygon shapes
HDD_geoT.Shape(1)
ans =
mappolyshape with properties:
NumRegions: 1
NumHoles: 0
Geometry: "polygon"
CoordinateSystemType: "planar"
ProjectedCRS: [1×1 projcrs]
HDD_geoT.Shape(1,1).ProjectedCRS
ans =
projcrs with properties:
Name: "ETRS89-extended / LAEA Europe"
GeographicCRS: [1×1 geocrs]
ProjectionMethod: "Lambert Azimuthal Equal Area"
LengthUnit: "meter"
ProjectionParameters: [1×1 map.crs.ProjectionParameters]

Akzeptierte Antwort

Yuvraj Singh
Yuvraj Singh am 11 Jan. 2023
Hi Alex,
I understand you are trying to use “ColorVariable” in “geoplot” to display different colours in each region proportional to climatic data but encounter an error.
ColorVariable” expects its input to be a numeric type. But I notice that the data Type of column “HDD” is 1x1 cell double, it is not numeric.
I hope this helps you.
-Yuvraj

Weitere Antworten (0)

Kategorien

Mehr zu Geographic Plots finden Sie in Help Center und File Exchange

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by