When running this code, the kernel quits after a few countries. But as I run it again, it makes progress, showing that there is some caching going on. After about 20 runs, I can get the full result.
Countries = #[[2]] & /@
EntityList[EntityClass["Country", "Countries"]];
test[country_] := Module[{polygons, meshes, result},
Print[country];
polygons = Entity["Country", country]["Polygon"][[1, 1]] ;
meshes =
BoundaryMeshRegion[#, Line[Join[Range[Length[#]], {1}]] ] & /@
polygons;
result =
TriangulateMesh[RegionUnion @@ meshes, MaxCellMeasure -> 5];
];
test /@ Countries
Any idea on how I could easily encapsulates this to guarantee the result in a single session (so I can execute this from a batch file as needed...)?
Thanks