Skip to main content

Questions tagged [intersection]

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

Filter by
Sorted by
Tagged with
56 votes
10 answers
27k views

Selecting features that do NOT intersect in PostGIS

Using PostGIS, I just want to select points that fall outside of polygons. Ultimately this is the inverse of the ST_Intersects, as far as I can see it. Example: I have a taxlot layer and a address ...
RyanKDalton's user avatar
  • 23.1k
44 votes
3 answers
62k 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 ...
Felipe D.'s user avatar
  • 2,629
38 votes
4 answers
13k 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, ...
atogle's user avatar
  • 1,742
36 votes
6 answers
129k 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 ...
Devdatta Tengshe's user avatar
31 votes
8 answers
13k views

Calculating intersection of two Circles

I'm trying to figure out how to mathematically derive the common points of two intersecting circles on earth's surface given a center Lat/Lon and a radius for each point. For example, given: Lat/Lon ...
Will's user avatar
  • 311
29 votes
5 answers
96k 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 ...
user19746's user avatar
  • 293
27 votes
2 answers
64k 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)...
user2386786's user avatar
22 votes
8 answers
6k 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 @...
shiny's user avatar
  • 899
21 votes
3 answers
10k 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 ...
djq's user avatar
  • 16.3k
21 votes
3 answers
12k views

Finding angle between intersecting features in two feature classes using ArcGIS Desktop and Python [closed]

I have two intersecting line featureclasses. I want to find the angle at each point of intersection using ArcGIS 10 and Python. Can anyone help?
Bikash's user avatar
  • 211
20 votes
1 answer
12k 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 ...
Rusty Magoo's user avatar
18 votes
3 answers
37k views

Differences Between Clip Tool and 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 ...
Diana Di Leonardo's user avatar
17 votes
6 answers
28k 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 ...
Uriel's user avatar
  • 373
15 votes
2 answers
19k 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)...
bgordon's user avatar
  • 425
14 votes
3 answers
51k 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 ...
Eiriks's user avatar
  • 243
14 votes
2 answers
5k 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....
luciano's user avatar
  • 1,157
13 votes
1 answer
8k 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 ...
ustroetz's user avatar
  • 8,014
13 votes
1 answer
894 views

Optimizing intersections and rubber band representations with PyQGIS

I made a tool which runs a QgsMapToolEmitPoint object. Also set its canvasMoveEvent to create a polygon rubberband that takes a geometry from a feature that intersected with current tool's cursor ...
Pavel Pereverzev's user avatar
13 votes
4 answers
27k 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 ...
tomchance's user avatar
  • 161
13 votes
3 answers
22k 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 ...
splinter's user avatar
  • 357
13 votes
2 answers
12k 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 ...
Jerome Alary's user avatar
13 votes
1 answer
3k 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 ...
Snorfalorpagus's user avatar
12 votes
7 answers
8k views

Intersection algorithm that correctly handles 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 ...
Sean's user avatar
  • 320
12 votes
4 answers
36k 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'...
snadhelta's user avatar
  • 123
11 votes
3 answers
25k views

Finding intersection of two rasters

I have two raster images, Boolean classified (1 or 2). They overlap in given areas. I need a raster that is only the overlapping sections. Using ArcInfo 10. Answer can only use raster methods, no ...
Thad's user avatar
  • 935
11 votes
3 answers
1k 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 ...
mikitk's user avatar
  • 167
11 votes
3 answers
10k 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 ...
GodinA's user avatar
  • 489
11 votes
3 answers
5k 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 ...
Ari B. Friedman's user avatar
11 votes
2 answers
9k 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 ...
julsbreakdown's user avatar
11 votes
3 answers
18k 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 ...
aneh's user avatar
  • 354
10 votes
3 answers
5k views

Identifying polygons that intersect with another layer using QGIS

Using QGIS, I have two polygon layers, a vegetation layer and a treatment layer. I want to add a field to the attribute layer of the vegetation layer to indicate if any part of the polygon has been ...
Esme_'s user avatar
  • 848
10 votes
2 answers
9k views

Calculating proportional area of polygon within another layer's polygon using QGIS

I have two polygon layers, 'model' and 'ntem', whose features overlap and intersect one another. I would like to calculate the proportion of the area of the 'model' polygons which fit within each '...
Gonja's user avatar
  • 497
10 votes
1 answer
6k 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 ...
Jorge Arévalo's user avatar
10 votes
4 answers
8k 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 ...
mvexel's user avatar
  • 1,680
10 votes
4 answers
20k 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 ...
baobobs's user avatar
  • 411
10 votes
2 answers
7k 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 ...
shrgm's user avatar
  • 201
10 votes
1 answer
709 views

Removing overlapping features by percentage in PostGIS

I have geometry records of type MultiLineStringZM and I am trying to INSERT new records that overlap some of the records currently in the table. If they were type MultiPolygon I could use ST_Area() as ...
Don's user avatar
  • 805
10 votes
0 answers
367 views

Defining partial or complete overlap with QgsSpatialIndex

I'm working on adding some functionality to a QGIS plugin. It currently uses a QgsSpatialIndex to efficiently compute whether the features of a vector layer intersect (potentially millions) of ...
alphabetasoup's user avatar
9 votes
2 answers
17k 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 ...
kaoscify's user avatar
  • 981
9 votes
1 answer
5k 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 ...
Wernfried Domscheit's user avatar
9 votes
3 answers
6k 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: ...
derNincompoop's user avatar
9 votes
1 answer
2k views

Only union/dissolve intersecting or adjacent features to speed up query

I have a table with about 300k polygons, some are overlapping or adjacent to each other and some are islands of their own. I need to dissolve the overlapping/adjacent ones and also keep the non-...
BERA's user avatar
  • 73.8k
9 votes
1 answer
14k 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 ...
Akhil's user avatar
  • 1,435
9 votes
5 answers
19k 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 ...
JC11's user avatar
  • 829
9 votes
2 answers
7k views

How to split a polygon using R

I have an irregular polygon which is a spatial object. I want to divide it into multiple polygons (say, n=25) with equal height. To show how I want to divide it, I've plotted grids on the background ...
ToNoY's user avatar
  • 573
9 votes
1 answer
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 ...
drnextgis's user avatar
  • 6,938
9 votes
1 answer
869 views

PostGIS: How to distinguish overlapping routes (i.e., LineStrings) based on their direction?

I have a set of routes which are represented by LineStrings in my PostGIS database. These routes represent journeys that people make. I want to come up with routes that (a) overlap, and (b) have the ...
ARV's user avatar
  • 191
8 votes
3 answers
2k views

Finding intersections of features in one line layer using QGIS

I want to find intersections in the same layer like picture below. All lines are separate features in the same layer. How can I find these intersections in QGIS?
jin's user avatar
  • 169
8 votes
1 answer
29k 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.
hvaezi's user avatar
  • 289
8 votes
2 answers
658 views

Dissolving polygons that intersects with line in Geometry Generator

I need help to understand what am I doing wrong in this expression. I have two layers, one with lines and one with polygons. I wished to achieve through Geometry Generator a dissolve of all the ...
Felippe M.'s user avatar
  • 1,082

1
2 3 4 5
24