intersect - R: Get all xy-coordinates at the intersection of lines within one SpatialLines(DataFrame) -


I am looking for a way to get xy-coordinates of all intersections within spatlline < / Code> object or spell-lens data frame . I have got the rgeos function of gIntersect , but it only appears at intervals between two datasets since I was working with a dataset of more than half a million lines So, creating a separate file for every line and checking it will take a lot of time to see whether a line sprouts one another with another. There is an intersecting function in ArcMap which is capable of doing it in a few seconds and I was wondering if there was such a function in R.

if you assign your spatlines object to psp From spatstat , you can use it in the spatstat function selfcrossing.psp . However, I'm not sure how it will be able to deal with the million lines since the number of crossings, possibly it can be heavier, the code below creates a random segment pattern and finds itself crossing.

Keep in mind that this code can potentially take lots of memory and kill it, so try progressing with progressive examples before processing half a million lines. The code below used a small amount of memory on my 5-year laptop and took 5 seconds to run.

  set.seed (42) N & lt; - 1e4 x & lt; - psp (n), runinif (n), runif (n), runiniff (n), ovine (), check = falls) y and lieutenant - selfcrossing.ps (x)  
/ Html>

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -