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

learn more… | top users | synonyms

0
votes
1answer
21 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
15 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
21 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
16 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
10 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
8 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
7 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
16 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
12 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
99 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
24 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
75 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
26 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
16 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
19 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
22 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 ...
2
votes
2answers
75 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 ...
1
vote
0answers
53 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' ...
1
vote
2answers
52 views

Load multi CSV files from local disc to Postgres

I want to load a lot of CSV files from a local disc in an already created postgres database. Which is the easiest way to do that? By using SQL or Java? I suppose that I need a loop for doing that, but ...
3
votes
2answers
65 views

How to reproduce FME Change Detector results in PostGIS?

we would like to use the function change detector from FME in PostGIS. We had a try with the following SQL-Statements but the function doesn´t work. There are no results in the end. The single ...
0
votes
0answers
33 views

ArcGIS Workflow Manager Query - Find Duplicate Job_ID

We have a query in ArcGIS Workflow Manager 10.2 shown below that shows "All Assigned Jobs". Due to the nature of our workflows (parallel workflows), some jobs are duplicated more than once in the ...
1
vote
1answer
49 views

ogr2ogr command : chaining -clipsrc and -sql filters?

I'am currently doing a clip then SQL query to select the biggest cities out of Natural Earth data via 2 commands : ogr2ogr -clipsrc 1 52 7 49 ./tmp.shp ...
0
votes
1answer
47 views

Find nearest node function

I am trying to get work the next function but i don't know if it is incomplete because the query SELECT * FROM pgr_nearest_node1('jaen',-3.75,37.779); does not provide any results. Here is the ...
0
votes
1answer
64 views

pgr_drivingdistance wrapper

