Questions tagged [st-difference]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
32 views

Lengthy PostGIS processing time of buffered polygon and line string intersection/difference

I have created a ring buffer of lines (streams). I then use ST_Intersect and ST_Difference/ST_Intersects to intersect a linestring (linestring_feature) with the ring buffer (MultiPolygon) and also ...
MJM's user avatar
  • 781
3 votes
0 answers
157 views

PostGIS difference between two tables with polygon

I have two polygon tables. I try to remove portions but the end result is not acceptable. I took the time to look at different questions and answers about ST_Difference but I couldn't solve my problem....
Bak's user avatar
  • 131
0 votes
1 answer
92 views

Remove ("erase") polygons by shared attribute

I need to do a pair-wise removal of a set of polygons within a larger set of polygons. pt<-data.frame("x"= c(0,0),"y"= c(0,5),pair= c("a","b")) pt<- ...
Wanner's user avatar
  • 9
1 vote
1 answer
206 views

How big geometry are best for BigQuery performance

I make a geospatial analysis, in Google BigQuery, which mostly includes making difference (I mean ST_Difference) between parcels geometry and some objects like woods, buildings etc. Some of objects I ...
Jurek's user avatar
  • 19
2 votes
1 answer
144 views

ST_Difference drops M values: How to subtract line segments

