Skip to main content

Questions tagged [spatial-query]

A query for geometric features based on their spatial relationship.

Filter by
Sorted by
Tagged with
5 votes
2 answers
2k 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: ...
Kenji's user avatar
  • 377
1 vote
1 answer
341 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 ...
Bernd V.'s user avatar
  • 3,239
0 votes
2 answers
409 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 ...
Just_African_Developer's user avatar
4 votes
1 answer
456 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 ...
benny the spaceman's user avatar
1 vote
3 answers
2k 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 ...
GeoGyro's user avatar
  • 1,656
1 vote
1 answer
187 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 ...
Basile's user avatar
  • 617
3 votes
2 answers
647 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 ...
Taras's user avatar
  • 33.9k
0 votes
1 answer
263 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 ...
dunnj515's user avatar
3 votes
2 answers
459 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 ...
Gobinath's user avatar
2 votes
0 answers
2k 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 ...
elrobis's user avatar
  • 6,486
0 votes
1 answer
102 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
5 votes
1 answer
4k 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 ...
Jeff's user avatar
  • 95
0 votes
1 answer
269 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 ...
jfact0ry's user avatar
  • 487
1 vote
2 answers
600 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 ...
vrteach's user avatar
  • 21
1 vote
1 answer
884 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.
Hope Hancox's user avatar
0 votes
1 answer
574 views

Querying coastal roads using overpass turbo

Is it possible to query overpass turbo using some kind spatial filter? I would like to download "coastal" roads data, coastal currently being defined as within 0.20 km from the coast. The ...
mikeLdub's user avatar
  • 1,235
3 votes
2 answers
110 views

Locating where different polygons (buffer rings) from different layers are intersected based on same attribute value (QGIS)

I need to locate where different polygons (buffer rings) from different layers are intersected based on a same attribute value. As shown in the figure, there are different buffer rings from different ...
GisAmateur's user avatar
0 votes
1 answer
66 views

Error message when trying to create a new layer using the Spatial Query tool

Simply trying to create a new layer where points (which represent tick occurrence) are contained within a UK boundary shapefile as opposed to working with points for the whole of Europe. When I try ...
Matthew Davies's user avatar
0 votes
0 answers
149 views

Using a spatial query to filter the atlas pages in QGIS

I would need to create an atlas of all the map sheets (red rectangles) that refer to a specific municipal territory (for example the selected yellow polygon) as in the image. The atlas coverage layer ...
Andrew-63's user avatar
  • 653
1 vote
2 answers
163 views

How can I check if two attributes match between a point and the area within which the point is located? in QGIS

