Tag Info

New answers tagged


Change the MemberQ criteria to CountryData[#, "Name"]] EDIT: Added spaces to some names in myCountries and corrected spellings. $Version "10.1.0 for Mac OS X x86 (64-bit) (March 24, 2015)" myCountries = Sort[{"Australia", "Austria", "Belgium", "Bosnia and Herzegovina", "Cambodia", "Canada", "China", "Croatia", "Czech Republic", "Denmark", ...


Found the answer. Countries now use Entity["Country", #] & /@ myCountries, and the conditional statement should compare Entities.


You could also use one of my favorites Throughto help: Through[(GeoEntities[CountryData["Belarus"],"Lake"|"Canal"])["Position"]] I find it particular useful when working with lists of Entity objects that you want values from.


#["Position"]&/@GeoEntities[CountryData["Belarus"], "Lake" | "Canal"]


Trying to handle the two concerns expressed in a comment to the Kuba answer, I built my own method. Indeed, I have investigated and tested 6 methods but the one I consider a good compromise between supported projections, (supposed) accuracy and speed is the following. Options[GeoContourPlot] = Join[ Options[GeoGraphics], ...


You can use your ContourPlot, you just need to wrap coordinates with GeoPosition, note that you have to flip order. (if x is longitude and y is latitude, because GeoPosition assumes first is latitude and so on.) cp is Graphics[GraphicsComplex[coordinates, primitives]...], it is convenient to use this form. We can apply GeoPosition in one place and reduce ...


Ctrl+= gasoline heat of combustion * density results in: Quantity[32.7, "Kilojoules"/"Centimeters"^3] To get energy per gallon: UnitConvert[%, "Joules"/"Gallons"] (* Quantity[1.23782965*^8, "Joules"/"Gallons"] *)


This has something to do with the level of lists (but I'm not sure why properties like "DistanceFromSun" behave differently than properties like "Declination"). Using PlanetaryMoonData because is has fewer members, I have found that you can work around this by adding a PropertyAssociation annotation: data = PlanetaryMoonData[PlanetaryMoonData[], ...


This is a quick and dirty version for what I think you are trying to do. Note that its not good Stack Exchange practise to keep asking variations of the question. One caveat with the Export help is that most useful stuff is held under each file format - so try looking at the help for XLSX. a = {"WMO44203", "WMO44207", "WMO44212"}; dset = WeatherData[#, ...


WeatherData can be told to give you all the weather stations it knows about, but there's more than one type of weather station (and duplicates!): allWeatherStations = WeatherData[]; fullformStations = FullForm /@ allWeatherStations; Tally[StringLength /@ fullformStations[[All, 1, 2]]] (*{{4, 6919}, {5, 10306}, {8, 4697}}*) Looking at the documentation, I ...


There is an example of what I think you are trying to do at the end of WeatherData help page, but its a little hard to read. However - here's what I think you want. (* Function to Get a list consisting of {CityName, Temp, Co-ords} given a Countries weather station, note we get the 1st nearest weather station to the city *) weatherdata[cityname_] := ...

Top 50 recent answers are included