Geopandas and PostGIS query with points and lines

Viewed 19

I have a geodataframe with 10e5 rows containing points. I also have a PostGIS database with a table that contains a road network (2*10e6 rows). I need an efficient query that will find the road segment in the PostGIS database that intersects with each of the points in the geodataframe.

Would I basically just loop through each row of the geodataframe using ST_INTERSECTS? Or would I use a UNION and do all intersects at the same time? Is there a completely different approach that I am not considering?

0 Answers
Related