Questions tagged [intersection]

Use this tag when asking questions related to where features overlap.

Filter by
Sorted by
Tagged with
40
votes
8answers
15k views

Select features that do NOT intersect in PostGIS

This seems to me like such a simple question (and it probably is) yet I cannot seem to find an example that gives me the answer. Using PostGIS, I just want to select points that fall outside of ...
36
votes
4answers
11k views

Separate polygons based on intersection using PostGIS

I have a PostGIS table of polygons where some intersect with one another. This is what I'm trying to do: For a given polygon selected by id, give me all of the polygons that intersect. Basically, ...
21
votes
8answers
3k views

Fixing thousands of small overlapping polygons?

I'm using ArcMap 10.3. I have a layer of different land use types. I found out that many polygons overlap each other and as a result the same polygon have two different land use types. Using @...
17
votes
2answers
29k views

Extracting intersection areas in R

I have two polygons. One contains fields(X,Y,Z) and the other contains soil types (A,B,C,D). I want to know what area of every field contains which type of soil. I tried the following: library(rgdal)...
17
votes
4answers
60k views

Merge intersecting polygons into one which are part of the same feature

I'm not a GIS professional so I hope I use the correct wording, at least I hope you understand my question. Let's say there are five polygons in the feature A. In the shapefile there are more ...
17
votes
3answers
8k views

Identifying road intersections using PostGIS

I'm trying to identify where roads intersect each other, and to make a point at this intersection, with the number of roads that form the intersection listed. I was wondering if there was some way ...
16
votes
5answers
40k views

Finding if two polygons Intersect in Python?

I'm looking for an algorithm, a high level solution, or even a library which can help me determine if two polygons intersect, in Python. I have the vertices of the two polygons (These are single part ...
16
votes
1answer
6k views

Finding Nearest Line Segments to Point using shapely?

Background From a known Point, I require to establish the nearest surrounding "visible perimeter" against a table of MultiLineStrings, as shown on the diagram. I've searched this site with a number ...
15
votes
6answers
18k views

How to use ST_Intersection?

Here's a quick summary about what I'm trying to do: I have 3 tables in Postgres, 'a' and 'b', each have a Polygon column, and 'c' has a Point column. What I'm trying to do here is to get the ...
14
votes
3answers
9k views

Ignoring invalid input features with Intersection tool in QGIS?

In QGIS 2.18, when I used the Vector > Geoprocessing Tools > Intersection tool, I was able to check an option which said "Ignore NULL geometries [optional]". Now I've downloaded QGIS 3.2 and that ...
13
votes
2answers
39k views

Create a new layer from overlap between two layers?

I'm new to desktop GIS, and will try to ask while lacking the proper terms from the GIS lingo: If QGIS was like Photoshop I would like to make a selection from one layer, and then match that ...
13
votes
2answers
4k views

Clip polygon and retain data?

