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

learn more… | top users | synonyms

3
votes
2answers
103 views

subquery in select by attribute in Arcgis

I have a table with several fields. field A contains the same kind of values as does field B. I tried to select all points where the value in field A does not exist in anywhere field B using query ...
1
vote
2answers
47 views

PostGIS insert failed without raising error

I'm learning PostGIS through a book "PostGIS in action". The SQL code written in the book has a lot of issues and I've figured most of them except this one: Copied from the book chapter: CREATE ...
2
votes
2answers
566 views

ArcObjects table views or SQLite3 in Python?

Given a larger csv (1000+ points) with attributes, I need to do both attribute and spatial queries on the data. Would it be faster to read the points into an xy feature class, and do the spatial and ...
1
vote
1answer
23 views

Querying two Separate Columns in ArcPy SQL {where clause}? [duplicate]

Using ArcPy I'm Trying to Set up a Where Clause in my "FeatureClassToFeatureClass_conversion" This {Where Clause} needs to Query Two Columns in the data: FEATURE = 'ENVIRONMENT' and TEMPERATURE ...
1
vote
1answer
32 views

Aggregating taxi data to census block data based on number of taxi trips?

I am doing a study on taxi demand using block level census data and taxi drop off and pick data in the form of Latitude and Longitude around the united states. I am hoping to create a map that shows ...
1
vote
1answer
36 views

Change field names in SQL Server Management Studio

I am building a spatial view using SQL Server Management Studio 2014. One of the tables I am using to build this view has field names that are not compatible with esri; the field names have slashes, ...
0
votes
1answer
55 views

Generating pivot table in PostgreSQL that ties cities to counties using QGIS (or PostGIS)?

I have a cities shapefile and a counties shapefile. I have the counties shapefile imported to a PostgreSQL table. I haven't transferred my cities to PostgreSQL yet, but the issue I really want to ...
1
vote
1answer
33 views

Sum and groupby several conditions

I have a road network where each link is part of a reference number. I am trying to sum up the length of roads per reference number and status. My nested query fails and just sum the total length of ...
1
vote
0answers
44 views

refine nearest_node with radius-distance ( ST_Distance, ST_DWithin )

i am a hobby-IT-person and currently stuck with some simple problem, maybe somebody can help me: This is my working POSTGIS-function, source by underdark: ALTER TABLE distance_graz ADD COLUMN ...
1
vote
1answer
113 views

send to WFS a custom sql query using jquery

If anyone please, could gimme me a hand on this question. I have a web sql client that the user can write a sql statement and I want to sent it via WFS to geoserver, run it, and based on the results, ...
4
votes
2answers
135 views

How to build QgsExpressions in python?

