필터 지우기
필터 지우기

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 CenterFile Exchange에서 Geographic Plots에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by