New answers tagged geography
2
The fastest is probably with the use of the GeoNames API*:
loc = FindGeoLocation[]
i = Import[
"http://api.geonames.org/findNearby?lat=" <> ToString[loc[[1]]] <>
"&lng=" <> ToString[loc[[2]]] <> "&username=demo", "XML"];
name = Cases[i[[2, 3, 1, 3]], XMLElement["name", _, x_] -> x]
*Idea from this post.
EDIT: another ...
2
One way is to do this:
nc = Nearest[
CityData[#, "Coordinates"] -> # & /@
CityData[{All, "United Kingdom"}]];
Then use this as:
nc[FindGeoLocation[]]
{{"London", "GreaterLondon", "UnitedKingdom"}}
14
I separated this project into two parts. The first is to compute the coordinates of the Geohash location.
(*Grab the user's geographical location. The location is based on IP
address, so it may not be completely accurate. It's usually good
enough to get your graticute. You can replace home with with known
coordinates in the form {hx, hy} if you like.*)
home ...
5
The problem comes from rasterization by MorphologicalComponents. Maybe you could avoid it at the first place.
mapdata = Import["http://gadm.org/data/shp/FRA_adm.zip", "Data"];
regiondata = "Geometry" /. mapdata[[2]];
departdata = "Geometry" /. mapdata[[1]];
regionNum = Length@regiondata
t1 = Graphics@{
Rectangle[{-6, 41}, {9.7, 51.5}],
...
2
The following solution proceeds similarly to Vitaliy's, but preserves the coordinates of France's departments:
france = Import["http://gadm.org/data/shp/FRA_adm.zip", "Data"];
provinces = Colorize[MorphologicalComponents[
Graphics[{EdgeForm[Thick], FaceForm[White],
"Geometry" /. france[[2]]}, Background ...
4
The problem is using rectangle at the beginning. Use Background -> Black instead:
t1 = Graphics[{EdgeForm[Thick],
FaceForm[White], ("Geometry" /. mapdata[[2]])}, Background -> Black, ImageSize -> 600];
t2 = Colorize[MorphologicalComponents[t1, CornerNeighbors -> False],
ColorFunction -> "LightTerrain"];
t3 = Show[Graphics@{Black, ...
2
Your [[1,2]] takes the first windspeed from every location. So, it doesn't help to increase the data range.
[[All,2]] results in passing a list of windspeeds for every location to ListContourPlot. However, ListContourPlot expects a single dependent value for each point not a list. How would you interpret that? You need to apply Mean on that list to get a ...
1
A hint for the mapping thing:
d = {2013, 5, 1};
cords = Select[Reverse[CityData[#, "Coordinates"]] & /@ CityData[{All, "Norway"}], Head@# == List &];
Show[ListContourPlot[Join@@ {#,List@WeatherData[#,"MeanWindSpeed",d,d,"Day"}][[1, 2]]} & /@ cords],
Graphics[{Gray, Opacity[.5], CountryData["Norway", "Polygon"]}]]
3
Here's a quick answer for your first question (I'll let someone else handle the mapping (that's a lot of data to sort through).
Let's look at the wonderful (cough) city of Houston.
winddata = WeatherData[{"Houston", "Texas"}, "MeanWindSpeed",
{{1973, 1, 1}, {2013, 5, 1}, "Day"}];
Gather those values by day:
daysorted = GatherBy[winddata, #[[1, {2, ...
Top 50 recent answers are included


