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

learn more… | top users | synonyms

2
votes
2answers
58 views

Finding Polygons which do not touch any other polygon in a single oracle database table

I currently have an oracle table of approximately 100,000 records - all of which are polygons. I want to find all the polygons which do not touch any other polygon within the same table. There are a ...
1
vote
2answers
68 views

adding geometries to a source, target table for multiple rows in pgrouting

I am having an issue trying to perform the pgr_dijkstra algorithm and getting back a line in my table for multiple rows. I have a table that has a columns of source, target node id's but I cannot ...
1
vote
2answers
327 views

Function for Selecting Points in a Polygon

I've been banging on this for a few hours, but since I'm relatively new to PostgreSQL and PostGIS, I can't find the solution. I'm trying to create a stored procedure (function) which will return all ...
3
votes
1answer
230 views

Python SQL connection causes crash in ArcMap

I have the following code which I have striped down to just included the part that is causing a crash in ArcMap. import pymssql # Connect to the Research db using Windows Integrated Authentication. ...
2
votes
1answer
63 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
2
votes
1answer
269 views

SQL Server UNion of geography feature returns FULLGLOBE result?

I have some trouble with sql server 2012. I store coordinates of french cities in my database as geography object (with ESRI 4326) and i want to make the UNION of some cities. I have in result ...
1
vote
1answer
44 views

SQL-query should return GeoJSON FeatureCollection

I'm trying to return a GeoJSON FeatureCollection object from a SQL-query with PostgreSQL 9.3 and PostGIS 2.1. This is my query so far: SELECT row_to_json(fc) AS p FROM (SELECT 'FeatureCollection' ...
1
vote
1answer
108 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 | ...
1
vote
1answer
60 views

Trying to use SQL API from Oracle PL/SQL to CartoDB

I am trying to make an http call from within an Oracle server to CartoDB. To do so I have developed a custom PL/SQL package that will generate the SQL and make the calls. A sample API call is below. ...
1
vote
1answer
42 views

Rewrite query to match two points with a linestring in a different database table

OK, not sure if I've worded the title brilliantly, but here goes: Suppose I have: a table "gps_nodes" containing columns: "EASTING" (containing longitude data) "NORTHING" (containing latitude ...
1
vote
1answer
35 views

How to do “random” distribution of certain classes to certain amount of polygons with respect to spatial constraints

I have a polygon layer. Now, I would like to assign/allocate/classify these Polygon into 13 different classes respecting spatial constraint, in my case: neighboring polygons (sharing line or nodes) ...
0
votes
1answer
23 views

Setting the Geometry with sql query

I am trying to merge data from a U.S. states shapefile with data on each state. I used this SQL query which is supposed to work: SELECT * FROM child_poverty_by_state UPDATE child_poverty_by_state ...
0
votes
1answer
12 views

Arcpad 10…using sql with VBScript

I am trying to get a count of related records (Tableform) in order to validate Editform entry (using VBS). Any help getting myCount? I Know there are some syntax issues here, but is this even ...
0
votes
1answer
73 views

SQL Geometry Query similar to Select by Centroid

Does anyone know if it's possible to query SQL geometry by something like 'centroid of polygon'...similar to ArcMap's select by location? I'm using SQL Server 2008 R2 as the DBMS. I have two polygon ...
0
votes
1answer
22 views

PGrouting encapsulated queries error [quotes problem]

I'm facing a quote problem on a pgrouting query. What I'm thinking is wrong is that my query only works if I use one, then four, then eight quotes on encapsulated queries. Is there a way to simplify ...
0
votes
1answer
61 views

In cartodb, how can I insert a new row in a table via API?

We've discovered cartodb and we want to use it in our project, but in the API documentation we've only seen the sql.execute() method (docs) in order to insert a now row in a table. Is this the way to ...
0
votes
1answer
34 views

Choropleth map turns one color when filtered, sql error

My data is generating a choropleth map perfectly but when I try to filter (both in the filter tab and by writing my own SQL) it turns all one color and tells me I have an SQL error. This happens even ...
0
votes
1answer
29 views

How do I show the created_at column at my infowindow?

Fields like created_at, updated_at or cartodb_id are a greyed out thus not allowing us to add it to the info window. Is there a way to extract the data from default fields in cartodb?
0
votes
1answer
39 views

CartoDB simple process

I'm attempting to create a simple process with CartoDB, I have a layer with number of polygons, I want to to run a SQL with a multipoint line to report which polygons were intersected.
0
votes
1answer
17 views

whereClause syntax for Cost Distance parameter

I am looking to create a sql expression regarding point feature class and selection based on 'Name' field to pass to arcpy.sa.CostDistance() param[0]. similat to: savepath = env.workspace = ...
0
votes
1answer
40 views

Set ArcGIS Tool Parameter to Obtain From it's own Source?

I am building a python tool in ArcGIS. When I build the parameters I will have 3: Choose a shapefile (parameter data type = shapefile) Choose an SQL query (parameter data type = SQL Expression) ...
0
votes
1answer
35 views

How can I combine two datasets with the same schema in to one table?

So I have two tables (in CartoDB/PostGIS) that are from two tiger shapefiles that have the exact same attributes, just in different counties. I want to combine them in to a single table, just ...
0
votes
1answer
106 views

How do you create a CartoDB viz with a dynamic SQL statement?

I want to create a CartoDB viz where the where parameter in my SQL statement changes dynamically at runtime. When I share my CartoDB viz from the dashboard, I can't help but notice the the SQL ...
0
votes
1answer
47 views

Issues with pgrouting workshop code in postgis 2.11/pgrouting 2.0

I'm having issues getting the pgrouting workshop to work on Postgresql 9.2/PostGIS 2.11 and pgrouting 2.0 on windows. How can I rewrite the following php/sql code and make it compatible with my ...
0
votes
1answer
221 views

How to create a search box and SQL statement for searching an attribute field?

How can I add a HTML search bar that the user can use to search an attribute field for a polygon layer, and then tie that input into the SQL statement? So far I am able to hard code the query of ...