Intersection Method – How to Find Intersection Between Lines and Polygon in QGIS

intersectionlinepolygonqgis

How could you find intersection between lines intersected with polygon?

I want to find the lines only that located inside the map and intersected with polygon then change the colour of intersected lines to red colour and extract the id of each line intersected in Excel table.

image description

Edit: I used polygons to lines tool but it does not show me line and polygon layer, it shows me only one layer called Muffe and Arrow as u can see in picture.

My file is dxf, I have imported by import/convert DXF then I got 3 layers text, line and polygon and Arrow as picture.

My question at first: Does it correct to import line and polygon at the same layer or not, because I though it will give me both of them seperately, one layer for line and one layer for polygon.

Then, when I used polygon to lines. So, I think, it considers polygon is line also so I do not need to convert it, am I right.

Then I used intersection tool and I choose line and polygon input and also for overlayer, for sure I got intersection will be the same input. And I am not sure what should I do.

Could someone guide me, how can I find intersection between lines inside the map and the polygon?

Something, I want to know, when I imort any file should I have seperately layers I mean, one layer for line, one for polygon and so on or both of them will be together.

enter image description here

Best Answer

I tried to take your question becuase it is an interesting one to be solved with an SLQ statement.

Reading your tittle the case was either a linestring & polygon or a linestring & multipolygon type on the picture below (Source: Introduction to PostGIS):

enter image description here

But it seems you are mixing concepts. I GIS there is a limited number of geometry types compatred with the CAD paradigma. In GIS there are fewer vector types, the main ones are: points, lines and polygons (or nodes, edges and faces)

In GIS a point is an entity that had zero dimension (0D), it has only a location, a line has 1-D and it is made out of a set of points and a polygon is a 2D entity maede aout of a set of lines.

This picture will show the main three types of geometry entities (Source: A Gentle Introduction to GIS): enter image description here

There are more types, but main differences with the CAD paradigma are in the confusion between lines, polylines and polygons. A polyline in CAD is just a line type in GIS, and a closed polyline in CAD could be read as line or a polygon type depending on the success of the importing tool.

Then we have the difference of the layer paradigma. CAD applications might store any kind of entity types in a layer, while GIS applications store only one type per layer.

Back to your question, it does not matter what the layer is called, it can store only one kind of data, and that can be read for the icon. enter image description here

Line and polygon has only line type entities and Muffe and Arrow polygons.

My main suggestion now to you now is to read about GIS to get used to this new GIS paradigma about entity times and storage organization (layers). I highly recomend A Gentle Introduction to GIS Link to .pdf. Then, I suggest you to choose another file format than .dxf for your work in GIS, dxf does not fit very well with any gis analysis.

Related Question