フィルターのクリア

problem with Geoplot reading table from NUTS shp file

5 ビュー (過去 30 日間)
AlexG
AlexG 2023 年 1 月 8 日
コメント済み: AlexG 2023 年 1 月 16 日
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]

採用された回答

Yuvraj Singh
Yuvraj Singh 2023 年 1 月 11 日
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
  1 件のコメント
AlexG
AlexG 2023 年 1 月 16 日
Thank you, I solved the problem by using cell2mat().

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeographic Plots についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by