A command used to retrieve information from a database

learn more… | top users | synonyms

1
vote
1answer
10 views

Keep column titles when exporting SQL query in MapInfo

Is there a way to keep column titles when exporting a query in MapInfo as a csv or a new tab. This is my result: And my export looks like this: It's not a major issue, I jus like saving myself ...
1
vote
1answer
16 views

MakeQueryTable_management

When I run this code, it says "An invalid SQL statement was used". Any idea what does it mean? import arcpy from arcpy import env env.workspace ="C:/RG/Projects/CriticalDataNetwork/CDEC.gdb" try: ...
1
vote
0answers
19 views

How to Build Query Table from two OLE DB tables using ArcPy?

When I run the following code to create a subset of a table, the error says "An invalid SQL statement was used" [Query]. The error shows in line 39. Is there any idea you can figure this out? import ...
0
votes
1answer
56 views

Is it possible to do a query to multiple tables?

I have a point a line and a polygon layer. They have the same attribute table. Can I do one query that refers to all the attribute tables? So I wouldn't have to do every query three times. Thanks. ...
0
votes
0answers
21 views

How do I use Arcpy to label based on two different expressions, then convert to annotation?

I am trying to open an mxd and turn on labels before converting them to annotation. I would like to turn on labels with 2 different classes, based on 2 different expressions, then convert them to 1 ...
0
votes
1answer
57 views

JavaScript API - Query and Edit point from Feature Layer

