Acronym for Structured Query Language. A syntax for retrieving and manipulating data from a relational database.

learn more… | top users | synonyms

3
votes
0answers
69 views

Preserve datatypes when using SQLite and QGIS

Following Nathan's SpatiaLite/DBManager solution in this answer, I find that once the layer is loaded from DB Manager into QGIS (2.6.1), any calculated fields are appearing as text values instead of ...
3
votes
0answers
94 views

How to export data from sql server into shapefile in the decimal format in QGIS 2.4?

The last couple of days, I have been working on exporting data from SQL to a shapefile in QGIS 2.4. While converting into a shapefile, the data type changes automatically from Float to Integer in the ...
3
votes
0answers
86 views

How to express not within/inside predicate in spatial database with good performance

In our application we want to express some spatial predicates as objects not within some areas, but unfortunately it has very bad performance. The following SQL is generated by our application: ...
3
votes
0answers
242 views

Geoserver WMST Date Format

There is table in SLQ-Server 2008 R2. In this table i have date column with date format like this 2006-09-08 14:39:41.000. Now i make View from this table on Geoserver side but do nothing wiht date ...
2
votes
0answers
51 views

SQL Query does not work in ModelBuilder (but works elsewhere)

I am having issues getting a simple SQL query to work in model builder. It works fine when I use it with the standard "Select features by attributes tool", but ModelBuilder doesn't find the required ...
2
votes
0answers
36 views

SQL Error Message: Find and Replace for Date Field

Hi, I am attempting to use the find and replace function within the Attribute Table Options to replace fields that contain dates in the following format: month/day/year (e.g. 03/14/2014). The ...
2
votes
0answers
36 views

Multiple Cursors

Below is the sql statement which I have explained below. Declare Cursor c1 is select store_number ,0 as total_area,0 as BG_ID ,0 as store_geom from table1 where CLIENT_ID= 1 and ORG_ID ...
2
votes
0answers
127 views

Matching points in table to polygons

this is my first post to this forum. I hope to start participating actively. I have a table with several records (aprox 200.000), each with its own coordinates. And I need to identify the "Polygon" ...
2
votes
0answers
171 views

Select a distinct attribute with maximum shape area

I am trying to manipulate a large dataset containing a lot of sliver polygons resulting from an overlay operations. (The eliminate tool is very time consuming to generalize them.) I identified the ...
1
vote
0answers
13 views

SpatiaLite / QspatiaLite: get subgroup row ids

I'm using QspatiaLite plugin to join polygon ids to points that are within those polygons. Now I' d like to get subgroup rownumbers for each subgroup of points with same polygon id! Like so.. grp_ID ...
1
vote
0answers
14 views

Needing to find parent zip code of a bunch of missing zip codes in the US

We're using MapPoint to export zip code / territory combinations. Unfortunately, the export doesn't include PO Box zip codes which mean that we're missing a lot of zip codes The PO Box zip codes are ...
1
vote
0answers
131 views

ArcMap “One or more layers failed to draw: An invalid SQL statement was used”

I created a model involving the tool Make XY Event Layer because I want to plot latitude and longitude points in CSV file columns. The model runs without errors and appears to have plotted the points ...
1
vote
0answers
44 views

Tables from SQL Server to QGIS Layers

I'm a beginner SQL and GIS user and this my first time using stackexchange, so apologies if I'm asking the question properly. I'm trying to open some MSSQL tables in QGIS. I established a connection ...
1
vote
0answers
80 views

Making Map with Color Ramp Using SQL Database Intergration?

This could be a trivial question, but I've been kind of stuck on it for awhile. I'm trying to construct multiple maps that reflect aggregated data showing overall risk by county in a SQL Database ...
1
vote
0answers
50 views

How to query the data using SQL in the infowindow of CartoDB

I want to use a SQL join to merge data from 2 tables and display it in the info-window. When I give my query Select table_2.hos_name,table_2.revenue from table_1,table_2 where table_1.area_name = ...
1
vote
0answers
15 views

Creating weighted list using Select tool in ModelBuilder?

I've done a raster to point conversion and have a column of the grid codes. Let's say it is composed of 10 numbers [9,5,7,1,7,3,7,2,8,1]. Right now I am doing a selection on those numbers based on ...
1
vote
0answers
72 views

