Questions tagged [st-difference]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
50 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 ...
user avatar
  • 19
2 votes
1 answer
57 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(...
user avatar
4 votes
2 answers
86 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 ...
user avatar
4 votes
3 answers
141 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: ...
user avatar
4 votes
1 answer
155 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 ...
user avatar
1 vote
0 answers
23 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 ...
user avatar
2 votes
0 answers
111 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 ...
user avatar
  • 41
1 vote
0 answers
50 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 ...
user avatar
  • 167
3 votes
2 answers
156 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) ...
user avatar
2 votes
1 answer
88 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 ...
user avatar
  • 21
1 vote
1 answer
882 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 ...
user avatar
1 vote
2 answers
313 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 (...
user avatar
  • 181
2 votes
1 answer
106 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 ...
user avatar
  • 273
3 votes
0 answers
73 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 ...
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 ...
user avatar
  • 111
2 votes
0 answers
119 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 ...
user avatar
3 votes
1 answer
1k 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=...
user avatar
  • 1,027
2 votes
1 answer
495 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 ...
user avatar
  • 479
1 vote
0 answers
51 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 ...
user avatar
3 votes
2 answers
859 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 ...
user avatar
8 votes
1 answer
4k 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 ...
user avatar
  • 1,825
2 votes
0 answers
71 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 ...
user avatar
  • 814
2 votes
1 answer
359 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 ...
user avatar
  • 942
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 ...
user avatar
  • 942
1 vote
0 answers
218 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 ...
user avatar
2 votes
1 answer
230 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 ...
user avatar
  • 225
4 votes
0 answers
127 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): ...
user avatar
  • 957