How can I build a feature request expression using variable inside expression? For example values = [1, 2, 3] for j in range( y ): it = vl.getFeatures( QgsFeatureRequest().setFilterExpression ( ...
2
votes
3answers
185 views

Find point close to points from postgis table

I have a postgis point table with a large list of cities. I need to find duplicates in it, but only if they are 10km close each other, which means that is the same city. For example, I have 5 points ...
1
vote
0answers
27 views

How would I build the syntax inside a request in the case I wanted to multiply 2 variables?

I would like add something to my previous question (here: How to build QgsExpressions in python?) How would I build the syntax inside this request in the case I wanted field_name to be also a ...
1
vote
3answers
204 views

How do I find points that are NOT within a list of polygons using MS SQL?

I have a table of points, and and a table of polygons. I have managed to build queries (MS SQL) to get the containing polygon for a given point, as well as listing all the points within a specified ...
0
votes
0answers
30 views

Number of rows returned via `shp2pgsql` for a given shapefile

With the shp2pgsql tool, I see it converts a shapefile into a SQL statement. Upon closer examination, does the SQL generated ALWAYS contains 1 insert statement for 1 row? Or are there instances where ...
2
votes
1answer
1k views

How to fetch polygons from PostGIS into a PHP array?

Currently I fetch polygons from a database table using ST_AsText(). The results are in text format, like this: POLYGON((84 104,212 48,321 122,243 179,275 238,131 240,84 104)) I am not quite sure if ...
0
votes
0answers
172 views

How to improve performance when using a large amount of data (big tables) in ArcGIS?

I'm working with the kinematic wave method to determine the runoff of a basin, I am using the explicit method for resolution (The Lax-Wendroff scheme): I'm working with script code in python (i'm ...
0
votes
1answer
36 views

Using ST_Extrude in Postgres 9.2, with PostGIS 2.2.0

I'm trying to use the function ST_Extrude() in Postgres 9.2. I enabled the PostGIS 2.2.0 extension and the PostGIS_SFCGAL extension (which carries the ST_Extrude function). I can see the function in ...
0
votes
1answer
26 views

How Update one table row with combare with the other polygon table using their geom in SQL Server

a-> points b -> Polygon i want to update city trow in table a with compare b of geom in SQL server this is the PostgreSQL Query update a set city=b.name from b where st_contains(b.the_geom, ...
1
vote
1answer
63 views

Fastest way to transfer data from SQL to ArcMap?

I frequently have to use large tables and results from MS SQL in ArcMap and for that saving the data as .xls is one of the options. But when I add the data to arcmap, processes like joining and ...
0
votes
0answers
15 views

Dealing with NULL values in geodatabase using GDAL commands?

I have a geodatabase and I'd like to return a value for NULL. (When I look at my raster layer, there are a lot of zeroes which I am assuming is because of the NULL values) Is there a way to use the ...
1
vote
2answers
4k views

QGIS Select by Expression

A basic QGIS 2.2.0-Valmiera, Select By Expression - Field Calculator question. Introduction I am a geologist searching through a geological database (see attached figure). I have a shape file and ...
5
votes
0answers
312 views

Geoserver create SqlView Layer with Geoserver Manager

I would like to register a new sql view layer to geoserver through the rest api. I am using geoserver-manager. The registration is ok, the layer is working fine, except wms getFeatureInfo, which ...
1
vote
0answers
31 views

calculate positive difference by column common value with sql

I have one table with a few columns (and around 9000 rows) see below. Now I would like to calculate the positive difference from R where Xn has the same value and when Xn has the same value as Yn. ...
0
votes
1answer
170 views

SQL Make Table (from .mdb) to Point Shapefile

For my school assignment, I must compose an SQL statement which retrieves data from a database in .mdb format. I have no problem developing the SQL statement. It is a requirement that we have an ...
4
votes
1answer
1k views

Cartodb - SQL query of public visualization of a private table

The team at CartoDB have recently(last few days) made some useful updates that now allow public visualisation maps to reference data in private tables. The change has only been made in the last day ...
1
vote
1answer
506 views

How to import .csv file to CartoDB using SQL?

How to import .csv file to CartoDB using SQL, the data given below : POINT | TOP_dm | BOTTOM_dm | X_RD | Y_RD 35AP7600 | 4418 | 4368 | 262053 | 467223 35AP7601 | ...
4
votes
3answers
363 views

Filtering dataset using SQL or Python in ArcGIS Desktop?

Using ArcGIS Desktop 10.0 SP4. I have a large dataset of sites that needs to be filtered down to a usable size. There is an attribute for the site_ID and another one for the site_type. There are ...
4
votes
1answer
52 views

How to use MAX SQL statement in ArcGIS?

I would like to use a MAX SQL query for a column in a definition query, where there records that are being queried are the MAXIUM from the field UPDATE_DATE_DATE while grouping by the field ...
0
votes
1answer
53 views

SQL in Python using variable - Arcpy

I have a code in which I'd like a da.UpdateCursor, I have probles with the "where clause", here I am about to use a variable that I get from arcpy.Describe. I have no idea of this even possible. My ...
2
votes
1answer
132 views

SQL Server Geography Query works but Geometry Query Does Not - Different Tables, Similar Schemas

I am trying to get a Geometry query to work. A similar Geography query works fine but I must work with a table that uses a Geometry type. Although the Geography version returns lots of records as ...
0
votes
1answer
47 views

postGIS 'dynamic' SQL queries

I have a postGIS table: id value geometry 0 10 'g_0_10' 0 20 'g_0_20' 1 10 'g_1_10' 1 20 'g_1_20' 2 10 'g_2_10' 2 20 'g_2_20' ... ...
3
votes
1answer
314 views

Update a table with values from coordinates on GEOMETRY in Oracle

I have 2 columns in a table that represent the X and Y coordinates. The values in those columns don't match the actual coordinates and I want to update them with the coordinates values that are ...
2
votes
1answer
275 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 ...
2
votes
0answers
45 views

Error on qGIS with postgresql views

I have a PostGIS database with various tables and views. With pgAdmin I can make requests on the tables, on the views, all is working. I add tables in QGIS 2.8, it's working, I can read, write, modify ...
0
votes
0answers
65 views

ogr2ogr conversion error - Can't create fields of type Binary on shapefile layers

I'm having trouble using the ogr2ogr tool on the command line. My data is stored in SQL as binary, type is mixed polygons and multipolygons. I am using the following command for conversion from SQL to ...
2
votes
2answers
177 views

Trouble using ST_Difference to remove overlapping features

I am trying to use ST_Difference to create a set of polygons (processing.trimmedparcelsnew) that do not contain any of the area covered by another set of polygons (test.single_geometry_1) using ...
0
votes
2answers
67 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...
3
votes
1answer
742 views

Duplicate ObjectID in ArcSDE Table

After making a check in from an arcpad AXF file, i notice that there's duplicate ObjectID records. This ArcSDE PostgreSQL table is versioned and edited by Axf checkins and a .net engine application. ...
0
votes
1answer
82 views

Qgis 2.10 unable to add a new feature in spatialite via sql function “GeomFromText”

Using Python code in my plugin the function in sql language "GeomFromText(POINT(X Y))" gives the following error: "OperationalError: no such function: GeomFromText" Plugin functions in previous ...
1
vote
1answer
83 views

How can I limit a spatial binning query to a specific bounding box?

I am using Esri's GIS tools for Hadoop but I think the query is pretty standard stuff. The SQL/HQL below is from the Esri tutorial found here ...
0
votes
0answers
39 views

Postgres PostGIS geocode_intersection()- How to handle exception?

I have a table in Postgres with a set of records that are street names which needs to be geocoded to get an intersection point.Some of the records would be bad input and when using the ...
0
votes
0answers
67 views

Creating Query Layer with 1:M relationship in ArcGIS?

I am trying to create a query layer in ArcGIS which contains 1:M relationship, When i execute query i am getting blank feature class. My query is as below SELECT a.Industrialcode, a.Industrialname, ...
2
votes
2answers
59 views

CartoDB's SQL API: Row too large

I am trying to run the following PostGIS query using CartoDB's SQL API: SELECT the_geom, ST_Area(ST_Intersection(the_geom::geography,ST_Buffer(ST_SetSRID(ST_MakePoint(-52.4379, ...
-1
votes
2answers
138 views

Sql Query in Postgresql

I am trying to execute a query but I am stuck. I have two tables A and B. The a table has columns gid, geometry(line-string) and value which cells is empty , the B table has got 3 columns gid, ...
0
votes
1answer
1k views

How can I show numbers as percentages in CartoDB?

I would like to format numbers as percentages in cartodb. What are the best functions to display numbers with decimals, comma separators or percenteges? Thanks
4
votes
1answer
35 views

Cartodb API Read Only

Is it possible to generate an API-key in Cartodb with read-only permission? Seems like the default API-key has full controll
0
votes
1answer
54 views

GDAL -SQL or -where options

ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -sql "SELECT * FROM 'Layer Name' WHERE FIELD_NAME = 'A CLASS'" dst.shp src.shp help me out here - looking to 1) reproject a shape and 2) ...
0
votes
1answer
52 views

Where clause in MapInfo Table Updates

Is it possible to add a where condition to an update query in MapInfo? At the moment I have to do a query to select the records I need and then do an update on that query. I believe this is ...
1
vote
2answers
56 views

Inputting integer values into SQL statement using ArcPy?

I am defining a function for use in a ArcGIS tool that will verify attributes, catch errors, and obtain user input to rectify those error. I want the tool to select and zoom to the segment that is ...