[R-sig-Geo] igraph and spatial
Mathieu Rajerison
mathieu.rajerison at gmail.com
Thu Feb 25 11:39:20 CET 2016
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 = SpatialLines(list(S1))
return(Sl)
}
For all the routing stuff within R, this resource by B. Rowlingson is quite
inspiring :
http://rstudio-pubs-static.s3.amazonaws.com/1572_7599552b60454033a0d5c5e6d2e34ffb.html
best,
Mathieu
2016-02-22 9:30 GMT+01:00 Michael Sumner <mdsumner at gmail.com>:
> On Mon, 22 Feb 2016 at 19:13 Luca Candeloro <luca.candeloro at gmail.com>
> 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
> > that they could be exported in .shp file...
> > Any suggestion?
> >
>
> Can you please provide a working igraph example that we can start with?
>
> Do you want coordinates as seen in a particular plot, or can it be more
> arbitrary?
>
> Cheers, Mike.
>
>
>
> > thanks in advance,
> > Luca
> >
> > [[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
> >
> --
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> Kingston Tasmania 7050 Australia
>
> [[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