Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [intersection]

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

Filter by
Sorted by
Tagged with
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, ...
4
votes
2answers
10k views

Intersect Shapefiles using Shapely

What I'd like to try and do is intersect some point buffers with census tracts, maintain their ID's and the tracts attributes. I found a sample from http://www.macwright.org/2012/10/31/gis-with-...
13
votes
3answers
40k 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 ...
41
votes
8answers
16k 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 ...
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....
17
votes
2answers
31k 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
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 ...
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 ...
21
votes
3answers
12k 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 ...
18
votes
4answers
63k 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 ...
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 ...
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 ...
3
votes
1answer
7k views

How to find the intersection areas of overlapping buffer zones in single shapefile?

Find the intersections of the buffer zones I found an example where they tried finding the intersection of two different shapefiles -Intersect Shapefiles using Shapely. I've tried to adapt my code to ...
1
vote
1answer
3k views

Problem intersecting shapefiles with OGR in Python

I'm trying to move from ArcPy for geoprocessing. After searching some posts, I found this solution using the GDAL/OGR Python bindings: Intersect Shapefiles using Shapely My code is the following: ...
6
votes
1answer
268 views

How to get smallest line segments from intersection + difference of multiple overlapping lines?

Inspired by this question, and this excellent answer. I have multiple overlapping lines and want to extract the complete intersection of them. So from this sample data SELECT id, geom INTO stackex ...
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 ...
1
vote
4answers
16k views

Intersection between points and polygons in QGIS

I have a shapefile of points and a shapefile of polygons. I want to know WHAT points (not how many) fall inside EACH of the polygons of my multipolygon shp. I thought the "Intersect" function was the ...
10
votes
1answer
5k 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 ...
18
votes
5answers
44k 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 ...
8
votes
7answers
7k 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 ...
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 ...
3
votes
3answers
1k views

Query to find the Intersection coordinates of multiple Polyon

I am using the query below to find out the intersection coordinates of 2 Polygons and it's working fine, but how can I use or modify the query to find the intersection area coordinates for multiple (...
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
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 ...
5
votes
1answer
550 views

Simulating Random Agent Movements along Roads on Map? [closed]

I need to simulate agent movements on map as follows: Agent starts a known location and moves along a road. At each road intersection, the agent uniformly chooses one possible road and moves along ...
3
votes
2answers
1k views

Create Intersecting lines and remove dangles [closed]

I have 3 cases shown in the image. In all of them i want to intersect the lines and remove dangles using python in Qgis python console so afterwards i can make a plugin for this work in qgis.In case ...
2
votes
2answers
3k views

Intersecting FeatureCollections in turf.js?

I've been playing around with turf.js and I'd like to use turf.intersect to intersect two datasets. My raw data are two polygon shape files so I converted them to geojson. I then tried to use turf....
8
votes
1answer
8k 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 ...
5
votes
1answer
411 views

Only union/dissolve intersecting features to save time?

I have one table of about 300k polygons, some overlapping but most do not. I need to dissolve the overlapping ones and also keep the non-overlapping ones. I only need the geometries, no attributes. I ...
5
votes
3answers
2k views

Adding vertices to existing lines where they intersect using ArcPy?

I need to add vertices to existing lines at intersections, something like this: I want to do this automatically, by Python script. I can get the coordinates (x,y) of intersections in very simple way: ...
5
votes
1answer
5k views

How to efficiently determine which of thousands of polygons intersect with a linestring [duplicate]

I have a shapefile that contains several thousand Polygons/MultiPolygons and another shapefile that has a variable number of LineStrings. In the example below the blue Polygons are those that ...
4
votes
2answers
479 views

Mapping building to only one grid which contains more than half of its area using QGIS?

I have a shapefile of a city map and I have created vector grid as polygons. After intersecting the two shapefiles, a building will map to all the grids it overlaps. However, if I just want it to ...
2
votes
1answer
8k views

SQL Server Spatial Querying

I am looking for ways to learn querying for SQL Server Spatial (2008/2012). I have a table created from Shape2SQL and have been trying to run a simple intersection query to get results from that ...
1
vote
1answer
377 views

Calculate area intersected areas, problem [closed]

(I'm working in QuantamGIS) I intersected two layers creating a new layer. Within the attibute table of this new intersect layer i would like to calculate the new areas. However, it just doesn't ...
9
votes
2answers
5k 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
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 ...
6
votes
1answer
11k views

can I extract overlap of polygons within the same layer?

I am trying to extract the overlap of polygons that are within the same layer in 10. The layer came from a buffered street centerline and I'm trying to extract and delete the intersections from the ...
5
votes
3answers
250 views

Finding redundancy between two layers

Let's say I have two point layers that contain locations of wells on a property. layer A has 50 points. layer B has 35 points. Some of layer B's points already exist on layer A, and some of them do ...
4
votes
1answer
652 views

Intersecting overlapping polylines using ArcGIS for Desktop?

I have 4 multipart polyline shapefiles (download a sample dataset here). The geometries are identical, except for the length of segments in each shapefile. They represent 4 variables describing an ...
3
votes
1answer
7k views

Intersection error QGIS - invalid geometries that are actually valid

I'm trying to intersect two vector layers (having the same CRS EPSG:4326 WGS 84, in QGIS 2.18.10) but I get this error in the log: Input layer A contains invalid geometries (feature 52). Unable to ...
3
votes
1answer
214 views

geopandas.intersects() over each row

In trying to answer Writing selected features to shapefile using OGR and Python? I ran into problems with geopandas.GeoSeries intersects methods. I have the following line and polygon: import pandas ...
3
votes
2answers
2k views

How do I find the points of intersection between a small circle and a great circle?

I only actually need to intersect a great circle arc i.e. the shortest path between two points, with a given small circle. I found this tutorial for intersecting two great circle arcs, but ...
3
votes
2answers
2k views

Find intercept WGS84 coordinates between two segments defined by (Lat1-Long1 and Lat2-Long2) and (Lat3-Long3 and Lat4-Long4)

I need to determine the WGS84 coordinates for a point that is defined by the interception of two segments represented by two sets of WGS84 coordinates each (lat1-long1, lat2-long2) and (lat3-long3, ...
1
vote
1answer
2k views

Intersect between polygonal shapefiles error

I'm encountering a problem when I try to intersect two different shapefiles. They are all new shapefiles I created to descibe the land cover and the land use of a city. The problem occurs when I ...
1
vote
0answers
975 views

Intersection between a ray from lat, lon, alt, with pan, tilt and earth's surface

I have a problem that consists of finding the intersection point between a ray from a given lat, lon, alt, that is looking to a given pan and tilt angles and the earth's surface. I need the lat, lon ...
1
vote
1answer
51 views

Why do these coordinates not display correctly (or intersect correctly) with this boundary file?

This is a follow up to my previous question. I wrote code that imports the boundaries of a few US states, and, for some arbitrary point within those boundaries, buffers a circle around that point and ...
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 ...
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
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.
5
votes
2answers
3k views

Find intersection point in a road network of line shapefile

How can I find intersection point in a road network in one line shapefile? I am using QGIS 2.18. How can I get the intersection point shown in blue colour