# Tag Info

### Find the vertices of the edge of the polygon where line intersects using Shapely

Shapely allows you to put a spatial index on geometries for fast lookup of geometries meeting certain geometrical predicates (such as overlap or intersection). In this case, I would recommend creating ...
• 101

### How to remove regional boundaries from GeoPandas series of an area

Since you seem to have a line dataframe this should work: Polygonize each region, dissolve/unary_union all into one polygon, extract its boundary: import geopandas as gpd from shapely.ops import ...
• 75.3k

### Efficiently check if polygon contains any point from a list

You can use GeoPandas with spatial join. Spatial join use index by default. import geopandas as gpd pointdf = gpd.GeoDataFrame(geometry=point_list, crs=3006) #Replace 3006 with the code of your ...
• 75.3k
Accepted

### Efficiently check if polygon contains any point from a list

This is a typical case to use a spatial index. Shapely has support for spatial indexes via shapely.STRtree.query I did a quick test with 1000 polygons and 750 points derived of them... and even with ...
• 3,519
1 vote

### Find the closest distance between points following a set of LineStrings

You can create a networkx graph where each line vertice is a node and each line is an edge with the line length as an attribute. Then find the shortest path: import geopandas as gpd import networkx as ...
• 75.3k
1 vote

### Interpolating every X distance along line in shapely

Depending on your exact needs, an option is to use shapely.segmentize. Note though that each segment longer than the length specified will be subdivided in equal parts so that each part is shorter ...
• 3,519
1 vote

### Interpolating every X distance along line in shapely

You can create a GeoDataframe and use .interpolate with a range of distances from start to end of each line to create the points: import geopandas as gpd import numpy as np df = gpd.read_file(r"/...
• 75.3k
Accepted

### Dissolve lines that intersect after attending some dataframe (atributte table) conditions

After a long time, I resumed this project and found a solution. # Marge segments based on tabular info ('id' and 'dt') gdf = gpd.GeoDataFrame() for id in gdf_sof.id.unique(): unique_id = gdf_sof.loc[...
• 21