Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [spatial-query]

A query for geometric features based on their spatial relationship.

Filter by
Sorted by
Tagged with
4
votes
1answer
2k views

Finding State, County, Place, and Census Block FIPS codes from a coordinate (latitude and longitude)

I am looking for a way to gather the political areas (ie FIPS codes) from a latitude and longitude coordinate. For example, if I were to input the coordinates: 47.66955, -122.31259 (Downtown Seattle),...
0
votes
2answers
150 views

Selecting line between two polygons using MapInfo?

Just wondering if its possible to extract a line that between two polygons - hopefully the image illustrates this well - I want to extract Line A-B. I'm using MapInfo. Currently I've used the ...
1
vote
2answers
334 views

How to apply a layer definition with a spatial query to a Dynamic layer?

Using the ArcGIS Server JavaScript API, it's possible to specify an attribute query in the form of a layerDefinition against a Dynamic layer. For example, the following query will restrict the layer ...
1
vote
0answers
60 views

Generate Panel of overlapping features and export them to csv with GIS and Python

Given is a dataset, split into 250 .gml files, containing multiple vector layers. The features of interest are: parcels as polygons (~250k total), buildings as polygons (~350k total), addresses as ...
0
votes
0answers
46 views

Creating query for set of polygons which would select adjacent polygons for which combined area is greater than number?

I have a set of parcels, represented as polygons shapefiles and I need to build a query, to select all the polygons, which are adjacent, with the sum of the areas of 2 polygons,greater than 1000 acres....
2
votes
1answer
271 views

Count points not in polygon in QGIS (difference between points and layers give unexpected result)