How to export data from sql database in the decimal format in QGIS?

Currently I am working with QGIS and fetching data from SQL server and export it in the format of shapefile in QGIS. While importing the data from sql server attribute table showing data with ...
1
vote
0answers
36 views

Hindi character support in MS SQL 2012

I have spatial MS SQL 2012 and i need to store hindi characters in a column. I tried using nvarchar datatype but I'm getting only "Question marks(????)". Is it possible to store non-english ...
1
vote
0answers
52 views

How can I make PROC GMAP (SAS) run is less time?

I am trying to create a map of Australia, by Local Government Area (LGA), with shaded regions displaying the population for each LGA. The shape file can be downloaded from the Australian Bureau of ...
1
vote
0answers
68 views

connecting cartodb to existing mysql database

I'm trying to create a simple heat map based on longitudinal and latitudinal map coordinates that can be transferred from a database on mysql that I've created. I read that cartodb can be connected to ...
1
vote
0answers
73 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 ...
1
vote
0answers
114 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0answers
37 views

Is it possible to retrieve lost versioned data in SQL Server Management Studio?

One of my staff accidentally deleted a feature class she was creating in her version before I reconciled it. I have grabbed a back up of the database from yesterday in SQL Management Studio. Is ...
1
vote
0answers
48 views

Selecting a bounded area within a raster

I am new to postgresql. I have imported a 256kb sample raster (.tiff) into postgres with tilesize 100x100. Now I need to select the area (rectangle) from the center of the image using sql query. Then ...
1
vote
0answers
123 views

How can I retrieve/query data from shape file for forms/grid in website?

I've made a site using openlayers and geoserver. currently im serving WMS layers from geoserver (shape files). I want to add in my site a search form that the user can search for data (which I have in ...
1
vote
0answers
202 views

Using sql SELECT DISTINCT in Fusion Tables API

How do I go about using sql SELECT DISTINCT in fusion tables API?
1
vote
0answers
53 views

How do I make vectorlayer with sql on PostGis via python code

I need to make a vectorLayer and fill with the SQL's results on PostGIS via python code. I'm working with python 2.7, QGIS 1.8 and PyQt 4.5 How do I it ? thanks
1
vote
0answers
53 views

IQueryDescription SQL Query Returning Limited Records

I created a SQL query that is working in SQL Management Studio, but as soon as I transfer the query into ArcMap's IQueryDescription to try and run it with a User Form, the results that I'm getting ...
1
vote
0answers
690 views

PostGIS Better ST_Intersects Query

I am currently using the following queries to return all features that intersect a large and complex polygon. I initially tried to use a single ST_Intersect query but because the number of features it ...
1
vote
0answers
58 views

How do I prevent Arcmap from verifying SQL expressions when using a plugin dataset?

I've written a plugin workspace for ArcGIS. I'm able to compose a where clause containing syntax that my implementation of IPluginDatasetHelper understands, assign it to IQueryFilter.Whereclause, and ...
1
vote
0answers
48 views

given sets of vehicle passing on each edge, how to get most used vehicle to avoid transition?

I have two tables: one, the resulting table from converting osm.xml via osm2po so I can use pgRouting, and another one that contains information on what edges each public vehicle passes through ...
1
vote
0answers
702 views

How to handle postgresql/postgis geometry type errors in a function?

I have created the following function in PL/SQL to make a polygon from a set of linestrings: CREATE OR REPLACE FUNCTION _myfunction( _fid integer, _rid integer ) RETURNS VOID AS $$ ...
1
vote
0answers
2k views

How to populate data from postgresql using dynamic php\html listing

In the form I created, I need two fields to be dynamically populated from the database while the other fields will be manually entered and push to the database. I have written a script that is able ...
1
vote
0answers
69 views

Database has duplicate values after running pgrouting

I am a newbie with postgresql and sql statements so maybe it is a trivial question, I'm sorry for that. I am working on a postgis database and try to use the pgrouting function. My goal is to store ...
1
vote
0answers
98 views

How to find loops in a network

I am a new in this field and need help, how to code using SQL spatial a function that retrieve loops in a network.The input, flag: Geography and barrier: Geography and two spatial tables, first ...
1
vote
0answers
111 views

