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

learn more… | top users | synonyms

2
votes
0answers
21 views

Write userID to field automatically every time an object is edited

Currently every user has to put his/her useriD in a field after every change made to an object in the database. This takes time and can be forgotten easily. Is there a SQL-Command giving back the ...
1
vote
0answers
11 views

CartoDB - timestamp SQL help

I've explored this forum fairly extensively trying to get answers as to why my SQL isn't working. I need help with the timestamp on a torque map. I've used the following formula, obviously changing ...
1
vote
1answer
13 views

How to get Cartodb.js to use https?

I have a simple SQL query from my Cartodb account to populate a chart. Here is the link The chart works fine outside my company on a public network but I keep getting the following error when ...
2
votes
1answer
57 views

Grouping polygons by spatial attributes

I'm working with a dataset that contains millions of polygons representing leased properties. In many cases, there are multiple polygons that are drawn on top of one another (representing multiple ...
3
votes
2answers
39 views

replace records in layer with records form another layer by id and column name QGIS

I have a two polyline layers - one with 2800 rows, the other with 150 rows. Each row has a unique id column. I need to replace the records in one column of the the 2800-row layer with the records ...
-2
votes
1answer
32 views

How much RAM do I need per SDE DB [closed]

Estimating RAM required is never a fixed number. However, there are base figures to follow for example for arcgis server services. How much RAM do I need to plan per DB? I'm using SQL Server but ...
0
votes
0answers
6 views

Null output from Transform function of Spatialite

I am using Spatialite, an extension of SQlite and I have some problems running the transform function. According to the Spatialite functions page ...
4
votes
2answers
66 views

In terms of SQL, what exactly is Query Layer's “Unique Identifier” doing?

When you make a link with a database using Query Layer in ArcMap, you must select a Unique Identifier, which ensures that the resulting Layer only has unique records in the Attribute table. In some ...
7
votes
1answer
126 views

Join by attribute / spatialite with SQL / left outer join in QGIS

I have a layer with polygons (let's call it "woods") that is intersected by "n" line-objects ("roads"). Every road has an unique attribute roadid. I need to add ALL the roadid's (not only the first ...
3
votes
1answer
74 views

Running PostGIS ST_ClusterWithin on large dataset?

I am trying to use the new ST_ClusterWithin in PostGIS 2.2 to help me aggregate building polygons that are within 5 metres. The source data has > 13million polygons. I ran the following query on a ...
3
votes
1answer
32 views

How to replace a directory using QGIS Field calculator?

I have a column called Hotlink full of incorrect directories and I need to edit them. They currently read C:/ABCD/filename.pdf and I want them to read C:/Maps/ABCD/ABCD/filename.pdf The script I'm ...
2
votes
0answers
33 views

Using Make Query Table to join featureclass with table using 2 fields

I would like to join a forest density table to a forest ownership featureclass in a geodatabase based on two columns in each (TPO_Owner and County_Nm) so I can populate the Density column in the ...
1
vote
1answer
24 views

Selecting the minimum point in a polygon

I am attempting to find the minimum point value within a polygon using ArcGIS 10.3. I have two datasets: 1) A series of polygons & 2) A series of points scattered about. After selecting a given ...
2
votes
0answers
35 views

How can I convert a shapefile from a single line segment to separate side segments using PostGIS?

I have a shapefile (STC) which is a single line segment per street with information for both the odd and even sides of the street. This .shp file has to be converted to separate side segments. To do ...
1
vote
0answers
15 views

Subset of spatial data causes slow SQL Spatial STIntersects

I've been having an issue were a specific subset of data causes an SQL spatial intersect to run extremely slowly. I am running sets of 1000 points against a subset of polygon layer to be intersected. ...
1
vote
0answers
24 views

How to access a feature by specific field value using python ogr in an efficient way?

I have one point layer and one polygon layer with a common identifier attribute field called "N", same objects amounts but Feature IDs (FID) are different. I have to iterate on the first one and what ...
5
votes
2answers
80 views

