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

learn more… | top users | synonyms

1
vote
1answer
18 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 ...
2
votes
0answers
22 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 ...
0
votes
0answers
21 views

Finding a substring within a table of data between 2 string positions in PostgreSQL

I am trying to populate a view in PostGIS and in this view I want it to contain a substring based on 2 string positions. See below for my code. CREATE OR REPLACE VIEW vw_actions AS SELECT ...
0
votes
1answer
15 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' ...
0
votes
1answer
34 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 ...
0
votes
1answer
44 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
18 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
60 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 ...
0
votes
0answers
25 views

SQL fails in python. In ArcMap error FDO error: -2147024871 returned

I'm having issues with an SQL expression for a feature class in a file geodatabase. When working in ArcMap, the SQL will fail on its first attempt, and produce the following error: However, when I ...
1
vote
1answer
33 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 ...
0
votes
0answers
36 views

Densifying OpenStreetMap (OSM) network nodes?

I am working with osmconverter to convert osm files(*.osm) to *.pbf, then i use osm2po to get sql file that run into PostGis to get a network table. The last step is to run a createTopology ...
0
votes
1answer
47 views

SQL and ArcGIS data querying: what's the difference?

I am wondering if the language used by ArcGIS for data querying (e.g., search by attribute) is part of the SQL language, or to what extent there is a connection between the two (and where does it come ...
0
votes
1answer
49 views

MapInfo SQL: Selecting all columns from one table, some cols from second table?

I'm fairly adept with the SQL Select in MapInfo, but I'm running into something that's got me a bit stumped. I've got data in two tables that have a few columns in common. I want to join the tables ...
0
votes
0answers
11 views

Obtain minor distance given am array of points

I have built a query to obtain the minor distance given a point. SELECT name, city, region, Distance(GeometryFromText('POINT(-56.237076563852 ...
1
vote
1answer
62 views

Reference Selection in SQL query (where clause)

I keep raising errors with my where_clause in the 9th line of this script. FID is an Object ID field and I want the cursor to select whatever row it is currently pointing at. I don't know how to do ...
2
votes
1answer
25 views

SQL Server Geography Query works but Geometry Query Does Not - Different Tables, Similar Schemas

I am trying to get a Geometry query to work. A similar Geography query works fine but I must work with a table that uses a Geometry type. Although the Geography version returns lots of records as ...
1
vote
2answers
49 views

SQL query new feature with loop

I'm trying to create an individual buffer feature class for each column of an input feature class, where there is a field that contains the buffer distance. I think there is a problem with my SQL ...
1
vote
1answer
53 views

arcpy; Select by attribute with an If, then statement

I am looking for some advice on how to construct an if, then statement based on a select by attribute SQL query or some other method (search cursor?). I am asking users to input a unique ID ...
0
votes
1answer
50 views

Updating Oracle Spatial geometry column using SQL?

I am trying to update a table B geom column with the coordinates from table A. Table A having coordinates in two separate columns x and y. Table B to have the coordinates from Table A into Table B's ...
1
vote
1answer
45 views

ArcSDE - spatial index grid size for empty table

I'm trying to write the SQL to create a feature class and spatial index in an Oracle SDE geodatabase using ST_Geometry. This is how I'm making the table: CREATE TABLE STREETS (ID NUMBER(11) NOT NULL ...
1
vote
1answer
32 views

Query Sql Error

I want to join these 5 tables with MapBasic, because i want to use in statistic : Select * From Malade, Maladie, Ilot, Etat_Ilot, Pauvreté Where Malade.Maladie = Maladie.ID_maladie ...
0
votes
1answer
28 views

storing metadata of various services according to ISO 19119

I need to store the metadata of web services according to ISO 19119 standard.Hence I am looking for some guidelines for designing the database for storage.Can any one suggest any document to help in ...
2
votes
3answers
81 views

How to use the SQL in select by attribute to select the entries for each values in certain field?

I am trying to use select by attribute for the table in ArcGIS, which is similar to the following picture (lets say): I want to select those entries for each A and B, which have maximum count. I ...
0
votes
0answers
42 views

Geo spatial extensions in MariaDB vs MySQL

MariaDB is interchangeable with MySQL, but are there any differences in terms of each respective GIS features? Switching from one to the other is still a drop-in replacement with geo data types or ...
2
votes
0answers
65 views

Visualizing variability in the size and shape of polygons

I am working with a data set of area restrictions imposed by criminal courts. These restrictions ban a person from entering a demarcated area. These restrictions vary in their size, shape, and ...
0
votes
1answer
32 views

How to connect SQL SSMS to ArcGIS file geodatabase

I've found this reference article talking about how to query a file geodatabase using SQL. ...
0
votes
1answer
54 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
102 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
21 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
48 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
45 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
122 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
35 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
40 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
32 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
41 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
64 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
124 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
53 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
52 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
45 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
67 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
27 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
40 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
1answer
37 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
53 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
36 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 ...