Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #3007

Re: Mapping points

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mapping points
Date 2011-06-08 11:12 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <isnlf0$n17$1@smc.vnet.net> (permalink)

Show all headers | View raw


Five minutes later, after SEVERAL updates of the curated data... we get a  
(distorted?) map of the country.

The Tooltips read, for instance, "cd[{Houston,Texas,United  
States},Name,Coordinates,Population" -- exactly like that.

Adding this code beforehand:

Clear[cd]
cd[x_, y_List] := cd[x, #] & /@ y
cd[any__] := CityData[any]

turns the same ToolTip into {Houston,{29.7629,  
-95.3832},Missing[NotAvailable]}, even though

CityData[{"Houston", "Texas", "United States"}, "Population"]

2257926

ALL the populations are Missing[NotAvailable] in the ToolTips.

But THIS works (for what reason, I cannot imagine):

Clear[name, coordinates, pop]
country = "UnitedStates";
large = Take[CityData[{Large, country}], 30];
name[city_] := name[city] = CityData[city, "Name"]
coordinates[city_] := coordinates[city] = CityData[city, "Coordinates"]
pop[city_] := pop[city] = CityData[city, "Population"]
Graphics[{LightGray, CountryData[country, "Polygon"],
   PointSize[Medium], Red,
   Tooltip[Point[Reverse[CityData[#, "Coordinates"]]], {name@#,
       coordinates@#, pop@#}] & /@ large}, Frame -> True,
  ImageSize -> 600]

Bobby

On Tue, 07 Jun 2011 05:45:08 -0500, Bob Hanlon <hanlonr@cox.net> wrote:

>
> cd[city_, prop_List] := CityData[city, #] & /@ prop
>
> Module[{country = "UnitedStates"},
>  Graphics[{
>    LightGray,
>    CountryData[country, "Polygon"],
>    PointSize[Medium],
>    Red,
>    Tooltip[
>       Point[Reverse[
>         CityData[#, "Coordinates"]]],
>       cd[#, {"Name", "Coordinates", "Population"}]] & /@
>     Take[CityData[{Large, country}], 30]},
>   Frame -> True,
>   ImageSize -> 600]]
>
>
> Bob Hanlon
>
> ---- Yako <yako@11y11.com> wrote:
>
> =============
> Hello,
>
> I been trying to look information on how to do this but couldn't find
> a clue, if someone here can hint me I will really appreciate it.
>
> Given a set of LAT, LON points I have to map them inside a white
> graph. My en result will need to be a white graph full of dots in its
> correspondent lat, lon location.
>
> Can I achieve something like this using mathematica? Can someone hint
> me in the right direction?
>
> Thanks a lot!
>
>
>
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Re: Mapping points DrMajorBob <btreat1@austin.rr.com> - 2011-06-08 11:12 +0000

csiph-web