Questions tagged [st-difference]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
21 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 ...
2
votes
0answers
84 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 ...
1
vote
0answers
43 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 ...
2
votes
2answers
88 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) ...
1
vote
1answer
40 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 ...
1
vote
1answer
420 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 ...
1
vote
2answers
239 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 (...
2
votes
1answer
79 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 ...
2
votes
0answers
65 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 ...
5
votes
4answers
1k 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 ...
1
vote
0answers
110 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 ...
2
votes
1answer
798 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=...
2
votes
1answer
397 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 ...
1
vote
0answers
45 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 ...
3
votes
2answers
732 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 ...
8
votes
1answer
3k 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 ...
2
votes
0answers
67 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 ...
1
vote
1answer
320 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 ...
1
vote
3answers
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 ...
1
vote
0answers
208 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 ...
2
votes
1answer
211 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 ...
4
votes
0answers
116 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): ...