I have a layer of 130 points and another layer of driving distances as 6 polygon features When I use the count points in polygons I get a running total of the number of points in each polygon feature (...
3
votes
1answer
139 views

Addresses within radius of vector layer in QGIS

I want a CSV file of all addresses that intersect with historical stream features. Currently, I have 3 datasets (see my blog) for this in QGIS 2.16.3 (MacOSX): a layer (.gdb) of historical stream ...
1
vote
1answer
235 views

QGIS Spatial query (joining two layers)

I have two shapefiles. One is a point layer of trees, the other is a polygon of cadastral boundaries. I want to spatially join these two layers so that I get the information, on which cadastral ...
0
votes
1answer
314 views

ArcGIS Python API FeatureLayer query by buffered point

I am really running into some problems with the Python API, I am trying to query a feature layer and return all results that fall within a certain distance of a supplied point. According to the docs ...
0
votes
2answers
281 views

automated spatial Query QGIS

I'm using QGIS 2.18.3 (Las Palmas). In order to determine the number of buildings within a district I'm using spatial Query in QGIS. I filter out the specific district within my city-layer so I can ...
3
votes
1answer
1k views

Finding polygons inside polygons from a shapefile in QGIS

I have a parcels shapefile that contains polygons. Condos are also drawn, but inside the master lot. I want to be able to grab all the condos inside the master lot. I saw this question/answer: ...
1
vote
2answers
636 views

Get <canvas> features inside a rectangle after drawing it

Let's start with https://jsfiddle.net/ziyuang/dfekwzhd/ Say, now I want to allow users to specify areas by drawing rectangles. After the map having a rectangular area, I want to have the information, ...
0
votes
0answers
119 views

PostGIS query taking too long. >400ms

The query is: Select COUNT(*) from highway_ref where (ST_DWithin(ST_Transform(highway_ref.geom,2163),ST_Transform(ST_GeomFromText('POINT(73.919595 18.5622609)', 4326),2163),500)) I am trying to find ...
1
vote
1answer
402 views

How to query “not contains” in ArcGIS Server REST API?

I want to query data that is not in a specified polygon in ArcGIS Server Rest API. How can I achieve this like below image?
6
votes
4answers
913 views

Is there a way to use a spatial query to invert X and Y coordinates in QGIS?

Original problem : I tend to often invert X & Y in WGS84 lat/long CSV import. I'm wondering now if there is a way not to reimport the original file (as this is the basic solution for points) and ...
0
votes
2answers
477 views

Performing spatial queries in Leaflet?

I have two Layers which I added to the map using WMS service. Is there a way to perform spatial queries using Lealflet, for example; Intersection, Distance...?
1
vote
0answers
117 views

Quickest Way to Calculate Land Area by Grid Cell in PostGIS

I have a grid vector table that covers the entire world and want to calculate the land area within each grid cell using another table that contains a single polygon for all continents. I tried the ...
4
votes
1answer
255 views

Is it possible to have R write out .sbn and .sbx files?

I'm working on an situation where a client wants, in addition to the .shp & .prj files that I can produce with e.g. rgdal::writeOGR, the .sbn & .sbx files as well. My understanding is this is ...
3
votes
3answers
665 views

List IDs of polygons within another polygon in the attribute table

I have two polygon shapefiles in QGIS I would like to have the polygon IDs of B listed in the attribute table of A for the case that they overlap. As a demonstration: I tried combinations of ...
2
votes
2answers
104 views

Generate a list of intersected layers QGIS

Apologies, im very new to QGIS and theres a chance what im asking isnt actually what i require, let me explain Im working with a project with multiple layers, I have a layer (lets call it layer 1) ...
1
vote
1answer
1k views

Postgis using st_geometry linestring on column

I'm trying to create a linestring based on a value in a column in PostGIS. My code looks like this: create view left_span as SELECT st_geomfromtext('LINESTRING(line_att.wkt_left)', 27700) as geom ...
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 ...
1
vote
0answers
267 views

Querying for All OSM Street Intersections in PostGIS

I created a GIS database using an OSM datafile for a single city (from Geofabrik) and imported it into PostGIS using osm2pgsql. I have around 180K rows in osm_planet_line database, a manageable sie. ...
1
vote
1answer
1k views

Postgis - Spatial relationships in metres

I'm trying to perform some spatial relationship analysis using Postgis functions like st_dwithin and st_dfullywithin. I searched and found that for any SRID, using the geography type gives the results ...
1
vote
1answer
593 views

GeoServer (CQL) query to return just the boundary polygon of a filtered feature

I have a polygon layer (in GeoServer). The goal is to just get the bounding box of a filtered feature. From the (E)CQL docs I thought the boundary filter should do the work, but I could not get it to ...
2
votes
1answer
285 views

Fastest matching on nearest point

I am a total GIS noob and am trying to read weather data from a PostGIS database. The tables contain data points consisting of a geometry, a timestamp and the actual observed variable. The tables are ...
2
votes
1answer
66 views

Finding Multistring inside multipolygon using PostGIS?

If we have below two tables, how can we find data for all multistring(vicRoads_Data table) lying inside multipolygon(patient_data table)? I tried this lung_cancer=# select * from patients_geom,...
2
votes
2answers
5k views

MySQL Using ST_CONTAINS to obtain points within a bounding box

Can someone give me an insight into why the following MySQL code is not working. I have taken some of this code from this link and it is all about just proving the concept before applying to my site. ...
2
votes
2answers
67 views

ArcGIS - Selecting features depending on 2 attributes

Ok, I guess this should be not too hard, but I can't figure it out: I have a layer "A" resulting from a layer "0" which was intersected with itself. So layer "A" contains all intersects. The ...
4
votes
1answer
157 views

Calculating mileage from linestring

I'm looking to calculate the approximate distance in miles from a linestring. This post recommends using ST_Transform in conjunction with the State Plane coordinate system for my area. In my case, I ...
2
votes
1answer
198 views

query with buffer

I have 2 points layers. One contains old address points and the second has new address points. They don't have any unique attribute with which I could join them. So, I've made a 10 metre buffer ...
1
vote
2answers
452 views

Find layerattribute at certain point

I am trying to find the closest road segment to a point that I have and return an attribute from the closest segment to the given points. How should I do that? Any suggestions? Can i use a marker and ...
0
votes
1answer
599 views

Geometry data in MSSQL - Bing Maps

I am pretty new to GIS/Mapping apps. I have obtained some parcel data/tax data and imported it into SQL using Shape2SQL. The values that I have in the DB are based of the following projection ...
2
votes
3answers
557 views

What are the coordinates on my rectangle of the closest point to a polygon in R?

I have a non-overlapping extent rectangle and a sample lake polygon. I can measure the distance from the rectangle to the polygon but I want to know which point on the rectangle is the closest to the ...
2
votes
2answers
101 views

Detect the point that lies inside line containing area

I have Two layers one is point another is line as indicated in picture. I want to know they way that i can detect that point is contains/intersect/near to the line so that I can add it's attribute ...
1
vote
1answer
107 views

How to append values of Overlapping buffers to points?

Kind of a hard to explain spatial problem here but here's the picture The circles overlap but what I need to do is to get a spreadsheet with the intersecting point data that also has all the ids of ...
1
vote
0answers
135 views

Finding points around closest point of linestring ordered by distance using PostGIS?

I am looking for a way to improve my solution of the following problem in PostgreSQL (using PostGIS). Given a point A, a Linestring B and a series of (yellow) points spread all over the area in which ...
0
votes
1answer
238 views

Calculating different features' counts with L.esri.Query

I have been using the L.esri.Query (Esri Leaflet) method "count" to add up the total amount of features falling within a given area. That works fine when using individual features classes at a time (...
2
votes
1answer
115 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 polygon from a ...
1
vote
1answer
400 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
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 ...
4
votes
1answer
197 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
83 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
50 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 ...
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 ...
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,...
2
votes
1answer
170 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 ...
2
votes
1answer
501 views

Find nearest point given coordinates from another table [duplicate]

So I have two tables, one table is called stores which has the name of the store as well as the geom column that contains the coordinates for the stores. The other table is customers which has the ...
3
votes
2answers
722 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 ...
4
votes
3answers
817 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 ...