A query for geometric features based on their spatial relationship.

learn more… | top users | synonyms

1
vote
1answer
40 views

What is the correct (QGIS) syntax for a masked PostQIS spatial query?

What is the correct syntax if I want to query a masked region from PostGIS from inside QGIS ? The data is from "planet_osm_poly" (imported via osm2pgsql) and I'd like to use a polygone from a ...
1
vote
1answer
36 views

PyQGIS: How to find features <within> another feature

Using a spatial query in QGIS Desktop to select features of layer MTA_ACQ_TE_polygon that are within features of layer nts_snrc_50k works, but I am attempting to do this programatically in PyQGIS, ...
1
vote
0answers
50 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 ...
4
votes
1answer
73 views

Find Co-located points in single layer

I have a layer (currently the source is a csv file) with 130,000 points. Many of these points are co-located in a building room. How can I identify points that are within a small distance of another ...
2
votes
0answers
71 views

Select by location not selecting all features in ArcPy [duplicate]

I am having an issue with the "select layer by location" tool in my ArcPy script, that may be due to a hidden memory error. Using one feature class with 281 polygons, I would like to select all of the ...
1
vote
1answer
39 views

Which tool for custom queries? [closed]

I'm new to the GIS world, and I'm trying to work out what tool I should start with in order to analyse some data and run custom spatial queries on it. I have a data set representing the recording of a ...
5
votes
1answer
222 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 ...
2
votes
2answers
142 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,...
2
votes
1answer
40 views

Plotting points conditionally using cluster number in qgis

I have a set of locations such that there are partitioned into five clusters, I used the categorized property under styles to differentiate points belonging to different clusters using different ...
3
votes
2answers
117 views

Spatial query that doesn't seem to work

I have QGIS 2.8.2 Wien on windows 7 and quite new to QGIS. I have two shapefiles - 1 with rivers and 2 with sites located on some of those rivers. I want to carry out a spatial query to find the river ...
0
votes
0answers
22 views

Is there a way you can see the spatial query that vector uses?

I am using geoprocessing-tools --> intersections to calculate which points are within my circular buffer. It works fine but I want to know what query(/code) vector is using so I can add some ...
0
votes
0answers
34 views

Spatial Query - Select features within

Is it possible to know which Point In Polygon algorithm is used when we select points within a polygon? Is it for example the ray-casting algorithm? In addition, is there a definition of the operation ...
4
votes
3answers
188 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 ...
0
votes
0answers
37 views

Is it safe to query for points contained within polygons using a lat-long projection?

I'm querying for points contained within a polygon. All data - both points and polygons - is stored in latitudes and longitudes. Technically I should probably project this data to a suitable local ...
8
votes
3answers
541 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:\...
5
votes
1answer
270 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: ...
3
votes
3answers
239 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 ...
1
vote
1answer
41 views

Query across layers of SHP files?

I would like to query features from a SHP vector that intersect with features from another vector. Pseudocode: "Name" IS intersects( countries) How would be the valid query composed?
0
votes
1answer
75 views

How to use intersection in spatial guery in postgresql?

