So I have a table in PostGIS, and each row has a linestring geometry in it. I would like to do a query to return the whole rows of the table that intersect with the linestring along with the position(s) of that intersect.
At the moment I am using;
import geopandas as gpd import psycopg2 # (if it is postgres/postgis) con = psycopg2.connect(database="your database", user="user", password="password", host="your host") sql = "select geom, x,y,z from your_table which intersects Linestring” df = gpd.GeoDataFrame.from_postgis(sql,con,geom_col='geom' )
I’m a complete beginner to SQL and the resources surround PostGIS
ST_Intersect aren't so helpful.