I would like to verify a geocoding process. I have used googles API and have geocoded about 35.000 adresses within Austria. By inspecting the locations it is obvious that a few lie outside of Austria (...
otter's user avatar
  • 33
0 votes
1 answer
158 views

Conditional join or query of two layers

I have two layers that I'm trying to conditionally join. One layer JUNCTIONS has junction IDs (NAME) and flooding volumes (Flood_cf) for each junction. I'm interested in identifying and symbolizing ...
Ayman Alafifi's user avatar
0 votes
2 answers
2k views

How to extract Z data from a shapefile from points on another separate layer QGIS

I have two layers; one with elevation data (m), and the other with roads (derived from points via points to polyines). I want to run a spatial query that basically extracts the elevation data from the ...
Ben Turner's user avatar
6 votes
1 answer
4k views

Spatial join attributes based on closest point in PostGIS

I have two point tables from which I want to extract a value from one table to the other, based on the nearest distance of those two points. t1 t2 id | value id 1 | 100 1 ...
cf2's user avatar
  • 301
2 votes
0 answers
1k views

Optimizing MySQL query to select all points with in a large polygon using spatial indexes

Re-posting it from stackoverflow as per their suggestion. Link to the thread in stackoverflow https://stackoverflow.com/questions/53182385/optimizing-mysql-query-to-select-all-points-with-in-polygon-...
Rohith Mohan's user avatar
3 votes
1 answer
60 views

Making UPDATE for coordinate does not return the same value

Being totally new with PostGIS, I am trying to UPDATE one of my column on my table. The column itself is called 'center_point' with type of GEOGRAPHY(Point,4326) UPDATE cities SET center_point = ...
Jeremy's user avatar
  • 133
1 vote
1 answer
224 views

Using multiple St_Dwithin clause result in a huge performance loss

In PostgreSQL using PostGIS, I want to find every point which are close enough of some other points but which also are far enough from another points series. So here is my query : SELECT pod.id, ...
Louis's user avatar
  • 45
3 votes
2 answers
349 views

Test if a spatial query contains another

I have two tables : country and regions. Country contains all the Europeans countries and regions contains some subdivisions of those countries. I created a small Union of some countries and regions. ...
Louis's user avatar
  • 45
3 votes
0 answers
272 views

Attribute Values not showing when running a query

The attribute values are not displayed for the 'Model Number' field when running a query yet the attributes are stored in the attribute table(When I say all unique, nothing comes up)!!
L.Camille's user avatar
0 votes
2 answers
1k views

Oracle - find N neighbors (points) of a point within a radio

I have this table, there it goes a sample output to show that it is a point select SDO_UTIL.TO_WKTGEOMETRY(geo) from places where id=1 _______________________________________________________ POINT ...
Naty Bizz's user avatar
  • 191
2 votes
1 answer
339 views

Finding number of point features located within a polygon layer using L.esri.query

I am new to JavaScript and Leaflet, so please bear with me. I am working on a Leaflet map in which I am calling in two separate REST layers, a point layer (heritage trees) and polygon layer (...
adastrus's user avatar
0 votes
1 answer
803 views

How to select features that are outside the boundary of a polygon

I have a polygon that there are some partitions inside its boundary and some partitions outside its boundary. My question is how to select the partitions that are outside the boundary of the polygon? ...
parastoo's user avatar
1 vote
1 answer
63 views

Can a spatial query be run within the GUPS software for Census LUCA review?

I am currently conducting a LUCA review on address points within our locality for the decennial census review. The software provided is called GUPS; however, it is QGIS based with custom plugins. I ...
Robin's user avatar
  • 21
3 votes
1 answer
4k views

Improving the speed of a Postgis spatial query

I have a query that is slow on PostgreSQL 9 + PostGIS (running on a Linux computer), despite my efforts to improve its speed. I basically have a table that contains Polygons called polygones_zones. ...
Darth Kangooroo's user avatar
2 votes
1 answer
208 views

QGIS spatial query - points within certian elevation contour intervals

I'm struggling to find a way to identify all the points within certain contour intervals. I have a raster dataset that I generated a contour map from. Within the region of interest, I have a specific ...
Jon's user avatar
  • 23
3 votes
0 answers
46 views

QGIS Spatial Query Providers Issue

During the tutorial : http://www.qgistutorials.com/en/docs/performing_spatial_queries.html I have a error message like below. [ What is the providers mean? I really try to figure it out but ...
Jungseok Cho's user avatar
2 votes
1 answer
2k views

ST_Contains for 3D geometry

I want to query which ward contains the most cycle stations (a cycle station is a 3D geometry i.e. polyhedral) - the wards are 2D polygons - below is what I have worked out so far - The error I get ...
hazard335's user avatar
2 votes
0 answers
181 views

ArcGIS JavaScript API find the polygon a point belongs

I have a shapefile containing polygons and whenever a user searches an address I store latitude and longitude of the location. I want to know which polygon this address belongs and I have id assigned ...
CS Help's user avatar
  • 21
1 vote
1 answer
2k views

How can we export selected features from multple shapefiles in a single step

I have made a spatial query in ArcGIS where i am selecting features from multiple layers from a single source. How can I export all the selected features from multiple layers at a single step?
ashish kumar's user avatar
12 votes
3 answers
16k views

Where is Spatial query in QGIS3?

I just installed QGIS 3.0 EA. I wonder where the Spatial query is? There is a ”count points in polygon” in the toolbox but it can’t count point within a polygon.
Tobbe's user avatar
  • 611
1 vote
0 answers
57 views

Spatial query and sending SMS - Which techno on mobile? [closed]

I would like to set up a mobile application to send SMS messages to nearby contacts. To make it simple, here are the steps in the process: The user opens the app and adds a point on the map. A script ...
Algous's user avatar
  • 19
3 votes
1 answer
2k views

Spatial Query for a Virtual Layer

I would like to use SQL to create a virtual layer in QGIS by clipping information from a large data set using a bounding box around my study area. I have two questions. Is this an efficient way to ...
eyerah's user avatar
  • 197
2 votes
1 answer
327 views

ArcObjects spatial filter not working for File Geodatabase

I do not know why my tool no longer functions properly when working in a file geodatabase (FGDB), as opposed to the personal geodatabases (PGDB) used in the past. The tool is used to find feature in ...
Barbarossa's user avatar
  • 5,847
0 votes
1 answer
518 views

Finding POIs in Postgresql around point

I'm trying to select POIs from around given location within some distance. I tried so far two approaches I found online, but unfortunately none seems to be working - I'm getting no rows despite the ...
sebap123's user avatar
  • 101
3 votes
1 answer
73 views

One Record Two Point Geometries - Point-in-polygon

The trip data contains the origin-destination of each trip, and both origin and destination are stored as geometries. How could I retrieve the origin and destination polygons that the points are ...
banbar's user avatar
  • 1,009
1 vote
1 answer
85 views

Saving borough boundaries as MultiLineStrings or MultiPolygons?

I am creating a database in PostGIS and I have a column that will save the boundaries of boroughs. The app will later query the database, asking what points, lines or polygons are inside those ...
slevin's user avatar
  • 1,139
3 votes
2 answers
459 views

QGIS Spatial query error

I have a layer of a csv file with around 700k rows and a polygon layer, both are in wgs84. I'm trying with the spatial query to calculate what point are in the polygons. The problem is that the ...
Tobbe's user avatar
  • 611
-1 votes
1 answer
701 views

ST_Covers returning false with PostgreSQL/PostGIS

I have two lon/lats that I've turned into geometry. I've tried having the column type being both text and geometry. I have a fence_geom and a user_geom. I am looking to test to see if the user is ...
Sharkboots's user avatar
1 vote
1 answer
856 views

Counting points out of polygon using QGIS?

I would like to count the amount of points that are out of the polygon because I need to sum them. I know how to count how many points are inside but in need to find how many there are outside.
K. bar's user avatar
  • 23
1 vote
1 answer
462 views

PyQGIS spatial query geometry function disjoint incorrect output

legend=iface.legendInterface() layers=legend.layers() layer1=layers[0] layer2=layers[2] pointCounter=0 for pointFeat in layer1.getFeatures(): pointGeom=pointFeat.geometry() for polyFeat in ...
drama's user avatar
  • 377
6 votes
1 answer
408 views

PyQGIS spatial operators(contains,equals,etc.) w.r.t. layer geometries(polygon,point,line,etc.)

I am trying to implement QGIS spatial query functionality in my plugin. I want to eliminate spatial operators which are not suitable for certain geometries. For eg. when I select layer with point ...
drama's user avatar
  • 377