A command used to retrieve information from a database

learn more… | top users | synonyms

2
votes
2answers
1k views

Built a query for polygon Shapefile in R

I use the package maptools to read in Shapefiles in R. I would like to know if there is a function that can built up a query/subset to select only some Polygons based on a specific attribute in the ...
3
votes
2answers
116 views

How to query for a specific point, within a specific polygon?

I have a shapefile points layer, with each point representing either Marginal, suboptimal, or optimal conditions. I want to find only the marginal points within a specific polygon from my catchments ...
2
votes
1answer
285 views

Merge attribute data using spatial query in QGIS

I have 2 vector layers that I wish to correlate attributes - a shape file containing boundary polygons and a shape file containing point locations. I'm using the vector>spatial query tool to generate ...
3
votes
1answer
152 views

Filter contour lines in QGIS

I have a shapefile of contour lines, with an ALTITUDE attribute with the height ASL in metres. The source data is in 0.5m intervals, but I'd like to filter it down so I get contour lines at (for eg.) ...
1
vote
2answers
382 views

What are the options for working around the max number of records returned for a query task on ArcGIS Server 9.3.1?

I'm trying to return polygon features that intersect a larger polygon which defines my area of interest. It is working in some cases, but when the area of interest gets large (7000 intersecting ...
1
vote
1answer
809 views

Querytask/query - executed select

Is there a way to get to the query condition, which is executed under the querytask ? I have an example, which is actually a copy of this ArcGIS example ...
1
vote
1answer
208 views

How can I change SQL query through a layer of an action (python)?

I have three layers from three diferent database tables. When I click in other layer I want to change (with an action) the query of that three layers. How can I do that? Thank you
4
votes
3answers
517 views

How to create Where Clause from user input via Python list?

I am trying to perform a query based on values in a Python list. The where clause will then be used in an Update Cursor, so that the rows NOT equal to the values in the list will be deleted. This is ...
3
votes
1answer
400 views

Reading OGC geometry data from SQL server using R

I would like to write a script in R that creates a map using OGC geometry data that is stored on a Microsoft SQL server. Is there a way to read OGC geometry data using a query passed from R? Maybe ...
0
votes
1answer
118 views

In QGIS can I show just the lines in a Postgis query? How can I do that?

I have three tables in Postgresql, each table with one layer of lines. I want to show the path of an initial line to another final. Is it possible executing a SQL query? Thanks My three tables are ...
4
votes
1answer
897 views

How to Find points in a Kilometre radius

I am new to PostGIS and GeoData. I need to find where the lightning has stroke by a period of time and kilometre radius based on a given location. I have given lon/lat and my table is: latitude ...
1
vote
1answer
306 views

How to get the nearest line to a feature?

I have features on map, and i want to get the nearest poly-line to each one. How to write spatial query to get the nearest one. I tried to use ISpatialFilter but i couldn't reach anything.
5
votes
1answer
821 views

How to speed up an st_intersects() query?

