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

learn more… | top users | synonyms

0
votes
1answer
31 views

select by location point in polygon with sql query

I have 2 tables table a this one a polygon layer with 10000 records table b this one a point layer with 600000 records in postgresql geodatabase i select a polygon feature with the query by input ...
1
vote
1answer
51 views

PostgreSQL: insert from multiple select?

Is it possible in PostgreSQL to insert field values into a table using multiple selects from various other tables? Something like the following SQL (I have over simplified my original problem). I ...
0
votes
0answers
18 views

Get table of adjacent polygons

I am using the cb_2013_us_zcta510_500k shapefile to push zipcode polygons. I have the shapefile, and a SQL Server table loaded where the polygon is loaded in the GEOG data type. What I need is to ...
1
vote
2answers
27 views

How to use STUnion with GroupBy

I'm using SQL Server 2008 R2 to store Geometry data types. I have a bunch of lines as individual features, that share common names ('NAME' field). I would like to create a view that Groups By 'NAME' ...
0
votes
1answer
28 views

Spatial join points and polygons in PostGIS

I have two spatial data sets in PostGIS tables: polygon grid (table: grid_jakarta) points (table:tweets) For each point in 'tweets', I want to retrieve the reelvant attribute 'gridID' from the ...
0
votes
2answers
89 views

Dynamic connection between Mapinfo and a database

I'm trying to create a dynamic connection between a database and a Mapinfo table. My database countain only one table, with a list of bus stops, characterized with their ID, name, and X Y coordinates. ...
1
vote
1answer
21 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 ...
0
votes
1answer
35 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
1answer
22 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
0answers
36 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 ...
0
votes
1answer
23 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 ...
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 ...
5
votes
2answers
82 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
40 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 ...
0
votes
2answers
40 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
39 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
58 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
16 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
33 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
0answers
12 views

Using If /then statements in SQL server computed column specification [migrated]

I have two fields in a SQL Server database called "Species" and "Species _other" that stem from a front end data collection software dropdown values. I am trying to use a computed column using an ...
0
votes
1answer
32 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
33 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
32 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
168 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
56 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
54 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
25 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
81 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 ...
0
votes
2answers
47 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
112 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
31 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, ...
0
votes
1answer
57 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
20 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
42 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 ...
1
vote
0answers
32 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
25 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
27 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
16 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
20 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 ...
0
votes
1answer
15 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
15 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
195 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 ...
0
votes
1answer
33 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 ...
2
votes
2answers
94 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 ...
1
vote
0answers
53 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
51 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
32 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 ...
0
votes
1answer
36 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 ...