Init
Init
In[]:=
ClearAll["Global`*"]
In[]:=
SetDirectory[NotebookDirectory[]]
Out[]=
/wolframcloud/userfiles/c1c/c1cc6044-ccac-4dbd-bb85-c02dba39ca7c/Published
Setup geo data
Setup geo data
In[]:=
Get["belgData.mx"];
In[]:=
Keys[belgData]
Out[]=
{LayerName,Geometry,Labels,LabeledData}
In[]:=
belgData["Labels"]
Out[]=
{CS01012020,T_SEC_NL,T_SEC_FR,T_SEC_DE,C_NIS6,T_NIS6_NL,T_NIS6_FR,CNIS5_2020,T_MUN_NL,T_MUN_FR,T_MUN_DE,C_ARRD,T_ARRD_NL,T_ARRD_FR,T_ARRD_DE,C_PROVI,T_PROVI_NL,T_PROVI_FR,T_PROVI_DE,C_REGIO,T_REGIO_NL,T_REGIO_FR,T_REGIO_DE,C_COUNTRY,NUTS1,NUTS2,NUTS3,M_AREA_HA,M_PERI_M}
Setup Geo data of Cities
Setup Geo data of Cities
Cities are made up from sectors (T_SEC_NL).
Cities are made up from sectors (T_SEC_NL).
Cities are made up from sectors (T_SEC_NL).
In[]:=
cityX=Union[Association[belgData["LabeledData"]]["CNIS5_2020"]];Length[cityX]
Out[]=
581
Sectors have to be put together to form city polygon.
Sectors have to be put together to form city polygon.
In[]:=
belgGeo=Thread[Association[belgData["LabeledData"]]["CNIS5_2020"]->belgData["Geometry"]];
In[]:=
Length[belgGeo]
Out[]=
19794
In[]:=
result=Table[{Echo[cityN],OuterPolygon[RegionUnion[Flatten[Values[Select[belgGeo,Keys[#]cityN&]]]/.{FilledCurve[{{Line[g_]},___}]Polygon[g]}]]},{cityN,Take[cityX,{1,20}]}];
»
11001
»
11002
»
11004
»
11005
»
11007
»
11008
»
11009
»
11013
»
11016
»
11018
»
11021
»
11022
»
11023
»
11024
»
11025
»
11029
»
11030
»
11035
»
11037
»
11038
In[]:=
Graphics[result]
Out[]=
In[]:=
Select[belgGeo,Keys[#]"12005"&]
Out[]=