Pgr_drivingdistance function works as : SELECT seq, id1 AS node, cost FROM pgr_drivingDistance( 'SELECT id, source, target, cost FROM edge_table', id, distance, false, ...
0
votes
0answers
30 views

Syntax error drivingdistance

I am new in sql and i am trying to get that works a subquery with pgr_drivingdistance and pgr_pointsaspolygon but i get the next error: subqueries in FROM must to have an alias,for example, FROM ...
1
vote
1answer
78 views

Adding Nodes to Linestrings at Overlapping Points with Polygon Layer in Spatialite

I have two Spatialite tables. A table called 'lines' which contains a PK column called OGC_FID and a LINESTRING column called GEOM. A table called polys which contains a PK column called OGC_FID and ...
0
votes
1answer
76 views

PgRouting function wrapper

I'm trying to adapt the pgr_fromAtoB function to pgr_fromAtoMult replacing pgr_dijkstra function to pgr_drivingdistance.Here is the code: CREATE OR REPLACE FUNCTION pgr_fromAtoMult(IN tbl character ...
0
votes
0answers
52 views

GeoServer Style referencing SQL Server data store

I have a SQL server (2012) based data store in GeoServer (version 2.6) . For better readability I created a spatial layer with a whitespace in a column (attribute) name. Trying to use a style with ...
3
votes
1answer
87 views

PostGIS multiple conditional statement on spatial join

I want to make a multiple conditioned spatial query in PostGIS 2.0/PostgreSQL 9.3., OS Windows 7. There are 2 tables, cadastre (Polygon) and roads (Linestring). Query: Select the sum (one number) of ...
1
vote
1answer
30 views

Using MOD within a GROUP BY subquery on point dataset

I have a dataset of 200 points (in shp/f gdb/p gdb format) in ArcGIS. I am trying to use the MOD() function within a GROUP BY subquery as a definition query on the layer to thin out the data. What ...
0
votes
1answer
78 views

MapInfo Calculating the number of Points that Fall within a Boundary

I have two layers in MapInfo (points and polygons). I need to select points which fall within polygons where the income > 1500 I tryed this one but not working: ...
1
vote
1answer
69 views

Merging multiple tables using SQL in CartoDB

I have 5 separate tables in CartoDB each with a varying number of columns, but all containing these 4 columns (the_geom, name, type, unit_code). I want to merge them all into 1 new table and get rid ...
0
votes
0answers
22 views

SQL query syntax for NDVI grid in ArcGIS for Desktop?

I am trying to extract by attribute pixels with a Value >0 (i.e., the vegetation in an NDVI grid file) in ArcGIS. Every time I try to extract by attribute (spatial analyst tools/extraction), my SQL ...
0
votes
1answer
60 views

PostGis - BBox -vs- ST_intersects Queries

CartoDb Recommend here that the following query is faster than an St_intersects Query SELECT * FROM {table_name} WHERE the_geom && ST_SetSRID(ST_MakeBox2D(ST_Point(-73.9980, 40.726), ...
0
votes
1answer
26 views

Walking-Driving area with Leaflet,OpenLayers

Could be possible to get a walking or driving distance area using pgr_drivindistance,pgr_alphashape and/or pgr_pointsaspolygon when an user click any location on map with Leaflet or OpenLayers?. I ...
3
votes
0answers
88 views

Spatial query too slow to handle bigger OSM extracts

I'm trying to compute some statistics for OSM data using PostgreSQL 9.3.5 and PostGIS 2.1.4. I started with a small bavaria extract which I downloaded from Geofabrik. The db schema is the normal API ...
0
votes
0answers
40 views

`Execute SQL` in Processing QGIS 2.6

I made a small model with Processing in QGIS 2.6. The final layer should be the result of a SQL query. Now, in the Execute SQL dialog window I can add the query: select name, max(ele) as ele, geom ...
1
vote
2answers
52 views

How can I add another WHERE filter to a PostGIS query?

I have this query, which works well, for an OSM database: SELECT row_to_json(fc) FROM ( SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(lg.geometry, bbox.geom), 4326))::json As geometry, ( ...
1
vote
0answers
56 views

SQL query works in PostgreSQL but not in GeoServer SQL View

I can't find a solution for this problem after a couple of hours of research. The query is: SELECT searchaddress('some string'); FETCH ALL IN mycursor; The function searchaddress returns a ...
0
votes
1answer
113 views

CartoDB layer selector - selecting data from 2 layers

I used the CartoDB layer selector example (http://cartodb.github.io/cartodb.js/examples/layer_selector.html) with my data. Works fine. Now, what I really want to do is to select data from 2 layers at ...
0
votes
2answers
71 views

Link to another table in CartoDB infowindow

I have two layers in CartoDB, one with spatial data, school_count, and one without, heisman_winners. I want to visualize my spatial layer but when a user clicks on a feature I want it to display data ...
2
votes
1answer
64 views

SQL query as part of featureClick in CartoDB.js

I am a complete novice at both Javascript and SQL so am learning as I'm going with this! I have made a webpage that shows a map with a layer of points on the left hand side of the page. What I want ...
2
votes
1answer
51 views

Why can't I add a Spatialite table with clip results in QGIS?

I have 2 layers and I want to make a clip of layer 1 with layer 2 in SpatiaLite (I'm using the DB Manager within QGIS). That's the code I'm using: create table clipped_lines as select * from lines, ...
1
vote
1answer
90 views

MapInfo, SQL data from multiple tab files which have the same columns

New to the GIS forum so apologies in advance for any potential etiquette failures... I'm working in MapInfo. I have multiple tables with the same structure. One of my columns is pipe diameter. I ...
1
vote
1answer
28 views

CartoDB - “sql applied has errors” message - where can I see the error text?

I'm still getting my bearings with the interface it seems... When running a SQL query in CartoDB against a table... it seems like a get the correct result, but I also get a see a "sql applied has ...
1
vote
1answer
29 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, ...
2
votes
2answers
99 views

Query for numeric field against text field that contains a numeric value

In my database, I have one field, Service_Day, formatted as numeric, which contains a single digit number 1 through 7 (for days of week). I want to compare it against another field, called Region, ...
0
votes
1answer
33 views

SQL in CartoDB to select using OR more efficiently

I made this map a CartoDB map to to show the countries that have banned their citizens working as maids in the Gulf states, I also want to show the Gulf states as one colour. I created this SQL ...
0
votes
2answers
74 views

Can I include data from multiple rows in CartoDB infowindow?

I have a visualization in CartoDB of a set of data points in table pointlayer. I am using cartodb.js and have a nice map for browser consumption. When a user clicks on a point, I'd like to run a sql ...