baby programmer here so apologies if this is a simple fix, however I am running a test to see where multiple polygons and multipolygons intersect, using two identical lists to loop through the whole dataset. The dataset is a geoseries of length 200, and I know for a fact more than one of these shapefiles intersect, however I keep getting the same output of just one multistring. I have been attempting this using the following code.
from geopandas import read_file, GeoSeries
from sys import exit
from matplotlib.pyplot import subplots, savefig, title
from pyproj import Geod
#import statements at the beginning
shapes = read_file("../data/ne_10m_admin_0.shp")
shapes_geo = shapes.geometry #retrieve the shapefile from the dataset
shape_borders = shapes_geo.iloc[range(len(world_geo))] #
bordersb = shape_geo #second list of countries
intborders = []
for b in bordersb:
for a in shape_geo():
if b.equals(a) == True:
exit
elif b.touches(a):
intborders = b.intersection(a)
print(intborders)
This currently outputs a single Multistring of 33 coordinates, however I have been aiming for a list of Multistrings. I have been testing the output by printing the pure values, checking the number on variable explorer as well as creating an image of the intersections, code for which is not shown here as there has been no issues there!
The final intended output is a list named 'intborders' showing all the intersections as multistrings.