Acceptable Reduce() amounts for google maps zoom levels?

I'm using SQL Server Spatial to return large polygons to Google Maps for display. Given that google maps has a zoom scale of 1 - 20, I would like to reduce my polygons (reduce function uses the ...
1
vote
0answers
303 views

Add building height from xyz points in PostGIS

I have been trying to get this query right and just can' seem to. I have a building polygon table with over 7 million polygons, indexed I then have a grided height XYZ table with attribute 'height' ...
1
vote
0answers
244 views

Manifold 'Link drawing to query' - can I do this in QGIS?

Manifold GIS allows the creation of dynamic drawings linked to queries. Unfortunately I do not have access to Manifold as my employer refuses to pay for it, so am currently investigating ...
1
vote
0answers
296 views

T-SQL with SDE and Web Map ArcGIS Server 10 MSSQL 2008

I need to build a system whereby the user of a web map (the standard web map that ArcGIS Server Manager builds) can edit a feature class's attributes. The attribute will be a 'Comments' field. The ...
1
vote
0answers
215 views

Color polygons using SQL Database based Rules in Openlayers

I want the rules to be applied according to values in a database. Is it possible to include external database information that is not in the shapefile? In spoken words the original rule is "Color all ...
0
votes
0answers
7 views

Creating Temp Table in SQL

I am trying to understand how I could make my Temporary Table Ambiguous instead of having to write out all of the different combinations within my data: Declare @Year as Integer Declare @LastYear as ...
0
votes
0answers
22 views

Query for finding nearest distance and driving time from objects in a different tables

I have 4 postGIS tables: employees_wgs Facilites and (created by osm2po): at_2po_4pgr at_2po_4pgr_vertices_pgr What I want to do is: make a query to populate two columns in "employees_wgs" ...
0
votes
0answers
25 views

How to save SQL-like WHERE as .qqf in QGIS 2.6?

I used to use QGIS 1.7.4. And there was "advanced search". I can save SQL where clause as .qqf. But I installed QGIS 2.6 and I cannot find this kind of things. Could you please teach me how to save ...
0
votes
0answers
71 views

ModelBuilder Iterate Row Selection & Variable Expected Fields in Summary Statistics

I have a model using a Iterate Row Selection. The inline variable produced by the iterator is used in the SQL expression of a Table Select tool. Note that this Table Select tool does not use the ...
0
votes
0answers
38 views

Apply raster contraints on single table with multiple files

I have a raster table (pre-created using CREATE TABLE) containing multiple individual raster files that I append piece by piece to a final table. The table itself is in its own tablespace 'gisdir' and ...
0
votes
0answers
23 views

ERROR: operator is not unique: unknown || geometry

EXECUTE 'INSERT INTO Panden_intersect(St_ints,pnd1,pnd1_area,status1,dtm_strt1,pnd2,pnd2_area,status2,dtm_strt2,CtrDist) Values ( ...
0
votes
0answers
34 views

ogr2ogr export to KML from SQLite, when using SELECT for fields Linestrings are lost

I'm using: ogr2ogr -sql "SELECT * FROM 'trails_utm_utf8' ORDER BY name ASC" -f KML trails.kml trails_utm_utf8.sqlite -s_srs EPSG:900913 -t_srs EPSG:4326 to reorder, re-project and export to KML ...
0
votes
0answers
78 views

Error selecting geometry from Oracle DB

I'm trying to select a geometry column as well-known text from a feature class in an Oracle 11g/ArcSDE 10.1 geodatabase. (This is in a Python script using pypyodbc as a driver). This is my SQL: ...
0
votes
0answers
11 views

PostGIS-Layer: sql query from style rules

I’m using PostGIS layers which are build from OSM-Data (osm2pgsql). Now I like to build a sql-query to filter the needed objects like "waterway" = 'river'. But in the layer-style I already have that ...
0
votes
0answers
23 views

Adding a column to several feature classes in a file gdb using ogr2ogr

I'm trying to add the same column to 25 feature classes in an ESRI FileGDB. I managed to do this for one feature class by using ogr2ogr: ogrinfo C:\temp\test.gdb -sql "ALTER TABLE table01 ADD COLUMN ...