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

learn more… | top users | synonyms

2
votes
1answer
71 views

Trouble using ST_Difference to remove overlapping features

I am trying to use ST_Difference to create a set of polygons (processing.trimmedparcelsnew) that do not contain any of the area covered by another set of polygons (test.single_geometry_1) using ...
2
votes
1answer
32 views

ST_Union based on attribute

I have a road network of center lines of MultiLinestrings.They have nodes at every intersection. I try to understand how I can merge roads together that have the same category as attribute (There are ...
0
votes
1answer
18 views

Querying a raster per pixel using a secondary raster as a condition

So here's the problem. I have two rasters containing bathymetry data: one containing the bathymetry of the sea floor, we'll call this raster1, and another containing the difference between two ...
0
votes
1answer
27 views

CartoDB (PostGIS) near function (distance) points to polygons

I have a CartoDB map here: Link: https://dms2203.cartodb.com/viz/78db6c02-3148-11e5-a42f-0e018d66dc29/public_map I'm trying to find the distance of the points to the polygon. If the points are ...
0
votes
1answer
21 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...
1
vote
0answers
265 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' ...
0
votes
1answer
52 views

What command to use in PostGIS to get same result as ArcGIS?

I have two shapefiles and i'm trying to do simple spatial analysis. When I want to know which polygon belongs to other polygon in other shapefile I always use select by location and in Spatial ...
3
votes
1answer
293 views

How to query against time using ArcGIS Desktop?

I have a date-time field in a feature class which I want to query. The field has values like "2011-01-01 00:00:29". I want to query the data between the time 00:06:00 and 00:12:00. The date does not ...
2
votes
1answer
110 views

Selecting more than one feature from raster attribute table using ArcGIS Desktop?

How do I select more than one features from raster attribute table? For example: "lc_2001" = 21, 22, 23, 24 AND "lc_2006" = 11, 31, 41, 51
1
vote
1answer
43 views

nearest neighbor query in SpatiaLite

I am trying to find the nearest line to each point in a layer, and I have over 1 million points. I want to be able to associated the closest unique line ID with the point unique IDs. I have tried to ...
0
votes
1answer
31 views

I'm not able to add SQL file to postgresql database

I started with basics and did these steps: createdb -U postgres -E UTF8 -O Peete gis -OK createlang -U postgres plpgsql gis (was already installed) -OK psql -U postgres -d gis -f ...
0
votes
0answers
19 views

SQL query on field in Oracle does not return the same values that are seen in ArcMap/ArcCatalog

This is a very bizarre issue and I am at a loss as to why this is happening. A user running queries in SQL Developer brought this to our attention, and when we tried it we ran into the same problem: ...
2
votes
2answers
25 views

CartoDB latlon change to lonlat

I have this script I am trying to use to search for a value within a CartoDB table. I can't seem to figure out how to reverse the order of the lat & long coordinates so they appear as lonlat... ...
2
votes
1answer
414 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 ...
0
votes
1answer
227 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 ...
1
vote
2answers
140 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 ...
0
votes
2answers
19 views

Cartodb - Error: sql is read-only in NamedMaps

My map is not a named map. Map privacy is set to only people with the link. Why I I getting this error when trying to do queries? Has anyone else run into this?
0
votes
1answer
30 views

Spatial query ST_CONTAINS returns empty result

I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called ...
0
votes
0answers
47 views

PostGIS ST_Contains query return empty

Hopefully I explain this properly. I am trying to check if a route falls into another route I have created. The route is saved as a linestring. My search query is: SELECT id FROM routes WHERE ...
2
votes
2answers
482 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
1answer
47 views

Joining data of two different datasets from varying distances and integrating into one dataset in ArcGIS

I have a pointfile of some 200 electrical boxes throughout the county. While the electrical boxes are "mapped", they are done so by using township range section data, so there actual location is not ...
1
vote
1answer
14 views

Table join not displaying in createLayer function in cartodb.js

I am trying to build on the cartodb tutorial to develop a map of fibre networks in Africa. The example works fine when my SQL select is very simple i.e. var layerSource = { ...
1
vote
0answers
30 views

ArcGIS Model Builder-Interate tables: Make Query/SQL expression

I'm new to ArcGIS and was wondering if someone could help me with my SQL expression. Essentially, I'm using model builder to iterate over several tables and Make Query table for each one. I'm trying ...
1
vote
0answers
33 views

Combining Datasets from multiple scraped data CSV files using FME [duplicate]

My main goal is to collect information of US Golf courses located in the United States and geocode them to create a meaningful map. I was able to scrape from four sites in which I created 4 CSV ...
1
vote
0answers
19 views

ogr2ogr: export intersected gml using shapefile

I'm trying to do the same as the ogr2ogr example given by http://gis.stackexchange.com/a/119404/6458 The difference is that my inputs are a GML and a shapefile. Export.shp should only contain the ...
1
vote
2answers
28 views

Trouble inputting interger values into an SQL statement within ArcGIS

So I am defining a function for use in a ArcGIS tool that will verify attributes, catch errors, and obtain user input to rectify those error. I want the tool to select and zoom to the segment that is ...
0
votes
1answer
48 views

Referencing CSV file in Select By Attributes SQL query?

I have 2 databases: Database 1: Point Shapefile with adress and APN (parcel numbers) as attributes. (Huge number of points, addresses for an entire metropolitan area). Database 2: CSV file with a ...
0
votes
0answers
14 views

Error Save to FeatureDataset in ArcObject C# [duplicate]

I have a SQL GeoDB in my server. I want to write some data in one of feature dataset and for that i use below method. public string insertdata(string tablename, List<tableRow> fields, string ...
1
vote
1answer
40 views

Error #1064 from MySQL searching database for results near lat/long

I'm trying to run a SQL query to search for a term and a users location. I need help to search my database for locations near a user with the description of 'X'. The users location (lat, long) is ...
2
votes
1answer
135 views

How to make SQL definition query in ArcGIS to show only unique values (hide duplicates)?

I have a vector file with field of type LONG. Some values of this field are duplicates. Is it possible to make such SQL definition query in ArcGIS 10.3 to show only unique values without duplicates? ...
1
vote
1answer
149 views

connecting cartodb to existing mysql database

I'm trying to create a simple heat map based on longitudinal and latitudinal map coordinates that can be transferred from a database on mysql that I've created. I read that cartodb can be connected to ...
2
votes
2answers
255 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 ...
7
votes
2answers
4k views

PostGIS: Find points that lie within a set of coordinates

I have a PostGIS db, and I want to find the points that lie within some region (a bounding box). I have two sets of coordinates, from which I can get all four rectangle points that form the box (if ...
2
votes
0answers
31 views

Aligning Points in Decimal Degrees

Running ArcMap 10.3 I am displaying a layer of manholes from a table coming from SQL. The XYs are in decimal degrees however they are displaying no where near my other layers (NYC PLUTO). I have ...
1
vote
1answer
26 views

Dynamic XY to line with SQL

using arcmap 10.3 Trying to create a 'live' draw of lines between two coordinate points. So far I have been able to easily create the lines into a new shapefile using the XY to Line tool however I ...
4
votes
3answers
1k views

Incorporating SQL Statements in ModelBuilder?

I have a point data set where each point has a unique operator associated with it. I'd like to select by attribute = operator name and generate a new shapefile for each operator containing only the ...
1
vote
1answer
953 views

ArcMap “One or more layers failed to draw: An invalid SQL statement was used”

I created a model involving the tool Make XY Event Layer because I want to plot latitude and longitude points in CSV file columns. The model runs without errors and appears to have plotted the points ...
0
votes
1answer
544 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 ...
2
votes
2answers
157 views

Trying to use an integer in a WHERE clause

I'm trying to use an integer value in a WHERE clause (looking at an integer field). expression = "'SERVICE' = 'Service' " expression = expression + 'AND ' expression = expression + "'GPS_TIME_TOTAL' ...
0
votes
1answer
36 views

Redirect if Clicked on a Marker in CartoDB

How can the user be redirected if he clicks on a marker in CartoDB? I have a dataset with the markers — the geometry and inside of the description-field the URL to redirect the user. I know I can ...
3
votes
2answers
684 views

Parameterizing SQL Views Geoserver

I must do a view in geoserver. I seen some example here: http://docs.geoserver.org/stable/en/user/data/database/sqlview.html. The example show the operator like for parameterizing view. Suppose, now ...
1
vote
1answer
511 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
16 views

Failure of non existant SQL statement after executing statements from a file with ArcSDESQLExecute object

As you see in my code I iterate and execute all the sql statements in an sql file using ArcSDESQLExecute object. It does work but when all statements have been executed the object returns 'None' ...
1
vote
1answer
374 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
384 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 ...
1
vote
2answers
202 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 ...
0
votes
1answer
49 views

Definition Query to find next date value in ArcSDE attribute table?

I have an ArcSDE feature class that contains a date field called "SALE_DATE". This sale date represents the bid date for ALberta crown mineral rights sales. A sale occurs about twice per month (one ...
1
vote
0answers
23 views

User Permissions on ArcSDE Geodatabase in SQL Server 2012

We set up an enterprise geodatabase in SQL Server 2012; Is it possible to set user permissions at a feature class/table level to only view certain attribute types? For example, a pipe layer has ...
1
vote
1answer
79 views

Split a table of Multi/Linestrings into Unique Linestrings

Is there an efficient way to split a table of Multi/Linestrings that overlap() and touch() into unique Linestrings (note: creating edges using topology is going very...very...very slow). Here is ...
1
vote
1answer
41 views

Select ID by most recent date

I have a personal GDB table that has a non-unique SLID field and a date field. Basically there are multiple records with the same SLID numbers but different dates. I want to select only the most ...