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

learn more… | top users | synonyms

1
vote
1answer
33 views

Updating cells in Excel using FME SQLExecutor

In version 2013 FME reads and writes Excel worksheets with XLS_ADO. I have several working 2013-workbenches, which update individual cells in Excel worksheets using this SQLExecutor and this format ...
1
vote
1answer
32 views

QGIS Editing live MSSQL Tables and Updating Fields

I am looking at creating a trigger on a live MS SQL spatial table that will update a field when a user either: 1. Creates a new feature 2. Updates the geometry of a feature. Unfortunately I have only ...
0
votes
1answer
38 views

SQL query giving error in pgrouting?

SQL error: ERROR: function point(numeric) does not exist LINE 4: (ST_GeometryFromText(Point(53.34972 -6.26025)), 4326), 1000) ^ HINT: No function matches the ...
1
vote
0answers
29 views

In ArcSDE, SQL Studio Manager 2012, How to get pixel data using a point layer?

I was using 'where' and 'ST_Intersects' with polygon data to get values 'under' my point layer. Example: Select rd.[FORESTNAME] as Forest, Count(Distinct morel.[OBJECTID]) AS Observations From ...
0
votes
1answer
56 views

SRID, Shape2SQL and SQL Server 2008r2 query

I'm using Shape2SQL to load the Ordinance Survey's Meridian 2 map into SQL Server 2008r2 (which is working very smoothly and painlessly). According to this page ...
0
votes
0answers
41 views

Grouping Features by Proximity

I have a layer with 12,000 hotels across the US and I would like to put them into groups of 2 based on proximity. Each hotel would be in only one group with its nearest neighbor optimizing for the ...
5
votes
2answers
111 views

Optimizing Geometry.STIntersect Query

I am attempting to move simple Geoprocessing routines from ESRI based processes to SQL Server. My assumption is that it will be far more efficient. For my initial test I am working on an intersection ...
0
votes
1answer
50 views

Creating geometry from lat/lon in table using PostGIS?

I have a table with over 800,000 records including a lat and long column. The data source did not create geometries, so I was looking around how to do this. I know there's ST_MakePoint(x,y,SRID) but ...
3
votes
4answers
13k views

Using String Functions (LEFT, RIGHT, MID) in Select By Attributes against a File Geodatabase using ArcMap 10

I finally (albeit reluctantly) made the switch from a personal geodatabase (pGDB) to a file geodatabse (fGDB) not too long ago. The main reason it took so long to switch has to do with how Select by ...
0
votes
2answers
51 views

Using SQL query with ArcPy?

I'm creating a tool that when you type in the city name it will select the city, zoom in and label it. I have the zoom and label working but can't figure out the SQL Query needed to select the city I ...
0
votes
0answers
44 views

Perfom SQL queries in Python and process the result

I query column names from a PostGIS table with following Python code: colnames = [] sql_getcolumns = "select column_name from information_schema.columns where table_name='shp2py';" ...
1
vote
1answer
65 views

Speeding Up pgr_dijkstra using bounding box in PostGis2.0

I'm using PostGIS for the first time to calculate distances between two points, for a driving school booking system I am working on. I have loaded in all of the maps for Australia, but the query I ...
1
vote
0answers
26 views

set Default projection in postgis table

I've set the SRID 4326 for a table having geometry column, but when i insert a geometry without SRID, i get an error because no SRID specified is interpreted as -1 or 0, so how i can set a default ...
2
votes
0answers
38 views

ST_Buffer with segment AND endcap parameters

Making a QGis plugin that buffers a line and I want to declare a high number of segments and a flat endcap. ST_Buffer(geom, 40, 25, 'endcap=flat') This doesn't work with both parameters entered, ...
0
votes
1answer
36 views

QGIS add layer not working

I have QGIS 2.8. I open up the database manager, connect to PostGIS, and then execute a query. The resulting query has an id column, a name column, a geom column, and a membership column. I click on ...
1
vote
1answer
30 views

Does CartoDB support the SQL MERGE command?

I am developing a mechanism that uploads records to cartodb - first by importing the records to a new table, and then insert the records from the new table to an existing table. The problem is that ...
1
vote
1answer
51 views

SQLite db with FDO geometries: how to assign ID of point in layer A to closest point in Layer B with SpatiaLite?