I am attempting to recreate the ESRI example for attribute inspections (https://developers.arcgis.com/javascript/jssamples/ed_attribute_inspector.html). I am having an issue when I create my feature ...
0
votes
0answers
13 views

Automatically update the result of a QueryTask

I have developed a application using the ESRI JS API to allow users to create and edit features in a web map. I have used the QueryTask to create summary statistics to report back to the user on ...
0
votes
1answer
24 views

Multiple field vbscript query

I'm fairly new to arc gis and I'm trying to string along several queries. individually they work in same query they don't. background I want to query all permit types rc, re, re/ap, and db; less than ...
2
votes
1answer
47 views

Area of polygon split by a line

I need a query that return the area of two polygons that have been split by a line. This is what I did so far: SELECT ST_Area(ST_Split(surface.geom, limite_a.geom)) from surface, limite_a where ...
0
votes
2answers
24 views

How can I optimize this point-linking query?

I have the following query, and am wondering how it could be optimised to run faster: WITH gps_nodes_1 AS ( SELECT "NODE_ID", "geog" FROM gps_nodes WHERE ST_Distance("geog",ST_GeogFromText('POINT( ...
0
votes
0answers
14 views

Problem using test search for tags in ArcGIS JavaScript API

I have the next problem with a query using the ArcGIS Javascript API, when I execute this code: portal.queryItems({ q: queryGroup+' AND tags:"' + tagsInserted+ '" ', num: 100 ...
2
votes
1answer
71 views

ST_Intersects() in WHERE clause misses results

I have a table with a lot of geographical objects like countries, cities or points inside the cities. For instance # SELECT id, ST_AsText(location) FROM brace_brace WHERE id IN (3, 42); id | ...
1
vote
0answers
9 views

Forcing Hash Join Query Plans using PostGIS

I'm currently testing PostGIS 2.0 in a Greenplum Appliance (Postgres 8.2 based) and have hit an incompatibility between PostGIS and the MPP Greenplum environment. The basic query below can't be ...
1
vote
2answers
40 views

Using Qt Designer to Create a Form in QGIS that can search for a specific point in a layer

Good Day! I would like to ask if you can create a form in Qt Designer to create a form that can search for a point on the map using data that the user will provide such as the Name. I am currently ...
0
votes
0answers
25 views

View for SDE Permissions for SQLServer

Does anyone know the correct tables and joins to write a view to see the permissions on objects in SDE? Here is what I had in 9.3 and it doesn't seem to work (ie., all Permissions are Edit b/c the ...
0
votes
1answer
29 views

ModelBuilder - use in line variable in expression

I have an in line variable of two fields (field1_field2) in modelbuilder. Using the make feature layer tool, I would like to make an expression that queries field2. Can an expression in the make ...
0
votes
0answers
24 views

Invalid spatial reference Error

I am getting the error: Invalid spatial reference. Spatial reference must match map's spatial reference. Clear the map layers collection prior to changing the spatial reference when I try to ...
1
vote
1answer
43 views

Problem with runing a loop in a query in PostGIS

I am new to PostGIS and I have a question which can't solve. I have a table of buildings each having a value for number of people living in it. I would like to calculate the total value (sum of number ...
0
votes
0answers
30 views

display route from database(postgresql) on

For first part: Link i have postgresql9.1,postgis2,pgrouting2 and qgis2.2 this is the second part of what i need to do: Search in a database (postgresql with pgrouting) for a line from public ...
0
votes
0answers
39 views

Why is Freehand Spatial Query in ArcGIS for Server not working?

I have been using the Spacial Query tool from ESRI to implement more functionality into my GIS application. The query works for a square, circle, and oval; but it does not return anything if the user ...
0
votes
0answers
22 views

QGIS spatial query cryptic error message

I tried running a spatial query plugin to return features in SpatialLite layer that fall within selected feature on MapInfo .TAB layer, which worked fine, selecting 3 items. But when I tried creating ...
0
votes
1answer
69 views

How do I search dates using the ArcGIS REST API?

I'm trying to understand how dates are queried in the ArcGIS Server REST API (v10) using the query functionality (...MapServer/find?searchText=...). If I search on a string attribute I can get a ...
0
votes
0answers
28 views

How to build a query tool for spatialite data in QGIS?

I am trying to build some tool for a collegue of mine to query data from a spatialite database while clicking on vector features. My first guess is, that I could do this with an "action" I define for ...
-1
votes
1answer
90 views

Shortest Path Dijkstra

I would like to calculate the shortest path with dijkstra algorithm. sample query SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, ...
0
votes
1answer
50 views

How to cut/split multipolygon with blade (linestring) into two pieces using PostGIS? [closed]

I struggle to do split operation in postgis I tried to build a query but Im always fail. Id like to cut a multipoligon with a blade (a linestring) into two pieces. These two objects have specific ...
1
vote
1answer
25 views

Rewrite query to match two points with a linestring in a different database table

OK, not sure if I've worded the title brilliantly, but here goes: Suppose I have: a table "gps_nodes" containing columns: "EASTING" (containing longitude data) "NORTHING" (containing latitude ...
3
votes
1answer
146 views

PostGIS intersection function

I have a problem with intersection function. I built my query following http://manual.linfiniti.com/en/postgis/geometry.html, 5.7 section. I made my clip object, a red linestring frame: But after ...
2
votes
1answer
80 views

Definition query that returns based on date in arcgis

I was wondering if anyone knew how to build a definition query in Arcmap 10.0 that returns only features that are f.e. only 7 days old. I have a SDE geodatabase with polygons, each with a ...
3
votes
1answer
43 views

How to select an limited TOP n from a specific column in arcgis query builder

I'd like to know what is the best way to select a limited top 'n' of rows from a specific column of a geodatabase file. Currently I use a function in the query builder of the select tool (arcgis10) in ...
4
votes
1answer
50 views

Finding percentage of feature in a raster

I am attempting to find the percentage of polygon features at a 5 meter resolution that are located inside each 25km raster cell. I am looking to assign percentages to each cell based on the ...
0
votes
2answers
46 views

Select area which is at least x meters away from other geometries

In my table I have the build-up area from a region as a big number of polygons. urban_area: id | name | geometry(polygon) I was wondering if and how I would be able to find the area within a ...
0
votes
0answers
48 views

Find area with highest relative density of one type of object

I'm using PostgreSQL/PostGIS and I have an advanced type of query. My database contains two types of object - let's say pubs and churches :) Is there a way that I can find the area with the densest ...
6
votes
1answer
145 views

What is the precision of SELECT DISTINCT on PostGIS geometry column?

I wonder what the precision of the SELECT DISTINCT operator is on a PostGIS geometry. On my system, the following query gives me a count of 5, which means that the inserted points are considered equal ...
0
votes
2answers
92 views

What causes ExecuteError: ERROR 000358: Invalid expression Failed to execute (SelectLayerByAttribute) on shapefile? [duplicate]

My script runs perfectly for feature classes, but not shapefiles. It crashes at the point of selection, provided there is a query. gp.Workspace = "C:/someworkspace" fc = "featureclass.shp" query = ...
1
vote
0answers
40 views

Querying and summarizing/reporting a multiple tables database

I have to create a database with information on Scottish buildings from 17 and 18 centuries. In order for my data to be searchable I need to have a series of tables connected with 1 to many ...
0
votes
0answers
39 views

Newbie, I want to make a map that shows something along the lines of the following:

What is the average income for housing units (middle, mixed, family, etc.) within a 2 mile radius of parks for the City of Anaheim? or What is the average number of parks within the 1/2 mile radius ...
0
votes
1answer
304 views

How to find points inside each polygon in Mysql?

I have points table (with latitude and longitude columns) and polygons table with geometry stored in Mysql. I want to get points inside one polygon, for example in polygon which has column ...
0
votes
0answers
25 views

Exclude any geometry contained within another in geodjango queryset

I am trying to get a set of non-intersecting model objects my a GeoDjango project. I have a model with a polygon geometry field, and it represents a collection of buffers. The model definition is as ...
0
votes
1answer
83 views

Defining a WHERE clause from a subquery for a query to create a handy view

It is about my implementation from an answer of this question. It is more an postgresql issue than a GIS issue, whereas it is about geometries and spatial queries. I want to create a view from the ...
2
votes
2answers
177 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 ...
0
votes
0answers
78 views

Query area without “AREA” field

In ArcGis 10.2 I'd like to show only polygons over 1m2, using something like a query. Can I do this without adding an AREA field and calculating/populating it in my table ?
2
votes
1answer
158 views

Select by SQL in QGIS Python

In the GUI there is the Query Builder, but that does not seem to be easily available in Python. The processing (SEXTANTE) module has the qgis:selectbyattribute algorithm, but that only supports ...
5
votes
1answer
123 views

How to build query expression to display text from one-to-many relationship in ArcMap?

I have two tables in an enterprise geodatabase stored in PostgreSQL and accessed via ArcSDE: parcel and person 1 or + parcel can have 1 or + person (relationship is pll_person) I can display all ...
0
votes
1answer
234 views

PHP/MySQL, PostgreSQL spatial queries. Find a polygon that contains a coordinate? [closed]

I am building a non mapping javascript app and I am wanting to take a lat/long coordinate and query a MySQL table of polygons for the one that contains the point. I have looked into MySQL spatial ...
1
vote
1answer
41 views

Is it possible to extract many municipalities out of a state map at once?

Is it possible to extract many municipalities out of a state map at once? I mean not to have to do the QUERY for each and one of them? Thanks in advance.
0
votes
2answers
72 views

How to find polygons with area size between 300 and 500?

I have bunch of polyygons, all with different area-size. I want to find polygons with areasize between 300-500. Normally I would pick out everyone above 300 (query1) and then commit a new query on ...
1
vote
1answer
100 views

Computing altitude from contour table - slow ST_Dwithin query

I am using PostgreSQL 9.2/PostGIS 2.0. I have a table of house addresses and a table of contour lines which are as follows: address_list house_id | geom (point, 4283) ---------+--------- 1 | ...
1
vote
1answer
68 views

How to solve 'syntax error, unexpected LE' in QGIS query builder?

I have a very simple question about the advanced query builder in QGIS. I'd like to search for a range of numerical data values in the attribute table, but asking QGIS to show me values that are ...
5
votes
4answers
92 views

uDig window to change between historical dates?

I'm new to uDig, but I'm experienced Java developer. I have points with temperature measurements that change overtime in SQL database. I would like to give user ability to change between historical ...
0
votes
1answer
95 views

How to filter shapefile using definition query?

I have a point shapefile which I want to interpolate using IDW interpolation. However, I want to interpolate only those points which satisfies a certain condition. I need to do it in python and I ...