Questions tagged [spatial-query]

A query for geometric features based on their spatial relationship.

Filter by
Sorted by
Tagged with
4
votes
2answers
4k views

Postgis, get the points that are x meters near another point, in meters

I'm trying to find the points within a certain distance, in meters, from another point. I'm using the function ST_Buffer, but I don't get how to express the distance in meters. I'm trying with ...
7
votes
1answer
1k views

How to build a query/expression to select specific points within a buffer? (in QGIS)

I have a point layer in QGIS. Each point represents a tree and each tree has information about its height as an attribute. I would like to build a query/expression to select all those trees that have ...
3
votes
3answers
2k views

Remove islands and completely surrounded polygons after polygonization with QGIS

I have a line map of buildings in a city. I was able to correctly polygonize the buildings in QGIS with the Polygonize processing algorithm. All the holes/islands became features as expected. Now I ...
9
votes
3answers
3k views

Performing a Spatial Query in a loop in PyQGIS

What I am trying to do: loop through a point shapefile and select each point that falls into a polygon. The following code is inspired by a spatial query example I found in a book: mitte_path = r"D:\...
7
votes
1answer
2k views

How to use qgis:selectbylocation in PyQGIS?

I am trying to use the processing toolbox to perform a spatial query (points in polygon). I am not sure how to use the tool and I keep getting Error: Wrong number of parameters. Here is my script: ...
0
votes
1answer
144 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.
13
votes
1answer
7k views

What is difference between ST_DWithin and ST_Distance for proximity search in PostGIS?

I have records stored in a table with latitude/longitude coordinates stored in a geometry field. I want to find all records nearby a user supplied reference point. Note "nearby" probably means less ...
6
votes
2answers
729 views

Find start of river

Edit: Follow-up question here (= Find headwater polygons). How can I determine the start of a river in PostGIS? I have a river network (Multiline) and want to find the startpoints of the rivers. I ...
4
votes
3answers
814 views

Quickly make server side spatial filters for WFS layers based on other layer's selected geometries in QGIS

In QGIS 2.12.1, I have a WFS layer which is huge so I don't want my users to load it entirely but only parts of it based on intersections with geometries. Today, I'm using the query builder and ...
3
votes
1answer
7k views

spatial query st_contains postgis

This seems too simple to be asking this but I am really new to PostGIS/Postgres have been going around in circles with this. I am performing a really simple spatial query where I would like to make a ...
4
votes
2answers
3k views

Update field based on spatial query (QGIS)

I was an intermediate user of MapInfo and have recently converted to QGIS. I would often use MapInfo to add a column in boundary file A saying which zone in boundary file B it is contained in. However,...
3
votes
1answer
187 views

Spatial query, embed in layer or project

I have 2 vector layers: 1) Polygons with parcel-boundaries 2) Polygon with project-boundaries I want to query all the parcels that are within the project-area, using spatial query 'select parcels ...
2
votes
2answers
1k views

vb.net arcobjects spatial query get fields value of desired layer only

Currently I am using ArcObjects (10.2.1) in vb.net (vs 2012). What I intent to develop is a spatial query tool. There are 2 steps in the function: (1) Use "Select Features" tool in ArcMap to select ...
1
vote
2answers
310 views

geoprocessing across multiple vector layers QGIS2

I have 6 layers of point data (each layer is one year), where data in each layer are distributed throughout a grid, and the grid is identical in each layer. I'd like to extract data from each layer, ...
1
vote
0answers
180 views

Combining attributes of point data within buffer using QGIS?

I have city data broken down into intersections and roads. Around each intersection, I have created a buffer. I also have parcel data, including the attribute "gross tax 2015" for each parcel. I ...