Questions tagged [spatial-query]

A query for geometric features based on their spatial relationship.

Filter by
Sorted by
Tagged with
3 votes
2 answers
59 views

How can I use spatially filtered PostGIS layers in QGIS without losing the ability to edit them in QGIS?

I have some vector layers for a whole country stored in a PostGIS database. I want to use that data in different QGIS projects that stand for different regions of the country. In the regional QGIS ...
  • 2,015
0 votes
0 answers
41 views

QGIS select one by one feature in a layer

I'm trying to select features one by one on a layer. I have a line layer, I've created a buffer layer from this, and then what I want to do is to select one by one feature on the buffer layer, do what ...
  • 33
3 votes
1 answer
128 views

How do I optimize a spatial query in PostGIS

I'm trying to speed up my query which should return only these polygons that are not completly overlapped by polygons above them. My tables looks like this: Map -> Layer -> Object The object ...
  • 423
0 votes
1 answer
25 views

Sample Multiple Raster Layers Python QGIS 3.26.1

I would like to Identify the value of 15 tiff files at the same coordinates. I am currently using an external python script which iterates through each file. How would I do this with the QGIS Python ...
  • 33
2 votes
2 answers
155 views

PostGIS query with ST_Intersects/ST_Contains is incredibly slow

I want to run a PostGIS query that selects roads (total dataset: 103 mio.) that are inside a buffer polygon. The subqueries as standalone are very fast, but when I add the ST_Contains or similar ...
0 votes
1 answer
49 views

How to add a PostgreSQL query table to QGIS

