Questions tagged [spatial-query]

A query for geometric features based on their spatial relationship.

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 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, "...
user avatar
1 vote
0 answers
39 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 ...
user avatar
  • 11
1 vote
2 answers
79 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 ...
user avatar
  • 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,...
user avatar
  • 757
2 votes
1 answer
55 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 ...
user avatar
  • 1,604
2 votes
0 answers
64 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 ...
user avatar
  • 333
2 votes
1 answer
59 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 ...
user avatar
  • 121
2 votes
1 answer
80 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 ...
user avatar
0 votes
0 answers
10 views

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

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....
user avatar
  • 121
1 vote
0 answers
55 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....
user avatar
  • 121
0 votes
0 answers
98 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: ...
user avatar
  • 20.5k
0 votes
0 answers
117 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. ...
user avatar
  • 5,207
0 votes
0 answers
44 views

PostgreSQL Trigger to Change geometry of Point on Different Polygon

Issue : I have table in Schema GIS 1. Asset ( Id, User, Begin Date, Status, Master , Geometry) 2. Room ( Id, User, Begin Date, Status, Master , Geometry) And I have table in Schema Public 1. Asset ( ...
user avatar
2 votes
1 answer
44 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 ...
user avatar
  • 2,271
1 vote
0 answers
19 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 ...
user avatar
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 ...
user avatar
  • 21
4 votes
1 answer
60 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, ...
user avatar
  • 333
5 votes
1 answer
205 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 ...
user avatar
  • 613
2 votes
1 answer
172 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 ...
user avatar
1 vote
1 answer
74 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 ...
user avatar
  • 119
2 votes
1 answer
53 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 ...
user avatar
  • 165
0 votes
1 answer
61 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 ...
user avatar
  • 199
0 votes
2 answers
308 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 ...
user avatar
  • 20.5k
0 votes
0 answers
412 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 ...
user avatar
2 votes
1 answer
165 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 ...
user avatar
  • 123
3 votes
0 answers
60 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 ...
user avatar
3 votes
2 answers
522 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 ...
user avatar
  • 1,903
2 votes
3 answers
109 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). ...
user avatar
1 vote
1 answer
39 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-...
user avatar
  • 155
2 votes
1 answer
136 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()...
user avatar
  • 1,621
0 votes
2 answers
182 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 ...
user avatar
  • 179
2 votes
0 answers
198 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 ...
user avatar
1 vote
0 answers
46 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 ...
user avatar
0 votes
0 answers
183 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 ...
user avatar
  • 173
1 vote
1 answer
108 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 ...
user avatar
3 votes
1 answer
695 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: ...
user avatar
  • 315
1 vote
1 answer
220 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 ...
user avatar
  • 3,064
0 votes
2 answers
238 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 ...
user avatar
2 votes
1 answer
123 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 ...
user avatar
1 vote
3 answers
573 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 ...
user avatar
  • 1,305
1 vote
1 answer
96 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 ...
user avatar
  • 567
3 votes
2 answers
295 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 ...
user avatar
  • 22.9k
0 votes
1 answer
167 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 ...
user avatar
3 votes
2 answers
391 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 ...
user avatar
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 ...
user avatar
  • 6,112
0 votes
1 answer
94 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 ...
user avatar
  • 63
0 votes
1 answer
191 views

How to perform Spatial Query to remove features that intersect/touch/overlap in QGIS?

I have two polygon layers and many of the features are identical (or should be identical). I want to isolate only the features that are in one layer but not the other. I'm using QGIS 3 and I tried ...
user avatar
  • 457
1 vote
2 answers
312 views

MySQL, geoPHP, select sites near the current site

I'm working with archaeological sites, stored as polygons in a MariaDB 10.3 table, and I have PHP 7.2 with GEOS and geoPHP available. I'm creating a page that displays all the related information for ...
user avatar
  • 21
1 vote
1 answer
742 views

Spatial Query Tool in QGIS 3.4

I'm relatively new to using QGIS and GIS platforms in general. I'm following a guided exercise in QGIS and need to use the 'Spatial Query Tool', however I can't seem to find it anywhere in QGIS 3.4.
user avatar