5
$\begingroup$

I tried to do the Wolfram population density demonstration and it returned an error:

GeoRegionValuePlot[Entity["AdministrativeDivision",{_,"Texas","UnitedStates"}]->"Population"]

GeoRegionValuePlot::reps: Missing[UnknownEntity,{AdministrativeDivision,{_,Texas,UnitedStates}}]->Missing[Propagated,Missing[UnknownEntity,{AdministrativeDivision,{_,Texas,UnitedStates}}]] is not a list of rules of the form loc -> val >>
GeoRegionValuePlot[Entity[AdministrativeDivision,{_,Texas,UnitedStates}]->Population]

How can I get it to work?

$\endgroup$
4
  • $\begingroup$ I suspect your Entity was obtained in an odd way, perhaps from a cut and paste? It doesn't seem to be anything other than a string of text, i.e. dataless. $\endgroup$
    – IPoiler
    Sep 24, 2015 at 18:51
  • $\begingroup$ How should I get the Entity? I just copied the text from the example on the web page (as linked). $\endgroup$ Sep 24, 2015 at 18:53
  • 1
    $\begingroup$ I have communicated with WRI about this entity wildcard functionality; it is broken in many places. You could get them via GeoEntities[ Entity["AdministrativeDivision", {"Texas", "UnitedStates"}], "AdministrativeDivision"] $\endgroup$
    – mfvonh
    Sep 24, 2015 at 18:58
  • $\begingroup$ That's odd they use it that way in the link, I can't recreate their output of that command in v10.2. However, using AdministrativeDivisionData[{"Texas", "UnitedStates"}, "Subdivisions"] I'm able to get the list of divisions in Texas. $\endgroup$
    – IPoiler
    Sep 24, 2015 at 19:07

1 Answer 1

7
$\begingroup$

I cannot get the code in the demonstration to work either (MMA 10.2 on Win7-64).

A possible workaround might be to obtain a list of all the administrative divisions known to MMA, then selecting the ones in Texas, and applying GeoRegionValuePlot to those, as shown below:

alladmindivs = EntityList["AdministrativeDivision"];
GeoRegionValuePlot[
 Cases[alladmindivs, 
   Entity["AdministrativeDivision", {_, "Texas", "UnitedStates"}], Infinity] -> "Population"
]

Mathematica graphics


The following alternative method is based on It'sPronouncedOiler's suggestion in the comments to use AdministrativeDivisionData. It produces the same plot as the one above.

GeoRegionValuePlot[
   AdministrativeDivisionData[{"Texas", "UnitedStates"}, "Subdivisions"] -> "Population"]

It is worth noting, however, that neither method reproduces the plot shown in the linked demonstration...

$\endgroup$
2
  • $\begingroup$ Does the AdministrativeDivisionData alternative you provided work in your version? I had used that exact input in v10.2 but it produced a plot with almost half the municipals missing. I double checked it now after a kernel restart and it's still missing municipals, but different ones so maybe it's a rendering issue. $\endgroup$
    – IPoiler
    Sep 24, 2015 at 19:55
  • $\begingroup$ @It'sPronouncedOiler Yes it seems to work as well as the other one, or possibly better because I only had to download the Texas ad hoc information, rather than a list of all the administrative divisions. Here is the plot it produces: AdministrativeDivisionData plot. $\endgroup$
    – MarcoB
    Sep 24, 2015 at 21:32

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.