[R-sig-Geo] Map point-of-view and joining locations with loops

Michael Sumner mdsumner at gmail.com
Wed Jul 15 16:19:54 CEST 2015


On Wed, 15 Jul 2015 at 18:04 Paul Woods <p.woods at qub.ac.uk> wrote:

> Hello everyone,
>
> I’m not entirely sure how to explain what I’m looking for, but basically
> I’m hoping to do two things in R:
>
> 1) Rather than looking at a map face-on (from above, e.g., a normal
> OpenStreet Map or Google map), I would like to show the perspective of
> someone looking at the map from an angle, i.e., if someone were at
> altitude, hovering over the ground.
>
>

2) I would like to join two points on this map with a loop/line segment.
>
>
I can show you how to do this using raster/rgdal and the rgl package. It's
actually pretty straightforward once you can transfer between the sp and
raster data models and the quad-mesh model  available in rgl (see
?shade3d).  The essential difference for the raster grids is that sp/raster
store a rigid affine transform for the geography, but rgl stores every
pixel's corner coordinate once with a 4-piece index into that for each
"quad". You then can add texture coordinates with a few raster package
tricks to seamlessly overlay an image, and adding lines in 3d is pretty
simple - once you have a start/end, build a curve via some trajectory and
then store it in rgl's 2-index segment pairs (compared to sp's sequential
coordinates).

Maybe none of that makes sense to you, but if you can point to a specific
area and especially if you have actual data you want to use then I can
flesh this out some time, maybe next week. I've got tools that make it
simpler to do this data transfer now, but not on CRAN yet.  If you don't
have any data, you can obtain imagery through dismo::gmap, but a
topography/bathymetry layer can be harder and you might need to find a
local source - Etopo1 is an ok starting point that is global.

You can also use the ?persp facility in R to create static plots (rgl is
interactive 3d by default).

cheers, Mike.


Is this possible to do in R? And how would I go about doing it? I have no
> idea where to start.
>
> This type of map typically shows airline routes, e.g.,
>
> http://www.barnabu.co.uk/wp-content/uploads/australia_flight_route_map_google_earth.JPG
>
> Thanks,
>
> Paul Woods
>
>         [[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