[R-sig-Geo] Plot Great Circle path on e.g. wrld_simpl?
Nick Matzke
matzke at nimbios.org
Fri Jun 26 06:47:23 CEST 2015
Wow, super-cool, thanks!
Nick
On Fri, Jun 26, 2015 at 1:24 AM, John Baumgartner <johnbaums at gmail.com>
wrote:
> Take a look at
> http://flowingdata.com/2011/05/11/how-to-map-connections-with-great-circles/
>
> At its simplest, I think you want to add:
>
> library(geosphere)
> path <- gcIntermediate(c(-120, 45), c(0, 55), n=50, addStartEnd=TRUE)
> lines(path)
>
> Cheers,
> John
>
>
> On Fri, Jun 26, 2015 at 2:16 PM, Nick Matzke <nickmatzke.ncse at gmail.com>
> wrote:
>
>> Hi,
>>
>> Is there an easy way to plot a Great Circle path between two points on a
>> world map, e.g. wrld_simpl?
>>
>> E.g., something like this, but Great Circle instead of the flat-map
>> straight path:
>>
>> ===================================
>> library(maptools) # for e.g. wrld_simpl
>>
>> data(wrld_simpl)
>> plot(wrld_simpl)
>>
>> # This plots the flat-map straight line, but
>> # I would like a plot of the Great Circle path
>> segments(x0=-120, y0=45, x1=0, y1=55, lwd=2)
>> ===================================
>>
>>
>> I googled around some but didn't find anything super-obvious.
>>
>> Cheers!
>> Nick
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list