I have a "huge" spatial database: 72GB, 200 millions documents with geometries (points) I have a GIST index on the geometries the database: CREATE TABLE resources ( id bigint NOT NULL, accuracy ...
2
votes
2answers
384 views

Selecting lines occupying identical positions in MapInfo or QGIS

I have two shapefiles from a client, one is their entire network (complete with unique IDs) and another a selection I need. However the selection file does not have unique IDs but the entire one does. ...
1
vote
0answers
512 views

ArcGIS API Javascript - FeatureLayer from json: problem with queries and popup

Hello everybody I've tried this code proposed by Derek Swingley in JSFIDDLE: JSFIDDLE-FeatureLayer from JSON Everything "seems" to work fine, but not always. If you go down to the closer scale (level ...
0
votes
1answer
44 views

Isolate And Save Raster Features From Existing Multivalue Raster Map

I have Cyprus Corine map with 44 different types of land use. I want to run a raster calculator query or any other way to isolate the areas with codes 10 to 22 and 26 to 34, all other values 1 to 44 ...
1
vote
1answer
86 views

How to get routes in the database that intersects circle?

I have routes (linestrings) recorded in the database. I want to create a query which returns the routes that have some commonality with a circle whose center and radius are passed as parameter. I ...
8
votes
2answers
2k views

How can I more efficiently select related records?

Below is the code I'm using to replicate the "related tables" button in ArcMap. In ArcMap that button selects features in one feature class or table based on the selection of features in another ...
1
vote
0answers
170 views

Query to find lat/lon of a house by street.name & house.number

How can I get house coordinates (latitude, longitude) by street.name and house.number? If it is possible, how I can get it? Many thanks!
4
votes
3answers
2k views

How to join two tables using date, time, lat and lon as common field?

I am sorry if the question is elementary but I did not find any clear discussion or guide to understand how to run a query in postgresql. So that a pointer to another website would be also useful. ...
8
votes
3answers
2k views

How to query all records (>1000) and export to csv?

I posted in arcgis forum but never got any answer. Can anyone tell me how to solve this? Assume you have a vehicle tracking records from Oct.1 to Dec. 31 with wind speed information. All data is ...
2
votes
1answer
152 views

How to best execute the same query on many different vector layers?

I have some vector layers in my project and I need to separate the polygones by area (I need a copy of all shapes > 2ha). I know how to do this for each separate layer (query) but is the a tool to do ...
5
votes
2answers
1k views

How do I use QGIS python console to iterate through simple layer queries and png outputs?

I'm really new to QGIS coding and I'm having a hard time finding (especially) the api classes/functions to carry out actions of the Query Builder window. I'm basically trying to do this: Iterate ...
3
votes
1answer
248 views

How to filter layer of osm data?

I have a table osm_roads that has a column named geometry geometry geometry(LineString,900913). If I want to filter a city to draw districts, I cannot do it by geographic coordinates? What if in ...
2
votes
1answer
702 views

How to save WMS getFeatureInfo points to a layer?

This may be a poorly worded question, because I am not sure of the exact terminology, but I'll give it a shot. I have imported a vector layer from a WMS server into QGIS. I am able to query the ...
5
votes
2answers
1k views

PostgreSql query problem with aggregate functions

I need help with a PostgreSql query. I need to find all parcels which have bigger area then average. I'm using this query: SELECT OBJECTID FROM parcela WHERE ST_Area(geom)<(SELECT ...
5
votes
1answer
1k views

Querying Data with a 1-Many Relationship Class

I have created a relationship class similar to the one I posted about in this question. Essentially, there is a point feature class representing a location of vegetation clearing with attributes ...
13
votes
3answers
4k views

Idiots guide to expressions for QGIS

I have no formal training in GIS and have learned on the fly with ArcGIS 9.3 at work and have been dabbling with QGIS on my own time for my business. Is there any resource recommendations ingeneral ...
5
votes
1answer
591 views

How to run custom queries on vector layers and display results?

Is there a way to display the result of a query in QGIS? For instance : To get the total number of inhabitants : SELECT SUM( inhabitants ) FROM countries To get the total density : SELECT ...
0
votes
1answer
692 views

How to make Stored Queries for WFS 2.0.0 in Geoserver

I am a new user of Geoserver. I have created a WFS and also could connect it with the QGIS WFS 2.0.0 Client plugin available now. But as like the default WFS link in that plugin I am not able to make ...
2
votes
1answer
239 views

How to filter or query data in GRASS?

I have a PostGIS dataset with just over 2 million rows. Each row has a PostGIS geometry point value and several attributes. I'd like to do some analysis on certain subsets of the data, but I can't ...
10
votes
3answers
976 views

How to speed up queries for raster databases?

I have a raster database in postgresql/postgis with these columns: (ID, rast, data_of_data). 'rast' is the column that has raster files in WKT format. An example query to find the DN value of a ...
2
votes
2answers
452 views

How fill length and feature count in PostGIS table for each polygons

I'am new to PostGIS/PostgreSql. I have a database which containts two shape-files : polygonal layer towns and linear layer of roads To calculate the length and feature count of 'Streets' inside ...
2
votes
2answers
1k views

Spatial index to speed up the query

I have spatial table in PostgreSQL 9.2 / postgis 2.0 that I have to extract some information from it. But my query is hopelessly slow. How could I make use of spatial index to improve the performance ...
3
votes
2answers
156 views

Multiple queries in a row

I have osm data imported into PostgreSQL with osm2po tool (wich makes the data routable). Also I have imported data relationed with nodes and node_tags with osmosis tool. I need to obtain a set of ...
3
votes
0answers
410 views

How do I determine appropriate Date query syntax for a layer?

I'm writing a web mapping query tool to query Esri mapservice layers by date using the REST API. It has been said that the syntax depends on what kind of database is behind the mapservice layer, as ...
4
votes
1answer
329 views

Improve database performance for geospatial

I have a database with osm data imported with osmosis tool. I want to search for the nearest POIs from a given point. For this purpose, I perform this query: select id from nodes where ...
4
votes
2answers
728 views

Spatial query of raster data

I have population distribution data as a raster layer and exposure contours as vector (polygon) layers. What I'd like to do is use the vector layer to estimate the population indicated from the raster ...
3
votes
1answer
176 views

Editing and Deleting Query Tables in ArcMap

How do I edit the query for a Query Table after it has been created? How do I permanently delete a Query Table? Even after I do right-click -> remove, it still appears in dropdown lists.
7
votes
2answers
306 views

How to run a spatial query with a raster and vector layer in QGIS?

I have a soil map (vector-polygon layer) and a map of the crops farmed in the same area (raster layer, from the US Cropland Data Layer). I would like to calculate for a given soil type, the surface ...
3
votes
1answer
677 views

Using Google Earth to query database

I've been reading about using Google Earth to query data (this article) and I'm interested in learning how to make one of these. I just have a couple of questions: 1. Is this possible with the free ...
3
votes
3answers
1k views

How to join Shapefile and Excel data without unique ID column?

I have one huge shapefile with lots of roads (polylines) along with various attributes and I have an Excel file containing some of these roads by three same attributes (road no., section no., length) ...
3
votes
1answer
228 views

How to query against time

I have a date-time field in a feature class which I want to query. The field has values like "2011-01-01 00:00:29". I want to query the data between the time 00:06:00 and 00:12:00. The date does not ...
2
votes
2answers
1k views

How to query multiple features from Geoserver WFS?

Are there any methods to query several features by id other than one entry by a single url request? The scenario is I store around 200 point layers in PostgreGIS. Each maintains 100k entries GPS ...
1
vote
1answer
268 views

I'm trying to zoom to a graphic, but nothing happens

I'm trying to zoom to a graphic retuned from the query; query.OutSpatialReference = MyMap.SpatialReference; query.ReturnGeometry = true; After this query I used ...
1
vote
2answers
85 views

How to query points that fall outside their designated regions?

I have a shapefile with 250 points. Each point has a region attribute. In another shapefile I have all the possible regions with their names (it is polyline geometry). Unfortunately the coordinates ...
2
votes
2answers
1k views

query raster in ArcGIS 10

I am using ArcGIS 10 (includes spatial and geostatistical analyst). I have a raster (GRID) with a value range of -167 to 18. I would like to query the raster and create a new one with only the values ...
7
votes
3answers
225 views

What would be 'normal' processing time for a large postgis query

I have two datasets which I want to spatially join (with an intersect). The first dataset consists of 9 million addresses. The second dataset consists of 12.000 neighbourhoods. I want the add the ...
5
votes
1answer
2k views

How to find the nearest point by using PostGIS function?

table A: lat | long | the_geom | code | sign 13.8433095 | 100.6360357 | 0101000020E61.... | ABC | start_point 13.7544738 | 100.5459646 | 0101000020E6..... | ABC | end_point 13.4124215 | 100.6232332 ...
8
votes
3answers
469 views

How to select only Spatial tables from the postgres database?

My database contains both Spatial and Non-Spatial tables, but I want to retrieve only Spatial table from the query. Any suggestions to select only Spatial tables. 'the_geom' is the geometry column in ...