Re: [R-sig-Geo] igraph and spatial

2016-02-25 Thread Mathieu Rajerison
Hi, Recently, I used igraph with spatial objects. Once you have the coordinates of the nodes composing an edge, you can transform it into a spatiallines object with this function : makeLineFromCoords <- function(coords, i) { Sl1 = Line(coords) S1 = Lines(list(Sl1), ID=as.character(i)) Sl =

Re: [R-sig-Geo] igraph and spatial

2016-02-25 Thread Mathieu Rajerison
For curved lines, you could use the bezier library. In this example, I generate a bezier line with random curvature within a specific range : from = mst.bh[i, 1] # coordinates of the source node to = mst.bh[i, 2] # coordinates of the target node d = sqrt((coords[from, 1] - coords[to, 1])^2 + (co

Re: [R-sig-Geo] igraph and spatial

2016-02-25 Thread Mathieu Rajerison
In this example, I generate a bezier line with random curvature within a specific range : from = mst.bh[i, 1] # coordinates of the source node to = mst.bh[i, 2] # coordinates of the target node d = sqrt((coords[from, 1] - coords[to, 1])^2 + (coords[from, 2] - coords[to, 2])^2) # the distance bewt

Re: [R-sig-Geo] Problems with mapmisc::insetMap()

2016-02-25 Thread Agustin Lobo
Thanks, Do you know why your solution does not work on a raster layer? i.e. require(rgdal) require(raster) require(mapmisc) require(TeachingDemos) nicabg2 <- openmap(nica,path="cartodb") plot(nicabg2) subplot({ plot(world, col=1, xlim=c(-120, 30), ylim=c(-30, 40)) box() points(coordi

[R-sig-Geo] Multiple time point + variable regression

2016-02-25 Thread Michael Synan
Hello all, Apologies in advance if this request is not properly posed, this is my first post. I want to get r squared (i think) for the following data: - land values (X) for properties across multiple years - geojson of particular regions (ZONE) and the year they were established I want to show

[R-sig-Geo] resolution of openmap() raster layers

2016-02-25 Thread Agustin Lobo
Is there any way to download the raster layers of openmap() with an increased resolution? I find the quality of the labels very low, or am I doing something wrong? i.e. require(raster) require(mapmisc) nica <- getData("GADM", country="NIC", level=0) nicabg <- openmap(nica, path="landscape") plot(n

Re: [R-sig-Geo] Problems with mapmisc::insetMap()

2016-02-25 Thread Patrick Brown
Hello all, my first post here! mapmisc (1.4.8 from r-forge) now allows require(rgdal) require(raster) require(mapmisc) nica <- getData("GADM", country="NIC", level=0) nicabg <- openmap(nica, path="landscape") map.new(nicabg, 0.7,mar=c(2, 2, 2, 0) + 0.1) plot(nicabg,axes=TRUE) plot(nica,add=TRUE

Re: [R-sig-Geo] resolution of openmap() raster layers

2016-02-25 Thread Barry Rowlingson
On Thu, Feb 25, 2016 at 5:11 PM, Agustin Lobo wrote: > Is there any way to download the raster layers > of openmap() with an increased resolution? > I find the quality of the labels very low, > or am I doing something wrong? i.e. > > require(raster) > require(mapmisc) > nica <- getData("GADM", cou

Re: [R-sig-Geo] resolution of openmap() raster layers

2016-02-25 Thread Chris Reudenbach
Hi, if you just want to map the data, mapview could be an option that among others avoid the pixel stretching. require(mapview) require(raster) nica <- getData("GADM", country="NIC", level=0) mapview(nica) mapview(nica,zcol = "POP2000", color = "#FFA500", lwd= 5, alpha.regions = 0.4) che

Re: [R-sig-Geo] igraph and spatial

2016-02-25 Thread Michael Sumner
On Mon, 22 Feb 2016 7:30 pm Michael Sumner wrote: > On Mon, 22 Feb 2016 at 19:13 Luca Candeloro > wrote: > >> Dear all, >> plotting graphs with given vertex coordinates is possible inside igraph >> plot function. >> I would like to transform vilsualized edges into SpatialLinesDataFrame, so >> th