I'm trying some code to get the building footprints of Barcelona:
import osmnx as ox
import matplotlib.pyplot as plt
%matplotlib inline
place_name = "Barcelona, Barcelona, Catalonia, Spain"
graph = ox.graph_from_place(place_name)
buildings = ox.footprints_from_place(place_name)
When I run the code it yields the following error message:
TopologicalError: The operation 'GEOSDifference_r' could not be performed. Likely cause is invalidity of the geometry <shapely.geometry.polygon.Polygon object at 0x00000262079B6550>
I've tried updating the OSMnx version but it seems not to be the problem. How can I solve this issue?