I have these two polygons: library(sp); library(rgeos); library(maptools) coords1 <- matrix(c(-1.841960, -1.823464, -1.838623, -1.841960, 55.663696, 55.659178, 55.650841, 55....
11
votes
3answers
4k views

Rgeos drops associated values when intersecting polygons

I am trying to intersect two SpatialPolygonsDataFrames and get a SpatialPolygonsDataFrame as the result. Unfortunately, using the gIntersection function from rgeos (which works impressively quickly ...
11
votes
3answers
7k views

Getting intersection of multiple polygons efficiently in Python

I would like to get the intersection of multiple polygons. Using Python's shapely package, I can find the intersection of two polygons using the intersection function. Is there a similar efficient ...
10
votes
3answers
23k views

Differences Between the Clip Tool and the Intersect Tool

How is the clip tool different from the intersect tool in terms of how it works or the result? I don't have a specific situation in mind. I was learning about each of these tools and was curious about ...
10
votes
1answer
4k views

Geopandas Line Polygon Intersection

I'm trying to find where multiple lines intersect a polygon for two different geodataframes: from shapely.geometry import Polygon, LineString import geopandas as gpd polygon = Polygon([(0, 0), (1, 0)...
10
votes
3answers
15k views

Deleting overlapping polygon features from one of two layers using QGIS?

I have two overlapping layers of polygons, and I need to somehow erase the areas the overlaps. -This way i should end up with two layers of non overlapping polygons. Sounds pretty simple but I just ...
10
votes
2answers
6k views

Obtain voronoi polygons which extend till the boundary of another polygon

I have certain hubs (coloured yellow) in a district (coloured light blue). I need to find polygons indicating the closest hub to every point in the district. The voronoi polygons that I obtained ...
9
votes
2answers
14k views

How to repair topology of a shapefile?

I performed an object-based image analysis using ENVI EX, and each of the classified features were exported as a shapefile. I transferred those shapefiles into ArcMap 10, and tried to intersect them ...
9
votes
4answers
7k views

Distinguishing lines that intersect from lines that touch?

How do I distinguish between these cases in ArcGIS 10? Case 1: Both endpoints of a line touch another line Case 2: Both endpoints dangle over the lines it intersects I am looking at the Trim Line ...
9
votes
2answers
4k views

Removing intersect of one polygon from another using R?

I am trying to remove the intersect from Poly2 onto Poly1. Below are the coords of the 2 polygons. > coords1 [,1] [,2] [1,] 992.0161 7462.531 [2,] 950.1962 7413.532 [3,] 902.3632 ...
9
votes
2answers
15k views

Calculate area of intersecting polygons in QGIS

I have two collections of shapefiles: 1 - postal codes, administrative and political areas 2 - various land use categories like parks & allotments, and points like trees I want to produce ...
9
votes
1answer
2k views

Performance in calculating raster statistics in PostGIS

I'm trying to calculate raster statistics (min, max, mean) for each polygon in a vector layer using PostgreSQL/PostGIS. This GIS.SE answer describes how to do this, by calculating the intersection ...
9
votes
2answers
11k views

SQL Server - Select all polygons nested within a larger polygon

This is a seemingly simple SQL Server geometry question that I thought would have an out-of-the box solution, but I'm not having any luck finding one. My intent is to select all the records within ...
9
votes
5answers
13k views

Intersect (analysis) of polygons generating empty output

I have previously asked a question on determining the area of polygons with another polygon boundary. Determining the area of each polygon within a polygon boundary? I came to the conculsion that ...
9
votes
1answer
2k views

Intersection of multiple layers in PostGIS

I need to write PL/pgSQL stored procedure for calculation of intersection of multiple layers. For example, for three layers A, B, C this function should return ABC geometry: Function takes as input ...
8
votes
7answers
7k views

Intersection algorithm that correctly handles the 180° meridian and poles?

Is there a well known intersection algorithm that correctly handles 180 meridian and poles? For example, let's say we have a list of latitude and longitude values that represent Antarctica. Let's ...
8
votes
4answers
3k views

Finding polygons crossed by line using OGR?

I'm trying to find all the polygons crossed by a single line (a GPS track). I'm using the OGR library (from python) for computing this, but it's currently a bit 'brute-force' (and slow). For every ...
8
votes
1answer
4k views

Intersecting lines to get crossings using Python with QGIS?

I have a set of lines representing bus lines. Some of the lines are overlapping and take the same roads. I am able to extract the nodes. However I am interested in extracting only crossings like ...
8
votes
1answer
2k views

What is the difference between Spatial predicates “Covers” and “Contains”?

I try to understand the Spatial predicates of the DE-9IM Intersection matrix. I don't get the difference between predicates Covers (respective CoveredBy) and Contains (resp. Within). I try to draw ...
8
votes
3answers
2k views

RTree spatial index does not result in faster intersection computation

I have some code that I am using to determine which Shapely Polygon/MultiPolygons intersect with a number of Shapely LineStrings. Through the answers to this question the code has gone from this: ...
8
votes
1answer
7k views

Line vs. Polygon Intersection Coordinates

I am working with Python, Shapely and Fiona... Is there any way where I can give in an input of a line shapefile and a polygon shapefile, and get a result of the intersection points and their ...
7
votes
2answers
3k views

How to extract value from a raster based on lat and lon?

I have several netcdf files that I can read using the netCDF4 library in python. The data is gridded in 4320 rows and 2160 columns. I also have a list of lat/lon (in decimal degrees) and I am trying ...
7
votes
2answers
10k views

OGR Layer Intersection

I am using what I would describe as the most primitive method of doing intersection with OGR. The short script below describes how I do it. Is there a best way of doing this? from osgeo import ...
7
votes
1answer
3k views

Calculating length of just portion of linestring that intersect with polygon using PostGIS?

I want to calculate the portion of the linestring that lies within the limits of a polygon. Better with an image What is the length of the portion of linestring within Province A? and within Province ...
7
votes
2answers
3k views

Performing multiple layer intersection in QGIS?

I am trying to find a way with QGIS to get the intersection area of more than 2 layers. All the tools in QGIS take just the 2 input layers. For example in the image below, I have 4 layers and I want ...
7
votes
3answers
9k views

Extract Overlapping Polygon Data to Points

I have a polygon data set of corn yield collected by a combine. However, as the combine drove through the field, there was slight overlap between passes, leading to overlapping polygons within the ...
7
votes
2answers
3k views

Split lines at intersection points

I've got some linestrings covering a road network, and need to split them at the crossroads. Does anybody have any idea on how to do it? I'm using QGIS 2.4, with a Postgis 2.1.3.
7
votes
1answer
5k views

How to use the Intersects function in the Field Calculator of QGIS?

I would like to have an example on how to use the Intersects function in the Field Calculator of QGIS. Basically, I want to know which feature from a polylines layer intersects a polygons layer and ...
7
votes
1answer
2k views

Split polylines at polygon boundaries in QGIS

I have a set of contour lines and a polygon set containing glaciers. Because I want the glaciers to have blue contours, I need to split the contour lines at the glacier boundaries. I can achieve this ...
7
votes
2answers
3k views

Clipping vs Intersecting

I was curious why clipping shapefiles was just so difficult and whether it was different to intersecting shapefiles? You will see from one my questions that I gave up trying to clip a polyline with a ...
7
votes
2answers
225 views

Tool that modifies number of vertices but not the feature itself

Do you know the reason, why some ArcGIS tools (like Clip and Intersect) modifies number of vertices, even if the feature is not modified itself? Like on the picture, I use Clip and Intersect on line ...
7
votes
1answer
541 views

Visualizing road Intersections & connections in ArcGIS

I am working with polylines (roads) in ArcGIS and I was wondering if there is a possibility to somehow show intersections as well as connecting parts of all the different road-segments. Also, would ...
7
votes
1answer
375 views

Connecting centroids of lines sharing same intersection in QGIS?

I have this street network of the center of Turin (IT), composed by lines representing streets, and black points representing intersections. I have computed the centroids of each line and displayed ...
7
votes
0answers
189 views

QgsSpatialIndex partial or complete overlap

I'm working on adding some functonality to a QGIS plugin. It currently uses a QgsSpatialIndex to efficiently compute whether the features of a vector layer intersect (potentially millions) of ...
6
votes
1answer
23k views

Create point in intersections of two layers

I have two layers. One of them is 'Road_line' and another one is 'forest_shape'. I want to create a point layer that has points in intersection of that layers. I couldn't find any tools for it.
6
votes
2answers
291 views

Looping through table to get single intersection from N>2 geometries using PostGIS?

It's really clear how to apply ST_Intersection when you have only two geometries. But I am struggling with the situation where you have N>2 shapes and you want to compute a single one that represents ...
6
votes
2answers
3k views

Is there a way to get at C's OGRLayer.Intersection() or OGRLayer.Clip() in Python?

I am working with OGR in Python and noticed that the C libraries have useful Intersection() and Clip() functions as part of the Layer class. Is there any way to get at these functions in Python? I ...
6
votes
1answer
4k views

How to get the intersecting polygon of two polygons? (using JSTS intersection)

I want to intersect two polygons within an OpenLayers layer. I found the JSTS library, which should be able to intersect two polygons, and return the new created polygon of the intersection. The ...
6
votes
1answer
12k views

QGIS: “Invalid geometry” even after using validity checker and v.clean

I'm trying to intersect two layers in QGIS, similar to this unanswered question. I've performed Vector > Geometry Tools > Check Geometry Validity and I've run GRASS's v.clean, per these questions. I'...