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

learn more… | top users | synonyms

1
vote
0answers
37 views

Compare two columns in QGIS attribute table [closed]

I have two columns in QGIS attribute table: column A = street name column B = Building type [Residential or Commercial] what I am trying to do is get "street name" with the highest number of "...
2
votes
1answer
83 views

Changing Query Layer's SQL Expression with Python

I use query layers in ArcMap 10.4. The maps need to be done/repeated periodically. The easiest way is to copy the map, change the source's SQL expression (e.g. from select * from TABLE where Period = '...
1
vote
1answer
49 views

How do I get arcpy.Select_analysis to skip conditions that don't exist

I have data from 2007 to 2015 of various animals that I'm trying to break up by year and name. I wrote a little for loop that goes through all the items in my attribute table (gps_points). The ...
1
vote
1answer
43 views

Area of influence with CartoDB

I am working on a city transport map, and for fun (and practice) I try to make an area of influence of transport station. But, whatever I try, something gets wrong. So two questions. 1 - How can I ...
1
vote
0answers
77 views

Career after GIS Analyst [closed]

I am 23 years old. BSC.IT Graduate, and currently working as a GIS Analyst in Mumbai for last 1.5 years. I am planning to do SQL Certification followed by Oracle. Would it be helpful? I am interested ...
1
vote
1answer
53 views

St_ClosestPoint within St_MakeLine Query problem

I am currently trying to create the closest point (closest_ports_point_test) on the grid (lng_grid_test) from the original points (ports_point), and to create the line connecting the original and the ...
2
votes
1answer
34 views

Postgis query to sort geometries by latitude

I am looking for an efficient way to get geometries sorted by their latitude (northmost in case of polygons) when querying a postGis database Something that could work in an order by clause which ...
4
votes
1answer
62 views

Change feature class from ESRI native geometry to SQL Server geography

Original question: I have found a lot of documentation on importing and using query layers from SQL Server into ArcCatalog/ArcMap/etc. However, when you change the projection of a feature class or use ...
2
votes
1answer
23 views

Qgis select distinct by default on Print Composer

I have a filter on Print Composer that selects "id_mov" and shows figures one by one into the map. This "id_mov" is not unique so different id can have the same "id_mov". Qgis select distinct by ...
0
votes
1answer
28 views

Spatialite union more than two layers / tables

Is there a way to union or collect any number of layer geometries with Spatialite (or another spatial database)? Two is simple enough, but more than that becomes convoluted. For example, if all I want ...
3
votes
1answer
82 views

Get domain descriptions for multiple fields using SQL (ArcSDE 10.3/Oracle back-end)

How can I get domain descriptions for multiple fields using SQL (ArcSDE 10.3/Oracle back-end)? I have successfully used the Oracle SQL in the ESRI document: Resolving domain codes to description ...
0
votes
0answers
16 views

How can I create a definition query to show the next 5 years of data, based on a text field with the year on a joined table in SDE?

I need to show the next 5 years of construction data, but I want it to automatically update what is shown based on a text field called ConYearStartNbr that shows when the construction is set to start ...
2
votes
0answers
29 views

Programatically populate field_4 after choosing values from other fields?

I'm working with QGis 2.8, editing the attribute table of a SHP file, named "myTable". I need to populate field_4 with the conditions listed below: For 1 to n (it runs across records of myTable) ...
2
votes
1answer
45 views

Export to DXF from PostgreSQL using ogr2ogr

I have a large dataset in a PostGIS database (OS MasterMap). My aim is to export specific areas of this dataset to DXF, while retaining the attributes of the data as layers in the DXF. My current ...
1
vote
1answer
75 views

Pass sql expression with GetParameterAsText to SelectLayerbyAttribute in .py script

With Arctoolbox and python scripting I'm creating long tool, but one of the steps is to select by attributes with SQL expression. Let's imagine that: featureCar = arcpy.GetParameterAsText(0) is Data ...
1
vote
0answers
31 views

Python GDAL open dataset in PostGIS with quotations

