I have two tables:
roadscontaining one row (line) for each road with column
road_codeuniquely identifying the name of the road;
districtscontaining one row (polygon) for each district with column
district_codeuniquely identifying each district.
I want to create a new table of lines called
roads_by_district, where each road from the table
roads is parted based on the intersection with the
roads_by_district should look like
road_code | district_code | geom(line) H1 District_A 0105... H2 District_A 0105... H1 District_B 0105... H2 District_B 0105...
I guess I should use a query with
ST_Contains but I don't want to return the entire road
H1 that partially intersects with district
District_A, but only the part of
H1 that is totally contained by