5
$\begingroup$

UPDATE: this is not a global Mathematica issue, but a data load issue on a local machine. Does anyone know how to clear Geo cache and reload the data? I've also noticed on this machine that Interpreter["USState"][abbr] does not always load every state, skipping 1 or 2 at random. So there's definitely an issue fetching geo data (at least on this box).


Here's the conundrum - if I add any geography, other than a US state - including United States as a country, Texas shows up just fine:

GeoRegionValuePlot[{Entity["AdministrativeDivision", {"Texas", "UnitedStates"}] -> 2, Entity["Country", "Canada"] -> 4}]

But when it's a list of only US states - it vanishes:

GeoRegionValuePlot[{Entity["AdministrativeDivision", {"Texas", "UnitedStates"}] -> 2, Entity["AdministrativeDivision", {"NewMexico", "UnitedStates"}] -> 4}, GeoRange -> "Country"]

Sample output:

GeoRegionValuePlot issues

Here's a really ugly workaround, but it's not a fix, just an ugly patch - joining with a Missing[] value for continental US:

stateAvgTotals = {Entity[
 "AdministrativeDivision", {"Alabama", "UnitedStates"}] -> 31316, 
Entity["AdministrativeDivision", {"Alaska", "UnitedStates"}] -> 
40349, Entity[
 "AdministrativeDivision", {"Arizona", "UnitedStates"}] -> 41200, 
Entity["AdministrativeDivision", {"Arkansas", "UnitedStates"}] -> 
26175, Entity[
 "AdministrativeDivision", {"California", "UnitedStates"}] -> 
67509, Entity[
 "AdministrativeDivision", {"Colorado", "UnitedStates"}] -> 41095,
Entity["AdministrativeDivision", {"Connecticut", 
  "UnitedStates"}] -> 31318, 
Entity["AdministrativeDivision", {"Delaware", "UnitedStates"}] -> 
27072, Entity[
 "AdministrativeDivision", {"DistrictOfColumbia", 
  "UnitedStates"}] -> 40117, 
Entity["AdministrativeDivision", {"Florida", "UnitedStates"}] -> 
46016, Entity[
 "AdministrativeDivision", {"Georgia", "UnitedStates"}] -> 31097, 
Entity["AdministrativeDivision", {"Hawaii", "UnitedStates"}] -> 
32175, Entity[
 "AdministrativeDivision", {"Idaho", "UnitedStates"}] -> 25566, 
Entity["AdministrativeDivision", {"Illinois", "UnitedStates"}] -> 
36062, Entity[
 "AdministrativeDivision", {"Indiana", "UnitedStates"}] -> 28145, 
Entity["AdministrativeDivision", {"Iowa", "UnitedStates"}] -> 
24169, Entity[
 "AdministrativeDivision", {"Kansas", "UnitedStates"}] -> 31580, 
Entity["AdministrativeDivision", {"Kentucky", "UnitedStates"}] -> 
24524, Entity[
 "AdministrativeDivision", {"Louisiana", "UnitedStates"}] -> 
33085, Entity[
 "AdministrativeDivision", {"Maine", "UnitedStates"}] -> 20395, 
Entity["AdministrativeDivision", {"Maryland", "UnitedStates"}] -> 
13378, Entity[
 "AdministrativeDivision", {"Massachusetts", "UnitedStates"}] -> 
20534, Entity[
 "AdministrativeDivision", {"Michigan", "UnitedStates"}] -> 24124,
Entity["AdministrativeDivision", {"Minnesota", "UnitedStates"}] ->
 27894, Entity[
 "AdministrativeDivision", {"Mississippi", "UnitedStates"}] -> 
30293, 
Entity["AdministrativeDivision", {"Texas", "UnitedStates"}] -> 
41480, Entity[
 "AdministrativeDivision", {"Missouri", "UnitedStates"}] -> 31185,
Entity["AdministrativeDivision", {"Montana", "UnitedStates"}] -> 
22670, Entity[
 "AdministrativeDivision", {"Nebraska", "UnitedStates"}] -> 31736,
Entity["AdministrativeDivision", {"Nevada", "UnitedStates"}] -> 
61047, Entity[
 "AdministrativeDivision", {"NewHampshire", "UnitedStates"}] -> 
27059, Entity[
 "AdministrativeDivision", {"NewJersey", "UnitedStates"}] -> 
66126, Entity[
 "AdministrativeDivision", {"NewMexico", "UnitedStates"}] -> 
30011, Entity[
 "AdministrativeDivision", {"NewYork", "UnitedStates"}] -> 31436, 
Entity["AdministrativeDivision", {"NorthCarolina", 
  "UnitedStates"}] -> 25141, 
Entity["AdministrativeDivision", {"NorthDakota", 
  "UnitedStates"}] -> 21637, 
Entity["AdministrativeDivision", {"Ohio", "UnitedStates"}] -> 
28344, Entity[
 "AdministrativeDivision", {"Oklahoma", "UnitedStates"}] -> 29588,
Entity["AdministrativeDivision", {"Oregon", "UnitedStates"}] -> 
27390, Entity[
 "AdministrativeDivision", {"Pennsylvania", "UnitedStates"}] -> 
39634, Entity[
 "AdministrativeDivision", {"RhodeIsland", "UnitedStates"}] -> 
29943, Entity[
 "AdministrativeDivision", {"SouthCarolina", "UnitedStates"}] -> 
35862, Entity[
 "AdministrativeDivision", {"SouthDakota", "UnitedStates"}] -> 
29610, Entity[
 "AdministrativeDivision", {"Tennessee", "UnitedStates"}] -> 
29280, Entity[
 "AdministrativeDivision", {"Utah", "UnitedStates"}] -> 25093, 
Entity["AdministrativeDivision", {"Vermont", "UnitedStates"}] -> 
20075, Entity[
 "AdministrativeDivision", {"Virginia", "UnitedStates"}] -> 29222,
Entity["AdministrativeDivision", {"Washington", 
  "UnitedStates"}] -> 34714, 
Entity["AdministrativeDivision", {"WestVirginia", 
  "UnitedStates"}] -> 19192, 
Entity["AdministrativeDivision", {"Wisconsin", "UnitedStates"}] -> 
26149, Entity[
 "AdministrativeDivision", {"Wyoming", "UnitedStates"}] -> 28701};