How can I cluster all points in a postgis table together based on their distance from each other?

I have a PostGIS (in postgres 9.3) table which has Points. I want to figure out the "clusters" in the data. If 2 points are < X distance apart, they should be added to a cluster, and this should be ...
1
vote
1answer
23 views

PostGIS update statement returns wrong information

I have two tables in postgis with polygon data. Both are in wgs84. I want to update a column (column1) in the one table (table1) with information from a column (column2) in the other table (table2), ...
2
votes
1answer
56 views

Creating SpatiaLite View in QGIS?

Using these instructions (there are several other examples to find, all look the same and all of them seem to work) http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/sp-view.html "Hand-writing ...
0
votes
0answers
43 views

Convert XY to Lat Long using SQL?

My organization is creating a 311 mobile app. The backend is all run through SQL and report emails are generated. We are grabbing the xy from the app and then want to translate it to Lat/Long to be ...
1
vote
0answers
28 views

How to transfer SQL variable back into ArcPy script?

I am trying to teach myself to access sql tables from an ArcPy script as part of a larger QC process. I am fairly certain that I have the sql statement correct (it works in SQL Server, albeit ...
6
votes
3answers
78 views

Select all polygons that are completely within a circular buffer

I made several buffers around some points. Now I want to select all polygons that are completely within this buffer. My problem is that I also get the polygons that are partially outside of the ...
0
votes
0answers
4 views

SQL current timestamp [migrated]

I have made a featureclass for a utility company where they can register measures set up to mitigate problems with rats, called "mitigation measure". From this feature class it is possible to state if ...
0
votes
0answers
19 views

How to find Nearest point on line from a point cordinate in SQL server

I want to find out the nearest point on my road network which is a multiline string from a point with lat lon value. The below code I have tried for finding buffer distance line from a point. ...
0
votes
0answers
14 views

How to Find Source and target using STBuffer And STIntersects in SQL Server?

I am using this query to find the source and target from Routes table, but it's not getting the correct result SELECT TOP 1 a.target FROM Routes a WHERE ...
0
votes
0answers
22 views

Is there a way you can see the spatial query that vector uses?

I am using geoprocessing-tools --> intersections to calculate which points are within my circular buffer. It works fine but I want to know what query(/code) vector is using so I can add some ...
3
votes
0answers
41 views

SQL SERVER 2012, Python subprocess, OGR

Need help with uploading shapefile with srid 102008 to SQL server 2012. I ran the ogr2ogr script in the ogr shell and it uploaded the shapefile within seconds but when I try using python subprocess to ...
1
vote
1answer
27 views

Use Postgis to convert wkb_geometry data type to geom datatype

How would I write an ALTER statement or otherwise to convert an existing imported data column from " wkb_geometry geometry(LineString,4326)" to a geom data type? I ask because I've moved to ...
2
votes
2answers
54 views

Is there a way to select all items within a circular buffer?

I want to select all the items within a circular buffer. Inside the buffer are multipolygons and multipoints. See the screenshot i have posted.
3
votes
0answers
24 views

How to use pythons' GeoAlchemy2 to filter on dynamically generated Points?

I'm trying to do something like this SQL query in Geoalchemy2: SELECT district_polygons.district FROM markers, district_polygons WHERE ST_Contains(district_polygons.multi_poly, ...
0
votes
1answer
49 views

Create a geoserver SQL view from Oracle SQL using a lat and lng column

I have a table in a Oracle SQL database in which I have a polygon geometry and two more columns of latitude and longitude. What I need is to show the points of lat and lng in a layer in geoserver. I ...
2
votes
1answer
36 views

Using “SELECT DISTINCT” in SQL Query for Labels?

Working with ArcGIS 10.2. I'm using GIS data downloaded from SHA and I'm using it to label roads. I have three different features I've selected to label (different kinds of roads). To keep it brief: ...
1
vote
0answers
17 views

deleting lines with smaller length and overlapping oracle spatial

I need to identifying polylines which are overlapping with each other and deleting them which is smaller in length in Oracle Spatial.
0
votes
1answer
33 views

ArcGIS Select largest N rows in group

I have feature class (Name: V1) in personal geodatabase with columns: Height [float] and Id [int] representing group number I need to do SQL query that will select eight highest 'Height' values in ...
0
votes
0answers
15 views

if then else statement in Exponare?

I am currently trying to rewrite an SQL statement for Exponare so that if the user is not the administrator only certain attribute table columns are displayed should a query or selection be performed. ...
0
votes
0answers
22 views

Selection Based on Range of Values from another table

I'll try to explain this is as simply as possible. I've figured out how to create this table in SQL, no problem. But I'd like to have this done in python as part of a larger model. I have a feature ...
4
votes
1answer
67 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 ...
3
votes
1answer
25 views

how to create a new row with a counted points in postgis

I have two tables in postgis (pgadmin). In one table there are points and in the other table there are polygons(provinces). The tables are both over the same location (Netherlands). I want to count ...
0
votes
0answers
19 views

Set alias for subfields when performing query

As mentioned within the ESRI-docs we can set an Alias for the subfields of an SQL-query performed onto a file-geodatabase as follows: IQueryDef2 filter = (IQueryDef2) ...
4
votes
0answers
57 views

Create polygon from lines in PostGIS

I'm trying to divide a polygon in smaller polygons from a line, but I think I can't use the st_split function. What I need is to create small polygons inside a big one, using linestring grid. I've ...
2
votes
2answers
60 views

Problems with SQL expression formatting and calculate field management

I am trying to take the population census tract and calculate the percentage of population by each census tract in the field (Populati_2). To do this I'm creating a new field with the total sum of the ...
1
vote
1answer
49 views

Possible CartoDB SQL add-on?

Is there a possible add-on that will simplify the user experience when creating a SQL statement? More specifically, is there a GUI that would allow the user to create a SQL statement similar to ...
1
vote
1answer
34 views

Get lat and long in two columns as floats for all points in MULTILINESTRING in PostGIS?

ST_DumpPoints(geom) gives me something like this: ("{1,1}",0101000020E61000002DEDD45CEEB362C0CE1951DA1BC24E40) ("{1,2}",0101000020E6100000C94AD826F1B362C09D4B7BC72CC24E40)... Where I want it to ...
2
votes
1answer
37 views

How to create lines from coordinates?

I have a data table about national bus lines, with timestamps, vehicle IDs, line IDs (which line the bus is moving on), and coordinates(geom). I can add my points to QGIS on show them on OSM, but I'd ...
1
vote
2answers
70 views

Checking if SQL where clause is valid with Make Feature Layer?

Unfortunately it's possible to apply an invalid SQL where clause when using arcpy.MakeFeatureLayer_management. This can cause issues later in a script. For example, I created a feature layer and ...
0
votes
1answer
32 views

Arc 10.2.2 crashes when adding query layer?

I'm trying to add a query layer from an Oracle database into a blank 10.2.2. map. I enter the query, validate, finish, and the software thinks for a second and then just winks out. No error ...
1
vote
3answers
58 views

Intersection of 2 Linestrings (not interpolated)

I am struggling with a query in POSTGIS I want to find linestring geometries where the geometries are containing the same point. I don't want to calculate the intersection points. I only want to ...
7
votes
3answers
262 views

Constructing Voronoi diagram in PostGIS

I'm trying to construct voronoi diagram from grid of points using modified code from here. This is SQL query after my modifications: DROP TABLE IF EXISTS example.voronoi; WITH -- Sample set of ...
1
vote
3answers
41 views

Is a SQL String Aggregate possible in arcgis?

I have created a feature class from the results of a 1:many join between a table and a polygon layer in ArcGIS 10.3. The polygon layer contains land parcels and the table contains names. Where a ...
0
votes
1answer
30 views

Parcel Owner to see only his parcel in map application

How can i create a map where user can only see his parcel. parcel are defined has one unique ID. I have Arcgis online Server and Desktop Advanced license. the map to be published in a web application ...