I'm trying to use GeoPandas to generate points of intersection between two linear shapefiles. For example, I have a shapefile of pretend pipelines (red) and some crossings (blue).
What I would expect, are points wherever they intersect (green):
However, what I'm getting is just two points like so:
Here's my code:
import geopandas as gpd
pipelines = gpd.read_file(r"C:\Temp\GeometryTesting\Pipeline.shp")
crossings = gpd.read_file("C:\Temp\GeometryTesting\Linear_Crossings.shp")
I would expect this to be the correct code to calculate crossing points:
pipelines.intersection(crossings)
or even this:
crossings.intersection(pipelines)
However, both of them return the same result:
0 POINT (147.010039196221 -26.40843953078755)
1 POINT (150.4550260127808 -25.61354916104867)
2 ()
3 ()
dtype: object
Why am I only getting two points (and two records with no data)? Using geopandas, how can I generate all the crossing points?