I want to get id, time and point_metric columns from intersection between two geometry(geom_lines and gem_houses). I wrote following sql code, however it fore an error (argument of WHERE must be type ...
1
vote
1answer
255 views

Spatial Query: The query from “LayerName” using “FID” in field not possible

In QGIS Wien, I am performing a spatial query with two layers (points and buffer areas) and receive the following error when creating a new layer with intersecting features: The query from "LayerName" ...
0
votes
1answer
107 views

SQL and ArcGIS data querying: what's the difference?

I am wondering if the language used by ArcGIS for data querying (e.g., search by attribute) is part of the SQL language, or to what extent there is a connection between the two (and where does it come ...
1
vote
1answer
87 views

PostGIS 3D bounding box query that envolves all 3 axes (xyz)

I have some experience with PostgreSQL, but not with PostGIS, and for the life of me I can't make my bounding box take the Z axis into account. I have a points table with XYZ columns. I add another ...
1
vote
1answer
98 views

Number of Neighbors Around a Point

I need to get a count of neighbors within 100m for each point in a set of 250 million points. The result would have the id of each point accompanied by the number of neighbors around them. Can this be ...
1
vote
1answer
108 views

Running spatial query on huge table [duplicate]

I've got two tables conatining geometry: 1 containing big polygon's (regions, srid=4326) and another containing smaller polygon's (pand, srid=28992, containg ~9.9milion rows) By using one of the big ...
1
vote
0answers
19 views

Help with sub-queries postgres

I wish to ask for some advice when it comes to build nested spatial expressions in postgres. I end up with the same kind of problem many times when it comes to select more than one type of geometry. ...
0
votes
0answers
92 views

Find hotspot with highest density for two objects

I'm using PostgreSQL/PostGIS and I have an advanced type of query. My database contains two types of objects - let's say homes and crime. Is there a way that I can find the area with the densest ...
4
votes
2answers
211 views

PostGIS: Strategy for fastest select by BBox with an ORDER BY polygon area clause. Cluster?

Update 2 (below) suggests 14% of the table geometries are stored out-of-line with the rest of the table records. This may be a useful clue. The Problem: We've got a table with appx 170,000 WGS84 ...
1
vote
2answers
243 views

ArcGIS Javascript Spatial Query with Lat Lng or X Y?

I am using Google Maps on the front end as all I need on this view is to show the points. When user clicks on the map in the view, it selects a point hence giving out lat and lng. I am trying to use ...
0
votes
2answers
263 views

Extracting data from four intersecting polygon layers in PostGIS

I've been using the following code in Postgres/PostGIS for the last year, as needed, which is about once a quarter. It works ok, it's just that it takes days to run. With over 25,000 parcels making up ...
4
votes
1answer
478 views

MapInfo “Boundary Select”, “Sum Attributes”, and “Update Column by Spatial Query” in QGIS? [closed]

I´m a MapInfo user, I´ve gone over to QGIS and it´s got a lot going for it, except for some "missing" simple features from MapInfo I just can´t do without.... MapInfo Boundary Select - spatial query ...
2
votes
1answer
2k views

PostGIS ST within does not exist

I'm quite new to postgresql and postgis so this error will probably due to some rookie mistake. I want to run the spatial query ST_within. When I describe the query like this SELECT nw.entity_id AS ...
1
vote
0answers
42 views

Select a polygon which is just partly member of another polygon with its area of the other polygon

I need to generate random points within geometries, which works quite good, but there are some small errors. Take the picture below. There are some greenish and redish Polygons(?!) which do not have ...
6
votes
2answers
539 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. ...
0
votes
1answer
140 views

How to show a map with queries from a map file connected to postgres in browser using javascript?

So, the problem is how to show a map in browser using javascript? I have a map file with 2 layers in it: "peta" is a shp data from postgis and "korban" is a numeric data from postgresql. And then I ...
11
votes
2answers
230 views

Identify points in a shapefile that have no other point within x km with QGIS

This is probably a naive question but I am struggling as a new user to QGIS. I have a very large shapefile (275,000 points, but can break this into about 10 subregions if necessary for faster ...
2
votes
1answer
121 views

Get feature data from lat long input QGIS

In QGIS, I have a polygon dataset with feature data. I would like to extract data from this dataset using a latitude and longitude. To be more clear, I have a list of 1000 coordinates. I would like ...
0
votes
1answer
132 views

How to run spatial query get fields value of 2 layers?

Last month I ask a question "vb.net arcobjects spatial query get fields value of desired layer only", url vb.net arcobjects spatial query get fields value of desired layer only. Now there is some ...
2
votes
2answers
1k views

drawing concentric circles in arcmap 10.1

I am using ArcMap 10.1 and I would like to know if there is a way to draw circles at a specific distance from a georeferenced coordinate. I have a property and I would like to know how far you can ...
1
vote
1answer
53 views

Spatial queries to find co-occurrences of POIs

Given a POI database containing different types of points, e.g. hospital and pharmacy, how can I select the locations where a hospital and a pharmacy are closer than a certain threshold (e.g. 1000m)? ...
5
votes
2answers
121 views

How to select random adjacent census tract

I have set of census tracts spaced out across a city and I would like to randomly choose an adjacent census tract to explore nearby demographic data. I'm not sure if there is an easy process for ...
2
votes
2answers
609 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 ...
0
votes
2answers
420 views

How to count number of points/lines/polygons contained within a polygon, when the feature to count is from a server

I'm currently running a study where I need to query the number of points/lines/polygons that are contained within a project boundary - intersecting lines and polygons need to be counted as well. The ...
2
votes
1answer
112 views

How do you create a query that will result with the adjacent parcels?

I have a shapefile with parcel data, and I am trying to create a query that will render a list or something similar that will list adjacent parcels to a specific parcel. I want to be able to select ...
3
votes
1answer
692 views

How to get the width and height of a rectangular polygon in PostGIS

I have a table with point features saved in the my PostgreSQL database, and I can run the following query to get the extent of the point features and I turned the extent back into a geometry: SELECT ...
3
votes
2answers
632 views

QGIS/PostGIS: Select Counties within Region via Spatial Query

I'm using GQIS 2.2 and PostGIS on Postgresql 9.3. I have 5 regions in the contiguous United States. Each region has states, and each state has counties. I would like to think that the data I'm given ...
1
vote
2answers
190 views

how to do simple self join and touches function in postgis?

I am having trouble with this query and neighbor calculation in PostGis. I want to find out which are the neighbors of Sweden in the table COUNTRIES which has column 'the_geom' for geometry and '...
0
votes
1answer
258 views

How can I find the segment of a line that lies within a polygon using Postgis?

Given a "road", represented by a line, that crosses a "state", represented by a polygon: What is the SQL query I can use to find the segment of the road that is within the state? A concrete example. ...
0
votes
1answer
233 views

ST_Within from centroid of geometry

I am looking at doing a spatial query where I can find when the center of one feature falls within another. For example, when the center (centroid) of a building falls within a grid tile. I know I can ...
3
votes
1answer
2k views

Problem PostGIS Spatial Query ST_Contains ST_Disjoint ST_Intersects

I'm working on a project with two different tables inside a database. One contains points in a column geometry(Point,4326) type and the second one has a column geometry(MultiPolygon,4326). Now I would ...
1
vote
0answers
29 views

Count gaps between polygon in spatialite

I have a database (.db) with a table that contains thousands of polygons containing id and geometry. I like a query that can get me the 'number of errors where there are gaps between polygons". How ...