Questions tagged [st-intersects]
ST_Intersects is a SQL function that takes two geometries and returns true if any part of those geometries is shared between them.
144 questions
1 vote
1 answer
91 views
ST_Intersects() gives false positive for geography type vs casting to geometry
These shapes do not touch and yet st_intersects() says they do if using geography based calculation (Yes, I understand the difference between geography and geometry, distortion from projection does ...
2 votes
0 answers
86 views
Test if two geometries intersect by at least a certain number of units [closed]
I am trying to determine if two geometries intersect by at least a certain number of units. One might think to call ST_DWithin with a negative distance, but this is not supported. I tried using ...
0 votes
1 answer
101 views
Getting different results for shapes intersecting between BigQuery/GeoViz and R/QGIS
We are trying to determine whether a set of linestrings intersects a polygon and are seeing two different results. BigQuery is saying they do intersect, and we can see that in geoviz it does seem that ...
2 votes
2 answers
99 views
PostGIS ST_Intersects does not work as expected - it returns false although ST_Covers return true
I have two polygons such that polygon A (pie-shaped) covers polygon B (rectangle) as shown here: https://wktmap.com/?6aaf8c11. Why does PostGIS return false for ST_Intersects(A, B), but true for ...
2 votes
0 answers
62 views
Geometry search by frustum using PostGIS 3.3.4
I have a table, that represents model elements: create table bim_geometry ( id SERIAL PRIMARY KEY, name VARCHAR(64), geom geometry(POLYHEDRALSURFACEZ, 0) ) I want to get elements that fit ...
0 votes
1 answer
513 views
R st_intersects gives out sgbp file [closed]
Basically I have a data frame with coordinates variables and other variables, and another SHP file provides polygones geographic information: I want to find out which points are inside these polygones ...
1 vote
0 answers
142 views
st_intersection is duplicating rows
I'm using the sf package in R to understand how land cover changed from forest fires in BC, by overlapping burned areas (NBAC) with data from Dynamic World (DW). I have the DW data in the form of 5km ...
1 vote
1 answer
284 views
How to check if a raster in PostgreSQL table is tiled
I have inherited a PostgreSQL db and I am trying to run queries like this: UPDATE geomtable a SET column = ST_Value(b.rast, 1, a.geom) FROM rastertable b WHERE ST_Intersects(b.rast,a....
2 votes
0 answers
104 views
Intersecting multiple overlaping polygon tables in PostGIS
I have a seven linestring tables that I buffered to create polygons of each line network. I then successively intersected each table (Figure 1 below). I use the following sql query, but it take 36 ...
1 vote
0 answers
35 views
Mixed results of the intersection of a line with a polygon in PostGIS
I have a line network and a some buffers. I would like to obtain the value of the buffers that the line intersects; however, I am getting mixed results that I am unsure how to interpret and solve the ...
1 vote
1 answer
72 views
How to get entity coordinates that are located inside an OSM administrative boundary?
I downloaded the administrative boundary of Germany from a website as *.geojson file. I imported this *.geojson file into PostgreSQL like this. ./apps/ogr2ogr -f "PostgreSQL" PG:"host=&...
1 vote
0 answers
78 views
ST_Intersects failed with ERROR: GetGenericCacheCollection: Could not find upper context [closed]
When I run this query SELECT ST_Intersects(ST_geomFROMTEXT('POLYGON((105.767292 35.923215,112.165502 37.269499,114.177842 33.956548,113.636058 30.975062,105.393203 30.531638,105.767292 35.923215))', ...
3 votes
2 answers
225 views
Improving ST_Intersects performance in PostGIS
I have the following query, but it takes a long time to run. I tried creating an index, but there hasn't been much improvement. Any suggestions? CREATE INDEX temp_clusters_geom_idx ON temp_clusters ...
3 votes
1 answer
96 views
Intersection of Linestring with Polygon causes column mismatch in PostGIS
I have the following sql code that intersects each linestring with a polygon. The problem is that when the linestring is wholly covered in the polygon the descriptor attribute of the polygon is put ...
1 vote
0 answers
407 views
Optimising ST_Intersects query with geometry and point
I'm trying to optimise the following SQL query, which checks a list of areas to see if the user is within one of them, based on their lat/long. The database is Aurora Postgres, the areas table has one ...