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

learn more… | top users | synonyms

1
vote
1answer
17 views

Converting double field to integer in database view so ArcMap query layer can use field as unique identifier?

I have a field in a table that is a double data type, but the values are actually integers. The table is from third-party software, so I don't have control of the field data types. I'm attempting to ...
1
vote
0answers
120 views

ArcGIS ModelBuilder Iterate 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 ModelBuilder to iterate over several tables and Make Query table for each one. I'm trying ...
0
votes
0answers
33 views

Select all lines between two points

I need some ideas to solve the problem selecting all "lines" between two "points" using SQL Server. I have tables: Lines (line_id, geom) and Point (point_id, geom) I want to select all Lines between ...
0
votes
1answer
31 views

carto.com when 2 points have the same location

Carto.com: We are mapping homicides and when two deaths occur at the same location, how do I prevent 2 points with the same lat, lon from overwriting each other? I want to be able to view each point ...
-1
votes
0answers
25 views

Spatial Intersect table A and table B [closed]

I am trying to write a sql query using spatial intersect relation on table A (polygon) and table B (Point) to find the maximum intersect point and delete other points in each polygon group.
0
votes
0answers
5 views

How to create class break Rendering using an array?

How to create class break rendering using an array? I don't want to use feature layer field to render instead of field i need to use array that is in the form of array=[1,5,13,,1,20,32,6,8,7,...]; ...
0
votes
1answer
1k 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 ...
1
vote
1answer
297 views

How to query the data using SQL in the infowindow of CartoDB

I want to use a SQL join to merge data from 2 tables and display it in the info-window. When I give my query Select table_2.hos_name,table_2.revenue from table_1,table_2 where table_1.area_name = ...
0
votes
1answer
48 views

Where to look up type of SQL syntax used by ArcGIS Desktop 10.x and Pro 1.x

I have searched all obvious resources in order to look up the type of SQL syntax used by ArcGIS Desktop (10.x) and Pro (1.x) with no luck so far; that includes Google, Wikipedia, gis.wiki.com, ...
1
vote
1answer
215 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
1answer
21 views

How to count point attributes that fall within a polygon in postgis?

I have a point shapefile called pointA that has a field called fieldB, and a polygon file called polygonC, and I want to calculate the sum of fieldB for all the points that are within polygonC How to ...
0
votes
0answers
13 views

Passing multiple parameters in query task where condtion in ArcGIS API for JavaScript 3.17?