Error trying to use gdal to open a dataset in PostGIS with the following code: ds = gdal.Open("PG: dbname=nyc host=localhost user=postgres password=mypassword port=5432 mode=2 schema=public column=...
3
votes
1answer
97 views

What exactly does “enable geodatabase” perform on a SQL database

This is for those extra technical folks out there. What does "enable geodatabase" do to the structure and capabilities of a Microsoft 2012 SQL database. Since I'm a GIS guy and not a SQL guy, I need ...
0
votes
0answers
12 views

Date Query 10.3 SQL SDE vs FGDC

I have a date field "FIRE_DSCR_DT" that I want to query for a specific month(s). For example,I want to get all of the records where the month = January. This query did not work in SDE, but it did ...
2
votes
1answer
30 views

Is there a way to avoid the re-calculation of the same centroid without creating a new column?

All tables contain polygon geometries. SELECT * FROM table1, table2, table3, table4 WHERE st_contains(table2.geom, st_centroid(table1.geom)) AND st_contains(table3.geom, st_centroid(table1....
3
votes
2answers
46 views

Polygon another location

Using google maps I have located 4 points and have created a polygon with them in this way insert into dummy_zip values (4,'prueba_directa','2016-04-13 08:08:15.973731','prueba_directa',1,1,100,'2016-...
1
vote
2answers
41 views

Counting points within range using CartoDB?

I have a dataset of users location and want to assign per user how many other users they have within a given range, and updating this value into a table.The dataset name is "users_20160410" and the ...
0
votes
0answers
36 views

Insert UTF-8 characters to CartoDB database

I'm using Cartodb.js and API to insert strings from jquery variables to my dataset table in Cartodb. //Store variable data.location = $('#location').val(); //Insert to SQL var SQL = 'INSERT INTO {{...
3
votes
1answer
51 views

Update ID Field Using Common Types

Not exactly sure how to word this, but hopefully I do it in a way that accurately conveys what it is that I'm trying to do... I'm using Manifold GIS for this particular project, but I'm open to any ...
0
votes
2answers
36 views

How to avoid manually typing coordinate information in CreateCircle function to select points in Mapinfo

I have a bunch of data points, each of them have a coordinate information (longitude, latitude). I am using CreateCircle( x, y, radius) function to select points within a distance to the chosen point....
0
votes
1answer
57 views

ogr2ogr - Clipping postgis and creating geojson

I'm trying to create a geojson file data based on data from my local postgis database using ogr2ogr. I'm trying to clip to a specific area and when I start to run the command, everything starts fine, ...
1
vote
0answers
34 views

How to upload data from QGIS to a SQL Server?

I'm new at QGIS. I'm wondering if there's a native way or plugin to allow me to upload a shapefile into my SQL Server directly from QGIS. So far the only solution that I could find is the Shape2SQL ...
1
vote
0answers
20 views

Configure new SQL view doesn't appear for different DB's in the same PostGIS Database

I have PostGIS Database with different DB's. Each one of them has different workspace:store in Geoserver. When I'm opening Create new layer page and picking different workspace:store for some of them ...
0
votes
2answers
104 views

MapBasic - Updating blank rows in column with the value above

I am writing a MapBasic tool to correct some incorrect values in a set of tables. So far I have managed to pull out the values I need in a new column: What I need is to update any blank rows in the ...
1
vote
2answers
53 views

Conditional “On the Fly” Column with PostGIS

I have two tables I am working with; tl_2015_us_county which consists of county polygons, and tl_2015_48_puma10 which consists of PUMA polygons. I am currently using the below SQL in order to achieve ...
4
votes
1answer
107 views

Using Not Equal to Wildcard in ArcMap Definition Query?

I'm attempting to use a definition query in order to display only a subset of data. I have a large CAD drawing that I have imported into my map. I do not need many of the lines from the .dwg file to ...
1
vote
0answers
81 views

Cursor help on large spatial query in PostgreSQL

I have two very large tables on which I want to perform a spatial query. UPDATE table_a SET att_1 = b.att_1, att_2 = b.att_2 FROM table_a AS a JOIN table_b AS b ON ...
1
vote
1answer
79 views

Change SRID of geometry column

I have in my table column geom with geometry, data type of this column is geometry(Point,102067). I want to change SRID from 102067 to 5514, but if I use this command select UpdateGeometrySRID('...
1
vote
1answer
31 views

Points to polygons transform, inserting columns

In this task I'am transforming points to polygons. I have table POINTStbl with four columns: ID, YEAR, CODE, POINT and i need to create table POLYGONStbl, where will be three same columns(with same ...
1
vote
0answers
20 views

CartoDB geom (coordinates) join: without exact match

Trying to join two datasets (layers) on CartoDB based on their geographical fields (in CartoDB's the_geom created field). However, the basic ST_Intersection function does not work since its tolerance ...
4
votes
1answer
96 views

Selection by attribute string in ArcGIS 10 with wildcard as part of the name

I have an attribute field in my file geodatabase (GDB) where I'm trying to select all records that contain an underbar in the string field. The issue is that the underbar is considered a SQL wildcard ...
3
votes
1answer
31 views

Assigning the modal average based on points within a polygon

I have two layers: Survey Points Habitat Multi polygon The Survey points contain the field sensitivity I want to assign a number to each polygon based on the modal average sensitivity. This ...
0
votes
0answers
40 views

Updating attribute table by CSV in ArcGIS for Desktop?

I have a File Geodatabase in ArcGis that contains shapefiles and tables. The tables must be updated using CSV or Excel files. The structure of the existing tables and the update csv will be exactly ...
5
votes
3answers
100 views

Limit to number of items using 'IN' SQL syntax in arcmap/arcpy?

I'm writing a python script that uses 'NOT IN ('a', 'b', ...)' statements on very large lists (like comparing 500 items in one feature class against >10k items in another) and am getting weird ...
0
votes
1answer
48 views

Deleting from a view. Mapbasic

I'm using MapBasic and have used a query to get the rowids (populated in a column) of minimum values Select SUBSECT_ID, Row, Min(MaxLV)from LVQuery group by SUBSECT_ID into MinLV Now, I want to ...
1
vote
1answer
106 views

SQL statement to find differences between two fields

I am trying to find the difference of 11 feet or more between two fields (Both are Double types). For example, I have a field called shape_length and another field called station_length and I want to ...
0
votes
0answers
37 views

Storing Select Statements for ArcGIS Query Layers: LYR Files vs Views vs Application Code

I've inherited maintenance of an extension to ArcGIS Desktop (ArcObjects, C#) that allows users to view spatial data and related attributes from our databases (SQL 2008 R2). This is of course ...
1
vote
1answer
46 views

Using output feature class field values in SQL query in model builder

I have two processes in model builder: Iterate over a "ID_SPATIAL" field values = creating a subset of original feature class (and agregating using Frequency tool) Creating a different subset using ...
0
votes
0answers
72 views

Geoserver slow when using sql server and cql_filter

Im using geoserver 2.7.2. with layers in postgis and sql server. Postgis layers is fast and have no problem at all. Layers in sql server is okay until I use a cql_filer - it goes from quick to ...
2
votes
1answer
101 views

SQL / Select by Attributes query for “does not include text found in another specified field”

I'm using ArcMap 10.2 and I'd like to write a query to select features where Field A does not include text found in Field B. Specifically, Field A contains street numbers and street names. Field B ...
2
votes
0answers
35 views

Where do field aliases reside in an SDE database?

If I want to get field aliases for an SDE table through pure SQL, what table do I query? My geodatabase was created with ArcGIS 10.1 in an Oracle database.
5
votes
1answer
80 views

Creating ArcPy scripting tool with dropdown box for sql expression choice

I am creating an ArcPy scripting tool to allow users to select a feature from a feature layer and then zoom to that selection. I have successfully created this tool and now am working on creating the ...
0
votes
1answer
31 views

ST_Union returning Null with Spatialite, even after ST_MakeValid

I am attempting to run ST_Union on some features in a GROUP BY Spatialite query, with the aim of counting the number of features, and the total area of those features, which may overlap so should not ...
1
vote
1answer
29 views

Parting lines based on intersection with polygons

I have two tables: roads containing one row (line) for each road with column road_code uniquely identifying the name of the road; districts containing one row (polygon) for each district with column ...
1
vote
1answer
77 views

Cartdodb change public map in real-time with SQL query

I'm a data science student working on my capstone project. I'm new to CartoDB and have been playing around with their API a bit but can't seem to find what I'm looking for. I have created a public ...
1
vote
1answer
38 views

Truncate a Shapefile field with SQL and ogr2ogr

I want to create a new attribute which is the first 8 characters of another, using ogr2ogr. To my surprise, this didn't work: ogr2ogr -f "ESRI Shapefile" a.shp b.shp -sql "select FID,left(FLOORKEY,8) ...