I have a huge association of counties associated with some values. I am creating a GeoRegionValuePlot for this data. But every time I execute this the code in a fresh kernel, it always downloads the GeoGraphic tiles and this makes the plotting slow and time consuming.

Here is an example of what I am doing:

countries = 
  Entity["Country", #] & /@ {"UnitedStates", "Canada", "Mexico", 
    "Spain", "France", "Norway", "Egypt", "SaudiArabia", "Vietnam", 
values := RandomInteger[{1000, 9999}, 10];
data = AssociationThread[countries -> values];

Is there a way to cache the downloaded tiles into .mx files that I can load everytime I run this code instead of downloading the tiles from the server?


1 Answer 1


A possible solution is use the GeoServer option extend the "CacheDuration". The default duration is 1 day but can be increased to 7 days with the following.

 GeoServer -> {Automatic, "Storage" -> {"CacheDuration" -> Quantity[7, "Days"]}}

There is also the undocumented GeoGraphics`TileData function but I have not looked too deep into how you would use that or reincorporate its result back into geo-graphic functions. Perhaps someone else will give it a go.

Hope this helps.

  • $\begingroup$ The CacheDuration stores the data as long as the current session is active. If I start a new session, it again downloads the tiles. $\endgroup$
    – Sâu
    Commented May 2, 2020 at 13:59
  • $\begingroup$ @Sâu Then you may want to look into that GeoGraphics`TileData function to see if your can store and restore. $\endgroup$
    – Edmund
    Commented May 2, 2020 at 14:33
  • $\begingroup$ Can you point to any links, please? I am unable to find anything. Thanks. $\endgroup$
    – Sâu
    Commented May 2, 2020 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.