In PostGIS, I have a LINESTRING M and I want to remove a segment of the line that falls between two given M values. I tried the following: SELECT ST_AsText(line) as line, ST_AsText(...
Christoph's user avatar
4 votes
2 answers
328 views

Remove the overlap line left by PostGIS ST_Difference

I need to remove any overlapping from these two polygons when I run select geometry(ST_Difference(poliA::geometry, poliB::geometry)) apparently returns A-B but, if I use ST_Intersection to look ...
Kashtanka's user avatar
4 votes
3 answers
386 views

Creating difference of two polygon layers using Virtual layer in QGIS

I am trying to learn the usage of Virtual Layers in QGIS but I can't find a solution for a problem that seems very simple. I have two polygon layers and I want to have the difference. Polygon layer 1: ...
oekoplaner's user avatar
5 votes
1 answer
502 views

ST_difference resulting in multiple overlapping polygons and no difference

I have a dataset with two layers of polygons: Layer A: Areas of interest from the corine land cover inventory dataset Layer B: Road network resulting from buffered linestrings that were aggregated by ...
nicobuelk's user avatar
1 vote
0 answers
27 views

Difference between two layers with one layer having multiple intersections does not work

I am working on a project for determining potential areas. Therefore I am extracting many features e.g. roads, waterways, nature reserves which need to be buffered with a specific distance. All these ...
Sandrine Weber's user avatar
2 votes
0 answers
193 views

PostGIS - ST_Union + ST_Difference create extra line segment

Very similar to this question I have two multipolygons, which touch/overalp each over. please see this link for the multipolygon #1 and multipolygon #2 multipolygon #1 multipolygon #2 I ran st_union ...
Tony's user avatar
  • 41
1 vote
0 answers
104 views

How to run st_difference on two large multipolygons efficiently

I have two multipolygon tables: t1 and t2. t1 contains 136 000 rows and t2 contains 5970 000 rows. t1 is always overlapping with t2. The goal is to run difference to remove the area where t1 is ...
heljor's user avatar
  • 185
3 votes
2 answers
344 views

Using ST_Difference [duplicate]

I have 2 tables Table A with this fields (379 rows in this table) The geom of table A contains this (QGIS only used for better visualization) The table B contains this fields (97 rows in this table) ...
Jeff_Barahona's user avatar
2 votes
1 answer
398 views

st_difference creates two linestrings, how can I keep only one?

I am using R and the sf package to manipulate shapefiles. I have transect lines that intersect an island going a few hundred meters inland (see image below). The objective of my project is to trim ...
Stephan's user avatar
  • 21
2 votes
1 answer
4k views

Why use st_union after st_combine with sf?

The documentation of the st_union function of sf is not clear (for me!) on one point: what are the action and result of the function when applied to an sfc with a single feature, with the parameter ...
Jean-Luc Dupouey's user avatar
1 vote
2 answers
443 views

Removing longest segment of linestring and rejoining segments

I am trying to remove the segment that has the longest length from a linestring and join the two group of segments that remain by the shortest segment between them. That was easy, using ST_Difference (...
liap307's user avatar
  • 191
2 votes
1 answer
280 views

Checking if result of st_difference is empty

I am trying to select lines that completely touch a polygon (not at just a single point). I would assume it would be a simple case of st_isempty(st_difference(geom_a,geom_b)). However, this is not the ...
pkExec's user avatar
  • 313
3 votes
0 answers
97 views

Why QGIS/PostGIS makes Sliver / small polygon when using erase (difference) tool unlike ArcGIS (QGIS vs ArcMap)?

When erasing b polygon from a, sliver(or small) polygons occured along the a polygon boundary in QGIS(3.4.5). But ArcMap(10.3) does not make any slivers at all. I don't know which difference between ...
user127580's user avatar
5 votes
4 answers
2k views

Finding truly intersected polygons

Intro Short version: My goal is to find geometries intersected by a target polygon. To find overlaps - the most straightforward choice is to use ST_Overlaps or ST_Intersects. But this method will ...
MiklerGM's user avatar
  • 111
2 votes
0 answers
144 views

PostGIS ST_Difference is returning overlapped areas

I´m using this SQL sentence to obtain the difference of two layers, exactly I understood that ST_Difference does, that is, it should return polygons that don´t overlap and the not overlapped area when ...
Mauro Assis's user avatar
3 votes
1 answer
2k views

st_write fails for object created with st_difference using R?

Using publicly available sea area shapefiles bahamas: http://www.marineregions.org/gazetteer.php?p=details&id=8404 ("eez.zip") watl: http://www.marineregions.org/gazetteer.php?p=details&id=...
dez93_2000's user avatar
  • 1,039
2 votes
1 answer
778 views

ST_Intersection + ST_Difference + not overlapping Polygons

I have a PostGIS table with some overlapping polygon and need a PostGIS view where no polygon is overlapping and the data is aggregated (like in the picture). With a Union of ST_Intersection() and ...
nepluisse's user avatar
  • 598
1 vote
0 answers
56 views

Select features of a shape which are not in another shape

I have a shape with some features (let's say 100) and a second shape with some of this features (50) buffered (5 meters inside buffer). I want to select and write in a new shape every feature of the ...
Ion Sola's user avatar
3 votes
2 answers
1k views

Find what polygons are not fully covered by union of polygons from another layer in PostGIS

I have two tables in a PostGIS database >>> select postgis_version(); "2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1" One represents the country borders and another one is administrative ...
Alex Tereshenkov's user avatar
10 votes
2 answers
7k views

Function in R to get difference between two sets of polygons comparable in speed to QGIS

I have two very large polygon shapefiles for which I need to calculate the difference between the two shapefiles. One is a shapefile of forest polygons, the other is a shapefile of road polygons. I ...
user3386170's user avatar
  • 1,917
2 votes
0 answers
75 views

Uploading overlapping contours into PostgreSQL?

I've got 100+ shapefiles of contours with the following fields: class (text) altitude (double) geom (geometry) And I need to upload them into a single table in PostgreSQL. Now, I've managed to ...
user25730's user avatar
  • 852
2 votes
1 answer
448 views

st_difference (erase overlapped feature) line from polygon

I have two layers. One is MultiLineString and the other is MultiPolygon. I am trying to erase lines that are on the polygon feature With QGIS difference tool, it worked just fine This is my code and ...
Pil Kwon's user avatar
  • 1,010
1 vote
3 answers
1k views

Increase spatial query performance (st_difference)

I have two link tables one is 9029 rows (and let's say this table is A) and the other is 11698 rows (and this table is B) the both tables are road link and A is for tunnel link and B is road link ...
Pil Kwon's user avatar
  • 1,010
1 vote
0 answers
227 views

ESRI Polygon cutouts (neg. space) become multiple layers in PostGIS

I have a single MULTIPOLYGON from ESRI ArcGIS with 10,000+ sub-polygons in a Shapefile, some having > 1.4 million vertices. I'm importing the data into PostGIS (ogr2ogr or shp2pgsql, same results) so ...
sventechie's user avatar
2 votes
1 answer
264 views

Bringing two lines together and getting their difference

In the photo there are two lines that are parallel to each other. I want to bring them at same coordinates and carry out the difference between them, which will be the small part of red line from the ...
mimetype's user avatar
  • 225
4 votes
0 answers
132 views

ST_Difference() PostGIS returns weird results [duplicate]

I'm trying to use the postgis's st_difference() function, but with no luck. I have a layer of polygons A And a layer of Polygons B What I want to achieve is this (created with QGIS algorithm): ...
Luismi's user avatar
  • 975