Show[{GeoRegionValuePlot[{EntityClass["AdministrativeDivision", 
   "ContinentalUSStates"] -> Missing[]}~Join~stateAvgTotals, 
PlotStyle -> Opacity[0.65], MissingStyle -> Opacity[0]]}
, GeoRange -> EntityClass["AdministrativeDivision", "ContinentalUSStates"]
, ImageSize -> 1000]

GeoRegionValuePlot ugly patch

A more elegant solution, or an explanation of the reason for this bug would be greatly appreciated!

$\endgroup$
  • $\begingroup$ The geo* functions were written by middle schoolers $\endgroup$ – M.R. Apr 7 '17 at 4:19
  • $\begingroup$ As noted in its tag description, do not add the bugs tag until your observations have been confirmed by other users. Also, please include copyable code instead of just screenshots. $\endgroup$ – J. M. will be back soon Apr 7 '17 at 4:19
  • $\begingroup$ @J.M. done. Thanks for a good suggestion. I'll wait for a confirmation, but it really feels like a bug. $\endgroup$ – Gregory Klopper Apr 7 '17 at 4:42
  • $\begingroup$ @M.R. is that tongue-in-cheek sarcasm or are you suggesting I really should avoid using them? I'd really love to hear more about your issues with Geo* functions. $\endgroup$ – Gregory Klopper Apr 7 '17 at 4:44
  • 2
    $\begingroup$ I wonder if there was a problem downloading the polygon for Texas the first time. Your plots all seem to work correctly for me in V11.0 and V11.1 on Mac. $\endgroup$ – Brett Champion Apr 7 '17 at 5:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.