I am trying to learn to use spatstat package in R from the book of Baddeley et al. I have converted my shapefile to a psp object (here it said 6 columns of data discarded) then I used as.linnet to convert this to linear network suitable for spatstat. (here it said network not connected)
Then I wanted to create a point pattern on this network using the rpoislpp and I used poisson intensity of 2.
> abc<-rpoislpp(2,final_roads)
> head(abc)
Point pattern on linear network
3 points
Linear network with 4296 vertices and 4475 lines
Enclosing window: rectangle = [30093.5, 278045.11] x [308520.5, 606556.7] units
> abc
Point pattern on linear network
10190733 points
Linear network with 4296 vertices and 4475 lines
Enclosing window: rectangle = [30093.5, 278045.11] x [308520.5, 606556.7] units
This created an enormous 1GB file. I dont understand how. My understanding from the book is the poisson intensity is number of points per total length of linear network. My network is about 5000 km (road network of a province), so I was just requesting 2 points in the whole network.
My questions are
- I do not understand how could it be 10 million points. I just wanted to create 2 points in the whole network and plot them.
- how to plot these points and get their x,y
Am I doing something wrong? Any advice would be great. Thanks