Tag Info

New answers tagged

5

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", ...


4

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


4

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], ...


15

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 ...


1

Another way: Module[{dist = 0}, Fold[ (dist += GeoDistance[##]; #2) &, locs[[tour]]]; dist] (* Quantity[6898.75, "Miles"] *) If locs is the other path to compare with: Module[{dist = 0}, Fold[ (dist += GeoDistance[##]; #2) &, locs]; dist] (* Quantity[30490.5, "Miles"] *)


5

I don't know any direct way to do what you wantand I agree that it would be an improvement if in a future release GeoDistance will supports a GeoPath as argument. But even now it's not so difficult to compute the distance along a path with with a not-so-"brute" way and this definition: geoPathDistance[locations:{__GeoPosition}] := Total[GeoDistance @@@ ...



Top 50 recent answers are included