A command used to retrieve information from a database

learn more… | top users | synonyms

10
votes
5answers
2k views

How to identify duplicate attributes in a field?

I have a point shapefile with thousand of points. It has an ID code field that supposed to be unique. Every now and then the data entry clerk wrongly type the id creating duplicates.Right now I'm ...
2
votes
2answers
773 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 ...
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 ...
5
votes
1answer
2k views

How do I perform a proximity search with Postgis?

OK, so I downloaded the Geonames database (cities1000) and wrote a small Ruby program to import them into my table (geo_cities). I then added geography column called geog. So after all of that, I ...
2
votes
1answer
813 views

Why does my PostGIS query fail with “current transaction is aborted”

I'm trying to create a vector layer in a QGIS project using a PostGIS query. QGIS is returning the following error: Query failed 1 cursor states lost. SQL: CLOSE qgisf1 Result: 7 (ERROR: ...
1
vote
2answers
324 views

Searching planet_osm_point by longitude and latitude

I used osm2pgsql to import data into my PostgreSQL database and it put gave me the following 4 tables, planet_osm_point, planet_osm_line, planet_osm_polygon and planet_osm_roads. I have looked at ...
1
vote
2answers
529 views

ST_DWithin uses Geometry or Geography type

assuming I use the following query to match the locations to a poi within 10km distance: SELECT poi.poi_id, h.loc_id, (ST_Distance(poi.geom,h.geom)*111.111) as distanceinkm FROM iut_poi_transl AS ...
28
votes
2answers
2k views

Is there a “Select by Attributes” plugin/widget for ArcGIS Server JS API?

I'm hoping to find some existing code which emulates the "Select by Attributes" dialog in ArcMap, within the ArcGIS Server JavaScript API. Writing a hard-coded QueryTask is easy - I'm looking for ...
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 ...
11
votes
1answer
577 views

Nearest Neighbor Grouped Selection in QGIS

OK - so I have an interesting problem I am trying to solve. I have a list containing over 100,000 points in lat/long format which I have imported into qgis. Now, what I am trying to do here is group ...
14
votes
1answer
362 views

How to query OSM for all beaches facing west? - QGIS preferred

I want to identify all beaches on this planet (or a given subset of it) that are facing westwards (+/- 20-30 degrees). My idea is to use OSM as the data source. Extracting all polygons that have the ...
12
votes
2answers
2k views

How to select features with NULL attributes in QGIS?

I need to identify which features have null attributes in the attribute table of a shapefile. When i try [field]= 'NULL' it selects the features with value=0 (see picture) Suggestions?
6
votes
1answer
499 views

Need to learn more about Precision and Accuracy

I am currently taking Introduction to Image Interpretation online and there is a section in it that talks about Precision and Accuracy. I wanted to know if someone out there has any good information ...
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 ...
5
votes
3answers
4k views

How to fix performance problem in PostGIS ST_Intersects?

I'm a newbie in postgis and I have a problem in query performance. This my query: SELECT DISTINCT ON (userid) userid ,ST_AsText(position), timestamp FROM table1 WHERE ST_Intersects ( ...
4
votes
2answers
727 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 ...
4
votes
2answers
2k views

Selecting MAX values within records with the same name

I'm working in ArcMap 9.3 and I've never dealt with that kind of queries... I need to Select the MAX value from column [A] for each set of records in the table which have the same value in column [B] ...
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 ...
2
votes
2answers
451 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 ...
0
votes
1answer
3k views

Query Feature using OpenLayers + MapServer

I'm trying to query a feature in OpenLayers, but it's returning just an image highlighted that is not possible to make zoom, pan and drag. My intention is to query a feature on the map like street ...
4
votes
2answers
1k views

What is the best approach to using IQueryFilter.WhereClause in ArcObjects?

What is your preferred / best approach to using IQueryFilter.WhereClause statements in ArcObjects (e.g. when selecting features by attributes)? You need to check the source type (shapefile / personal ...
3
votes
3answers
803 views

How to group and count attribute data?

I have a problem with group same data to count it. for example, i want to group same code to one and count them. i can do it when i use MapInfo (Pic 1) but i can't in QGIS. (Pic 2: i can classify ...
3
votes
2answers
521 views

Why does ArcGIS Server not return data when querying joined fields?

I've been trying to help troubleshoot an issue that is very strange, and I think we've boiled it down to an issue with ArcGIS Server. We have a map service that shows up in the services directory as: ...
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.) ...
3
votes
1answer
3k views

How to filter features in a layer?

I am trying to display certain features in a shapefile-based layer using QGIS. I have found the subset function in the properties panel, which does exactly what i want, but is too tedious given that I ...
2
votes
2answers
678 views

Merge lines with the same 'name' attribute on QGIS?

I have a shapefile with a few thousand lines, each is a street segment. I'd like to merge all features with the same 'streetName' attribute into a single attribute. I only really care about the name ...
2
votes
1answer
3k views

Basic MapServer query of PostgreSQL/PostGIS database

I've just installed MapServer on a linux server and I am trying to understand how to display a basic map using a PostGIS database. I have displayed a shapefile in the browser, so I know that the ...
0
votes
1answer
304 views

SQL Geometry Query similar to Select by Centroid

Does anyone know if it's possible to query SQL geometry by something like 'centroid of polygon'...similar to ArcMap's select by location? I'm using SQL Server 2008 R2 as the DBMS. I have two polygon ...
0
votes
1answer
485 views

A couple GeoExplorer questions

I just started working with the OpenGeo Suite. I'd really like to use it for a County web map, but have a couple questions... 1) Is there a way to add a lat/lon or other X/Y location to the URL and ...