How can I assign ID of point in layer A to closest point in Layer B with SpatiaLite (find nearest neighbors for each point in A)? For each point stored in table fdo_fc1 I would like to select one, ...
1
vote
1answer
35 views

POSTGIS query - extracting common point from polygon data

I have a polygon dataset and need to find the single common point where 3 polygons meet. I'm approaching this by creating duplicate tables and comparing them to the main one (polygon_table a). I've ...
0
votes
0answers
28 views

Get next point horizontally and vertically

I am working on a map application. We have to draw polygons for different sections. Each section is either a square or a rectangle. Data that I have has less than 4 coordinate points, insufficient to ...
4
votes
2answers
173 views

ArcGIS Model isn't accepting my SQL Query

I'm running a model that breaks a dataset into several dbf tables based on a query. However, only half of the query is being honored. The PopDenZone field is not being accepted and I am getting other ...
3
votes
1answer
74 views

ST_MakeLine within CartoDB.js

I'm building an interactive map using CartoDB.js in an HTML page. I have the user input an address that gets geocoded. I then use the user's lat/lon coordinates to perform SQL queries on CartoDB. The ...
0
votes
2answers
61 views

Feature class SQL Query combining ANDs and ORs

I want to create a query that returns any combination of specific values of two different attributes. I have a feature class that has first field with values A through E and a second one that goes ...
0
votes
0answers
29 views

GDAL/OGR C++: How to connect to SQL

Using GDAL 1.11 it is possible to execute SQL commands against a OGRDataSource: But how do I connect the OGRDataSource to a SQL Database? In my case an Oracle XE 11g. I suppose the OCI drivers have to ...
3
votes
1answer
86 views

SQL Query in arcmap

I have a BUILDING.SHP and in the attribute table, it has several names and some of the attributes are "STOR" and "MULTIPLE-STOREY CAR PARK" like image below. In my map, I don't want label the ...
4
votes
3answers
5k views

Creating join based on multiple fields using ArcGIS Desktop?

I have two feature classes in a File Geodatabase that I would like to join based on multiple fields. I've searched this site and Google and all I have come up with was to use the Make Query Table ...
0
votes
2answers
61 views

How to use SQL within python in ArcGIS Labels

I'm trying to create labels across a one-to many relationship and have tried a simplified version of this method. My version looks like this: def FindLabel ( [NAME_V2] ): import arcpy ...
1
vote
2answers
133 views

Definition Query to hide attribute data

SQL help please! I've tried searching, but can't find the help I need. This is for ArcGIS Advanced 10.2. I have a parcel layer with all kinds of info that the general public shouldn't be able to ...
2
votes
1answer
37 views

TSQL Geometry Query Requires conversion to string

If I specifically define some polygons and check for containment, I get a correct result: DECLARE @g geometry; DECLARE @g2 geometry; SET @g = geometry::STGeomFromText('POLYGON((407305 100826.5, ...
1
vote
0answers
40 views

How to Load SQL Geometry Data on OpenLayers3?

I am New in OpenLayers 3. I have to load Geometry data from sql to my OpenLayers map. This is my code : var tileLayer = new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: 'osm' }) }) var ...
0
votes
1answer
77 views

WMS layer connected to SQL database

It is possible to connect a WMS layer to a SQL database or other type of database? Example: I have created an application with Geoserver and OpenLayers. Now I can see the data from attribute table. ...
0
votes
0answers
21 views

Update Statement in PostGIS ERROR

I am trying to update a column in PostGIS using information from a column in another table where they spatially intersect. I looked up how to do this on the PostgreSQL tutorial and I think that I ...
1
vote
1answer
53 views

Using a feature iterator Value variable in a SQL expression of select by attribute

I am using Iterate feature selection to select dealers one by one as input features to the Near tool. I'm using Select by Attributes to select sales points from that same dealer. How do I sync the ...
0
votes
3answers
232 views

How do I reformat numbers to only show a certain number of significant digits in CartoDB?

I need to round numbers that are in my table in CartoDB, so that in the Map visualization infowindows I only show results to two decimal digits rather than the long decimals that are currently ...
0
votes
1answer
31 views

Creating Shapefiles from MS SQL using ColdFusion/Java?

