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

learn more… | top users | synonyms

1
vote
1answer
21 views

How to determine if all polygons are contiguous by single point in SQL Server

I've been looking for some function that will consider geometries from a table. The selection would look something like this: SELECT geom FROM mytable WHERE geoid IN (1, 10, 15, 30, 2) How can I ...
2
votes
0answers
44 views

Between operator QGIS

I am using QGIS Essen version (2.14.1). I am trying to filter my data based on dates. I am wondering if the "between" operator exists like in SQL? I'm trying the following query but the results are ...
4
votes
1answer
231 views

Merging multiple feature classes in file geodatabase with ogr2ogr?

Is there a way to merge multiple feature classes into one feature class in a geodatabase with ogr2ogr? If this isn't possible with ogr2ogr, is there another method? I'm using the ESRI File Geodatabase ...
2
votes
1answer
42 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 ...
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) ...
3
votes
1answer
71 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 ...
1
vote
1answer
24 views
1
vote
0answers
34 views

Unexpected token in a sql query (Hibernate)

I have no more idea in how to run this query: SELECT row_to_json(fc)::text FROM (SELECT 'FeatureCollection' As type, array_to_json(array_agg(f)) As features FROM (SELECT 'Feature' As type, ...
0
votes
0answers
38 views

Converting polylines coordinates stored in PostGIS in column type text, in another column type geometry(MultiLineString,2154)?

I want to draw a polyline on a leaflet map and then send it to PostGis with php. I’m drawing my polylines using the Leaflet draw plugin and send the coordinates in a column “coords” in PostGIS with ...
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 ...
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 "...
1
vote
1answer
47 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 ...
2
votes
1answer
63 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 = '...
22
votes
6answers
5k views

PostGIS: Select features that do NOT intersect

This seems to me like such a simple question (and it probably is) yet I cannot seem to find an example that gives me the answer. Using PostGIS, I just want to select points that fall outside of ...
7
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
1answer
38 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
1answer
683 views

What options are there for geolocation-aware SQL databses? [closed]

I need to implement an SQL database that can make queries using geo-location based logic. e.g. select rows within 500m of coordinate x, y What options are available to do this with sqlite, mySQL, ...
1
vote
1answer
51 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 ...
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 ...
2
votes
1answer
32 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
50 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 ...
0
votes
1answer
24 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 ...
1
vote
1answer
530 views

Using sql SELECT DISTINCT in Fusion Tables API

How do I go about using sql SELECT DISTINCT in fusion tables API?
3
votes
1answer
50 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
0answers
13 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 ...
0
votes
1answer
176 views

How to Transform Many Projections Into One With SQL Server

I know very little SQL Server, but am quite familiar with Arc and Python. The data I want to transform is point data which is in a single table [ID], [X] [Y], [COORDSYS]. There are 5 possible ...
1
vote
1answer
66 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=...
1
vote
2answers
37 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 ...
3
votes
1answer
95 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
11 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
29 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....
0
votes
0answers
31 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 {{...
4
votes
1answer
1k views

PostGIS intersection function

I have a problem with intersection function. I built my query following http://manual.linfiniti.com/en/postgis/geometry.html, 5.7 section. I made my clip object, a red linestring frame: But after ...
0
votes
2answers
35 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
53 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, ...
3
votes
1answer
1k views

calculate value using maximum value from different feature class

I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class. fc2.bldg_id = max(fc1.bldg_id)+1 Can this ...
1
vote
0answers
25 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
73 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
51 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
103 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
67 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 ...
4
votes
1answer
91 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 ...
1
vote
1answer
71 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 ...
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 ...
1
vote
0answers
18 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 ...
0
votes
0answers
39 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 ...
6
votes
1answer
1k views

ogr2ogr selecting features by attributes

I am writing a shapefile after some processing; however, in the final step I need to do some selection by attributes from the the shapefile. I am using the command in a shell with the aim of using it ...