I have queried my database with the following: SELECT tlblocation.id, tlblocation.geom FROM "Municipalities_NL", tlblocation, tlbvenueactiveperiod WHERE st_within(tlblocation.geom, "...
1 vote
0 answers
114 views

Use spatial query to load WFS data into QGIS

I tried to load a WFS into my QGIS project but the number and complexity of the polygon features are to high to handle for QGIS so that it throws an error. So I tried to add a spatial query to the ...
  • 21
1 vote
2 answers
175 views

Using Spatial Contains in PostGIS

When performing Spatial Contains query I am not getting expected results. I have below use case where I want only those small polygons as shown in first image namely (1,2,3,4,5,6,7,8,9) whose geometry ...
  • 59
2 votes
0 answers
35 views

Can I build a QGIS query based on the boundaries of a clipping polygon?

Several times a year I download a very large shape file which contains details of the road network of my home state. That shapefile (I'll call it the master file) is regularly updated by the provider,...
  • 777
2 votes
1 answer
78 views

st_intersects with ST_Dump throws PostGIS exception

I have a query in my lines and points table. My lines table includes MULTILINESTRING, MULTILINESTRING Z, LINESTRING geometry type data. select * from sde.line h2 left join sde.points b on ...
  • 1,634
2 votes
0 answers
95 views

Virtual layers w/ spatial query not working as before (3.18.1 vs 3.20.3)

I have a set of maps that intensively utilizes virtual layers, but last week our boss updated from QGis 3.10/3.18 to 3.20.3 in all PCs, and now the layers are not loading. Normally they would refresh ...
  • 343
2 votes
1 answer
85 views

Searching shapefile for zone containing coordinates in lat/lon format using GeoTools

I'm new to GeoTools and GIS generally. I have a shapefile containing feature polygons representing NY City taxi zones. I also have the coordinates in latitude and longitude for the pickup and drop-off ...
  • 121
2 votes
1 answer
99 views

Fast AOI polygon query for matching mosaic dataset footprints

Is there any more efficient/faster way to query a mosaic dataset raster catalog (footprints) for records matching an AOI polygon? This implementation gets slower the larger the AOI polygon is. import ...
1 vote
0 answers
70 views

ArcGIS Server spatial query returns geometries only if they intersect all sub-polygon in multipart polygon

Single-part polygon as an input is a common use case of spatial query, it works fine. However, I am encountering a case that I need to take a multipart polygon as an input to query some point features....
  • 113
0 votes
0 answers
138 views

What is the syntax to query a raster layer in ArcGIS Server?

I'm familiar with querying a feature layer in the ArcGIS Server REST API, for example including a where clause, specifying the desired output fields, choosing whether or not to return the geometry: ...
  • 20.6k
0 votes
0 answers
147 views

Missing PostGIS functions in QGIS?

I would need to use PostGIS functions like ST_Subdivide or ST_SquareGrid; these seem however not to be available on my QGIS 3.20 installation. Most other ST_* functions are there and work as expected. ...
2 votes
1 answer
53 views

Constructing spatial queries that include data from non-spatial tables in PostGIS

I've got a database with the following tables CREATE TABLE survey ( id_s integer primary key, eventdate timestamp without time zone, locality character varying(100) geom geometry(Point,25830)) CREATE ...
  • 2,452
1 vote
0 answers
23 views

ArcGIS spatial query returned wrong count and ID list

I am currently encountering a very perplexing issue: I have an ArcGIS feature layer of polygons I am trying to query if any polygons in the feature contains a specific point When I call the API to ...
2 votes
0 answers
42 views

Calculating how many points are in each polygon, grouping that polygon by a field in PostGIS

I have two shapefiles: One point file (occ_master) and 1 polygon file (geol_1m). The point file represents mineral occurrences. The polygon file represents geology, which can be subcategorized by ...
  • 21
4 votes
1 answer
74 views

Splitting Multipart geometries using Virtual Layer in QGIS

I have a Virtual layer already set up and working, the only thing that could make it better is getting rid of multipart geometries. The query is: SELECT ejido, circ, radio, mzna, cc, ten, ...
  • 343
5 votes
1 answer
250 views

Determine whether a polygon is completely surrounded using QGIS [closed]

I have a shapefile dataset of polygons. I would like to find those polygons that are completely surrounded/enclosed. Mathematically, this means that the perimeter of Polygon A should equal the sum of ...
  • 613
2 votes
1 answer
216 views

How can I get values from a array (which is evaluated by spatial query) as default-values in other fields

In QGIS 3.16.0 I have a postgis-polygon-layer with a field "array_polygon" which contains an array. When digitizing a postgis-point-layer-point I would like to use the different array-values ...
1 vote
1 answer
82 views

ArcMap 10.1 Slow Performance with VB.NET Code (Spatial Query) [closed]

We have just installed ArcGIS 10.1 and MS Visual Studio 10 (Dot Net Framework 3.5) to develop automation tools for Select by Attribute and Select by Location using VB.Net. We developed a new add-in ...
  • 119
2 votes
1 answer
85 views

PostGIS: Creating Polygon from lots of other geometries and then returning list of ID's in the same query

I am fairly new to all of this but in simplistic terms I have the following problem: I need to create lines from points, and from said points group all of those within n distance of one another. From ...
  • 165
0 votes
1 answer
88 views

How to build a GET request from a CSW POST request

For accessing some data in a GeoNetwork metadata catalogue using CSW, I would need the URL for a GET request that would include also a geospatial filter (bounding box) and a time of interest (start ...
  • 199
0 votes
2 answers
373 views

How to "Select By Location" in ArcGIS Server JavaScript API

Is it possible to perform the equivalent of "select by location" in the ArcGIS Server JavaScript API v4.x? The use-case is "find features in Layer 1 which are within x kilometres of ...
  • 20.6k
0 votes
0 answers
437 views

Spatial Index warning from Spatial Query

I'm trying a spatial query using QGIS version 3.10 using a buffer layer and a set of species records. I wish to know how many species records fall within the buffer. When I perform the spatial query ...
2 votes
1 answer
216 views

Does ArcGIS Server support querying multiple layers of service in single request?

I am using ArcGIS REST services from a server-side app and parsing the JSON response. I need information from several different layers on the same service, and my queries are always for points. Is ...
  • 123
3 votes
0 answers
62 views

Symbolize thousands of polygons to identify similar geometries

I would like to categorize polygons with a similar enough geometry so such similarities can identified at a city-wide scale. I'm trying to identify if street layout is a useful spatial characteristic ...
3 votes
2 answers
695 views

How do I precisely select lines within a polygon in QGIS?

I want to select lines (bahnstrecken) within a polygon (bundesland). My goal is a selection shown in the following screenshot, which I did manually. Before I used two tools: I converted the polygons ...
  • 2,015
2 votes
3 answers
129 views

Spatial query to return multiple values

I have a woodland scheme advice layer that has a polygon for each area of advice (brown layer in the picture). I also have a polygon layer of UK local authorities (red boundary layer in the picture). ...
1 vote
1 answer
43 views

How to find features from edge_id in PostGIS topology?

I have created topology for a set of tables with PostGIS topology extension. Now, I want to get all linear features (which could be in different tables) connected to a particular line using a non-...
  • 155
2 votes
1 answer
171 views

Change GeoPandas column value from PostGIS query

I have some QGIS layers and I am performing some spatial queries with them using GeoPandas. I'm using psycopg2 to make a connection to a local PostgreSQL/PostGIS database. Then I use the read_postgis()...
  • 1,661
0 votes
2 answers
219 views

QGIS Modeler: Extract by location, multiple predicates

I'm creating a processing model and would like to use the 'extract by location' tool, The problem is that when I choose this tool from the 'Algorithms' in the model creator, I cant find the double ...
  • 179
2 votes
0 answers
221 views

How to do nearest neighbor search more quickly?

I am currently using geopandas and scipy.spatial to do a nearest neighbor query. I have a data set of close to a million points and I need to find all of the closest points from another data set that ...
1 vote
0 answers
64 views

Populating linestring column based on other table values (OSM nodes/ways)

I'm trying to populate a linestring column using points from another table. After reading a lot in this site and many experiments I'm still stuck. This is the table which I want to fill the road ...
0 votes
0 answers
217 views

WFS request using layer extent or spatial query QGIS3

I'm trying to request features from wfs-service by using a virtual layer. Is it possible to load features by using a layer extent from a virtual layer? I know how to add dimension for a request with ...
  • 173
1 vote
1 answer
117 views

How do I perform a spatial query on this area? [closed]

I am in the process of trying to perform spatial analysis bike on bicycle trip data publicly found on Citibike's website. I want to extract data for each square in the rectangle (the boundary-lines ...
3 votes
1 answer
828 views

Is it possible to query a geopackage (.gpkg) for features within a given bounding box?

I have GIS data with a very large layer stored within a geopackage from where I want to select features that fall within a bounding box calculated in my R session. I begin by creating a query string: ...
  • 335
1 vote
1 answer
245 views

Count subset of points in polygons

Being an SQL-noob, I found a working solution to generate a virtual layer with counts of points in the polygons of another layer, inspired by this https://gis.stackexchange.com/a/54680 SELECT ...
  • 3,097
0 votes
2 answers
264 views

ArcGIS JavaScript 3.3 add ArcGIS REST API Queried Feature Layer URL as Layer

Using the Query Generator on an ArcGIS REST Feature Layer, I generated a URL that filters the data by a geometry extent ({xmin: -104, ymin: 35.6, xmax: -94.32, ymax: 41}) This returns Current River ...
2 votes
1 answer
166 views

Table join or virtual layer to match multiple points to geometry

I have: a non-spatial table of multiple test results with reference to non-unique locations, and a spatial layer that has all the locations (multiple results per location) I can do table joins ...
1 vote
3 answers
806 views

PostGIS : closest line from a point

I need to identify the closest line from a point. Elements are stored in a postgreSQL/postGIS database, in the same projection. From a point (geom multipoint to be specific), I need to identify the ...
  • 1,359
1 vote
1 answer
113 views

Optmizing PostGIS minimum distance query

I have the field_1 of my Table_1 that must have the minimum distance between the geometry of my Table_1 and any geometry of my Table_2. To do so, I used a CROSS JOIN (Full Cartesian Product) between ...
  • 567
3 votes
2 answers
343 views

Selecting lines where start and end points within polygon using Virtual Layer

In QGIS 2.18 project there are several layers, lines and polygons respectively My task is to select all lines when their start and end points are laying within polygons using Virtual Layer, see image ...
  • 24.6k
0 votes
1 answer
189 views

Improve Performance of ST_DWithin - H2GIS

I have a table seg_point, that I create like this: CREATE TABLE seg_point (id INT AUTO_INCREMENT PRIMARY KEY, segmentid TEXT, geom GEOMETRY); And I'm trying to improve the performance of this query ...
3 votes
2 answers
404 views

Comparing and find out which feature has highest shape area in QGIS?

I need to find out which polygon is having more area by filtering unique ID. the problem is I have 1000 of features which I need to find out highest occupied area for every unique value... since I ...
2 votes
0 answers
1k views

DBeaver spatial output window: Is it possible to sync/filter spatial query to map bounds?

While upgrading PostGRES/PostGIS from 9.x to 11.x, I have discovered DBeaver and so far I am pleased. Apparently it has some spatial integration, including the ability to visualize spatial data ...
  • 6,220
0 votes
1 answer
96 views

Constructing query to return values from all polygons that line passes through using SpatiaLite? [closed]

I want an SQL query in Spatialite to return a list of values (Primary Key in this case, but could be any value) from all the polygons which are crossed by a line. Say, for example, a footpath passes ...
user avatar
2 votes
2 answers
1k views

Spatial query with clip (PostGIS)

I'm making the transition from GIS to PostGIS and am stuck on this spatial query. I have background geometry (purple, outlined red) which has an overlay of islands (blue, below); I need the area of ...
  • 63