A client wants to export, from their MS SQL server, data into Shapefiles. I've looked around for a starting ground and have heard Ogr2Ogr mentioned and it seems intimidating. So I was wondering if ...
0
votes
0answers
42 views

How do I insert a Query Result into an existing Table?

I am attempting to create a map that displays the Service Area for Firestations within Toronto, In order to do this I need to identify the Length of all pathways. I tried using the calculate geometry ...
0
votes
0answers
25 views

How to select using ST_MakePolygon from a database using points of a polygon

I want to write a sql command that can select within a polygon that has many points of reference ie a boundary of an area. I was able to use this command SELECT * FROM testtable WHERE the_geom ...
1
vote
1answer
25 views

How do I query in natural=strait from OSM databse?

I'm trying to query in straits, fjords, and bays from a PostGIS Openstreemap database. The straits I'm looking for are tagged natural=bay, natural=strait, and natural=fjord. I used the following ...
6
votes
3answers
4k views

Select features by attribute if in Python list

I believe this will amount to largely a sql syntax question. Essentially, I am trying to complete a select by attribute in Python but based on the query of whether an attribute is present in a list. ...
3
votes
3answers
2k views

Inserting polygon centroids into an additional column in PostGIS

I'm trying to calculate the x and y centroids for a table using ST_Centroid. The documentation says that it returns the geometric center of a geometry. I first made a column X: ALTER TABLE ...
0
votes
1answer
20 views

What is the best strategy to add a custom constraint to a geo-django table?

What is the best strategy to add a custom constraint to a geo-django table? This is the corresponding sql-statement: ALTER TABLE my_table ADD CONSTRAINT enforce_valid_geom CHECK ...
1
vote
0answers
17 views

Free tutorials for beginners in PostgreSQL, PostGIS and SQL? [duplicate]

I've been cruising youtube videos and various sites trying to pick up information on working with postgresql, postgis, and sql. I would love a few recommendations for quality tutorials and sites. ...
1
vote
2answers
254 views

Determine which points are contained inside a given polygon

I have these database tables defined: CREATE TABLE regions ( id SERIAL PRIMARY KEY, name VARCHAR(150) NOT NULL ) CREATE TABLE region_points ( id SERIAL PRIMARY KEY, region_id SERIAL ...
2
votes
2answers
111 views

Add a serial id column inside a view

Is it possible to create a new id serial column inside a view? I need it to be able to add my view in postgis I have made a full outer join on two tables I need a unique PK to load the view in ...
0
votes
1answer
38 views

UPDATE a value field for area of the geom and convert sq m to acres using cartodb

I'm trying to use the SQL commands in CartoDB to UPDATE a value field that shows total acres of the area of the_geom. My SQL is pretty poor/entry level and has some issues: UPDATE table_name SET ...
1
vote
0answers
68 views

ArcSDESQLExecute to query and update from multiple SDE Databases

I am trying to use ArcSDESQLExecute to return the results of a join and then write the return query into a Feature Class located in a different database. Using Microsoft SQL Server and Arc10.2.2 Is ...
0
votes
1answer
80 views

CartoDB table join error: Column reference is ambiguous

I've got a CartoDB question that seems dumb b/c the layer is correctly rendering. Anyway, I have two layers, named sampling_points sample_point I'm trying to inner join the sample_point data to ...
0
votes
0answers
42 views

How to Transform Many Projections Into One With SQL Server

I know very little SQL Server, but am quite familiar with Arc and Python. The data I want to transform is point data which is in a single table [ID], [X] [Y], [COORDSYS]. There are 5 possible ...
2
votes
2answers
155 views

PostgreSQL/PostGIS Geom to JSON with Inner Join to another table

I am currently producing JSON from a database successfully using the following query: SELECT row_to_json(fc) FROM ( SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM ...
0
votes
1answer
44 views

Update the_geom field with polygons from a different table using one common field

Using CartoDB SQL API I'd like to: Update the_geom field in a table that has no spatial data by selecting the polygons from a table with spatial data and joining based on one common field.. In this ...
1
vote
0answers
137 views

ESRI JavaScript API Web Application and SQL Queries in ASP.NET?

My workflow (and security restrictions) for a new html/javascript based web application is making me think that I could program an ASP.NET application, inside which I load the 'map' and the 'legends' ...