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

learn more… | top users | synonyms

1
vote
3answers
36 views

ST spatial queries to select multi-level location

I'm trying to write a query in SQL Server using 1 set of points and 2 sets of polygons. The polygons overlap, and I only want to select the points that fall inside of 1 polygon but not the other. I ...
2
votes
2answers
81 views

Selection subquery using another table in database ArcGIS

I need to 'extract' a list of variables based on the IDs from another table. Using a subquery seems to be the best method. I have a large list of variables and have outside calculated a second list. ...
2
votes
2answers
97 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
65 views

Query to find all lines connected to other

I have problem with one spatial (Oracle) query. Simplified overview of the problem is: I have two tables: CREATE TABLE thin_lines ( id NUMBER PRIMARY KEY, geom SDO_GEOMETRY), color ...
1
vote
2answers
101 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
376 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
252 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
19 views

SQL Server equivelent to Arcmap Intersect for polygons?

I have three different sets of GEOMETRY Polygon datasets in SQL Server that completely overlap. I need to create a new dataset that has a polygon for each unique area of the three layers. So ...
2
votes
1answer
55 views

Model Builder Query by date

I've created a model that does several spatial joins based off of a lat/long in a table. In the table, I have a "Modified_date" which gives year, month, date, time. This model is set to run ...
2
votes
1answer
56 views

How to find a nearest line to a point

I have a table with many points that need to be associated with street segments to calculate an average value. should I do a relationship for all points to a street segment that is closest. I have ...
2
votes
1answer
74 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
317 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
30 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 ...
1
vote
1answer
78 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
201 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
93 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
58 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
36 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) ...
1
vote
1answer
254 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 ...
0
votes
1answer
33 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
232 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
31 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
39 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
38 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
21 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
46 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
43 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
146 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
51 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
0answers
34 views

Why there is no output (path) for Dijkstra in pgrouting

I have a road network table and I am implementing pgRouting. everything was working fine previously but now there is something odd here. I am getting no route now. I am checking through sql query in ...
0
votes
0answers
67 views

How do I use Arcpy to label based on two different expressions, then convert to annotation?

I am trying to open an mxd and turn on labels before converting them to annotation. I would like to turn on labels with 2 different classes, based on 2 different expressions, then convert them to 1 ...
0
votes
0answers
82 views

Group Nearest neighbor query in SQL Server 2012 spatial database

I am looking for way to perform GNN query over road networks in SQL Server. Any pointers
0
votes
0answers
20 views

GeoDatabase user access based on administration boundry

I have silverlight application consuming Map service. Now I want to create user login. The scenarion is somethinkg like when a user logs he should only be able to query on data belongs to his area. ...
0
votes
0answers
63 views

Multiple geometry in a cursor SQL

I have a cursor which I create from a table which has one geometry field only. But in my cursor I would be using two geometry fields as I need to calculate two different areas.Below is the sql ...
0
votes
0answers
30 views

SQL cursor issue

I am trying to create a new table using a cursor and a select statements. Declare Cursor c1 is select store_number from table1 where CLIENT_ID= 1 and ORG_ID = 1 ; Type C1_TAB_TYPE ...
0
votes
0answers
63 views

Is there a limitation in quantity of joined tables using spatialite views?

I've one point layer in qgis and several non spatial tables in a spatialite database. Now I want to create a view as you can see in the following: CREATE VIEW testansicht10 AS SELECT ...
0
votes
0answers
25 views

Multiple cursors in sql for SDO_DIFFERNCE

This is a follow up to a previous question I had regarding sdo_difference. Now in this case I am trying to use cursors so that I can do it for all records at once.In the below code I select a list ...
0
votes
0answers
165 views

Date Parameter in model builder - ArcMap

Basically I'm building a model where the user has to select the data from a drop down list and the result is executed. I have a problem when trying to pass a date as a parameter. Below you can find ...
0
votes
0answers
92 views

Trying to load ThinkGeo shapefiles into SQL

I am new to GIS, but have a work project that I need to integrate CoastLine geometry data in to a report. I downloaded some of ThinkGeo's OpenStreetMap shapefiles and have tried to load them using ...
0
votes
0answers
111 views

Can osm way records in SQL spatial be merged to one geographic record if they have same Id?

I've imported England shp file of roads to mssql using OSM2MSSQL and I've noticed that the same road has couple of records with same Id but different geographic (probably it was segmented). Is there ...