I want to find the hostels within assembly location(selected through dropdown) using feature layer as well as sql store procedure am trying to execute the query.my code is like this..(arcgis ...
8
votes
2answers
3k views

SQL query to have a complete geojson feature from PostGIS

I would like to get a geojson feature with properties from PostGIS. I have found an example to have a feature collection but I can't make it works for just a feature. so far I tryed to modify the ...
1
vote
0answers
17 views

Trying to get all Landscan Urban areas in the USA (from Natural World shp files)

I'm desperately trying to get a json file of all the Landscan urban areas in the USA. The ne_10m_urban_areas_landscan.shp has a list containing polygons of all urban areas in the world with a NAME ...
3
votes
1answer
33 views

SQL for spatial view of line start/end points (Oracle ST_GEOMETRY)

How do I create a spatial view that generates dynamic point geometry of the start point and end point of a line feature class? The environment is Oracle, SDE 10.3.1. I have successfully made a ...
2
votes
1answer
645 views

How to split polygons with another polygon and inheritage data?

Let's say that we have two tables with polygons representing areas. Table A and Table B. Geometries from table A represents both the valid and invalid areas. And the geometries in table B represents ...
1
vote
1answer
31 views

I can not add geodatabase connection from another PC to SQL server 2014

I have a problem. I can not solve it. I did everything what I think. I install SQl server 2014 and create Test1 database on My PC. Now I want to add Geodatabase connection in Arccatalog on Another PC. ...
1
vote
2answers
39 views

Add a geometry in sqlite in pyqgis

I'm trying to create a geometry column in a table which I created. I found the following code: cur.execute('SELECT addgeometrycolumn(%s, %s, %s, %s, %s)' %(table_name, geometry_column_name, EPSGcode,...
2
votes
1answer
439 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? ...
2
votes
1answer
3k views

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

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
24 views

Drawing prevented by invalid sql statement in ArcMap?

I am using ArcMap 10.3.1. One or more layers failed to draw: New Folder_gpspointsnewtxt.txt Events: The operation was attempted on an empty geometry. New Folder_gpspointsnewtxt.txt Events: An ...
1
vote
2answers
44 views

How to obtain Census block data in SQL format?

I am trying to create a web app where users can query a certain type of data that is offered by the Government. Unfortunately, the government prefers "Census Tract/Blocks" as opposed to Zip codes (it ...
0
votes
0answers
37 views

Selecting only time in datetime field

I have a 'date' field (is a date field) in ArcGIS that contains both date and time: 'mm/dd/yyyy HH:mm:ss' and need to query only the time portion regardless of the date. I need times between >= 09:00:...
0
votes
1answer
270 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
54 views

Writing shapefile to SQL Server database with ogr2ogr Error

I have been using ogr2ogr to write point shapefiles to a SQL Server Database of mine. I used it 2 weeks ago and it worked fine, but, today when I tried to run it, I get the following error: ERROR1: ...
2
votes
2answers
189 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 ...
3
votes
2answers
30 views

Is there a SQL Server package similar to Oracle's SDO_CS?

I see that Oracle's SDO_CS package is able to do datum transformations. I'd like to do datum transformations in SQL Server. I searched, but have not found something like this for SQL Server. Is ...
4
votes
1answer
508 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
2answers
208 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?
3
votes
1answer
859 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 ...
1
vote
1answer
23 views

Error on join in ogr2ogr

I am doing an ogr2ogr process where i will be making a join between two tables, imported as shapefiles and .csv to join on a column with idential attributes. The code i've made so far looks like ...
1
vote
1answer
34 views

Random Selection using Select By Attributes tool in ArcMap?

How I can make a SQL syntax to generate "RANDOM SELECTION" in Select by attributes tool in ArcMap?. E.g. We have two kind of sample: Quantitative an Qualitative data. Quantitative (seven cases): 1,...
1
vote
1answer
108 views

Updating static GTFS data android

I have an android application that takes a static GTFS data that I manually turned into a database. How do I update this GTFS data automatically, or is that not possible?
0
votes
0answers
13 views

How to filter two layers from drop down menu cartodb.js?

I am very inexperienced with Javascript. I already have a script to query a table column to auto populate a drop down menu and query the polylines based on multiple selections as attached below. I ...
1
vote
2answers
90 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 ...
0
votes
1answer
551 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 ...
2
votes
1answer
679 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 ...
9
votes
3answers
3k views

Getting list of distinct values from shapefile field using QGIS?

I have a shapefile whose features I can filter by specifying a where clause in the query dialogue. F.x. I have a field named 'city_name' and by stating 'city_name = "London"' in the where clause only ...
5
votes
2answers
10k views

How to get the data type of each column from a postgis table

I need to get the column data types of all columns in a table, including the geometry types. What I wanted to know is if there is a function or SQL that gives something like this: column_name | ...
0
votes
1answer
22 views

How find Nearest points using STBuffer and STContains in SQLServer using given point from point table?

This is the Query I am using now.. SELECT top 1 coloumname FROM tablename WHERE ROUND ((geometry::Point(74.8427116215336,12.852857058953,4326).STDistance(the_geom))*111.325,2) <2 ORDER BY ...
1
vote
1answer
21 views

How to update a line attribute in PostGIS using an attribute from the polygon in which it is contained?

I have a road dataset which I want to update using the speed information from the state polygon in which it's contained. for all roads (line) within a state (polygon) if the road speed is null road ...
2
votes
1answer
53 views

Query over all layers in a mxd Arcpy

A newbie to python here. Ive been trying to query all layers on a mxd and have sucessfully implemented a script by advice on here. What I need to do now is to firstly make the query a parameter that ...
4
votes
2answers
211 views

Sql syntax in Model builder

In ModelBuilder I am trying to perform the following query, using the select by attribute tool. I am having great difficulty with the sql syntax. What I am trying to do is Select Top 3 (Avg) Price, ...
0
votes
0answers
31 views

Creating Database View using ST_Buffer

I am trying to understand how to create a database view that shows a 150 foot buffer around each point in a table. The table of points changes pretty frequently and I would like to use a view instead ...
2
votes
0answers
20 views

SOL help in QGIS: rule based styling to show timestamp increase via gradient

I have some polygon data from a tractor that shows it's route among other things. It has a timestamp column which I'd like to use to show the route in which the tractor drove through the field via a ...
1
vote
0answers
56 views

Getting H2GIS functions to work in Spherical Space?

I've been playing around with H2GIS (http://www.h2gis.org/) for a project at work and am struggling to get the H2 functions to operate in spherical space (lat/ lon), rather than cartesian space. The ...
1
vote
0answers
28 views

PostGIS Nearest Neighbor query performance - can it be quicker?

I want to canvas the community to see if my nearest neighbor query can be optimized at all. I am happy with my current results, but I'm always up for improving. I have 2 tables, lakes and towns. I ...
0
votes
0answers
28 views

Define points within multiple lines

I have points set in certain radius. I want to define points within certain lines which represent natural and structural borders (streets(red), rail road tracks(green), water barriers(light blue), ...
1
vote
3answers
40 views

ArcGIS Dissolve/SQL group by

I have a GIS layer that has thousands of Facility IDs. For each Facility ID there can be multiple Chemical ID's. For each chemical ID there is a maximum of 3 zone types. Zone A, B, C. But there is not ...
0
votes
1answer
44 views

How to create a line into a table in Postgis?

I need to draw a line and create a new entry on an existing table in Postgis. Say I have a table called myTable and two points with coordinates 528115,181037 and 528115,181037 using the EPSG:27700 (...