1

I have a line shapefile containing roads, and I'd like to use it to create a network dataset. In ArcGIS, I'd do this with the Network Analyst extension (see here).

Is there an R package with the equivalent functionality? I've checked out Bivand's Cran Task View for the analysis of spatial data, and I've searched a bit on SO and the GIS SE, but I haven't found any good leads. I've also looked through Bivand et al.'s (2013) Applied Spatial Data Analysis with R.

I've been using R for a while, but not for spatial data processing and analysis. I'd appreciate any package suggestions or tips about other resources.

Community
  • 1
  • 1
Eric Green
  • 7,385
  • 11
  • 56
  • 102
  • It would help if you posted a link to a sample road file, and some simple task that you want to do with it. Also, check out this [example of converting a road shapefile to an graph](http://stackoverflow.com/questions/11943208/shapefile-to-neural-network-in-r). – nograpes Feb 23 '14 at 02:45
  • here is [a simple example](https://github.com/ericpgreen/SO/tree/master/spatial-weights). i'd like to create a matrix of shortest distances between points using the road network. – Eric Green Feb 23 '14 at 14:40
  • @EricGreen Your link is broken? – Brad Nov 01 '22 at 21:55

1 Answers1

1

You could check the shp2graph package. It allows to input a SpatialLines or SpatialLinesDataFrame (ie. a lines shapefile loaded through the readShapeLines function in the maptools library) to create a network. And then through the function points2network integrate a points data set into an existing network. For example, these points could be the coordinates of city centroids. Then, through the igraph package you could analyze the network.

osmarllq
  • 11
  • 1