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

learn more… | top users | synonyms

1
vote
1answer
13 views

Geoserver not recognizing jsonb attribute in SQL view of PostGIS db

I have an instance of Geoserver 2.8.2 running and a PostGIS database. I am attempting to create a FeatureType based on an SQL view of the following table (viewed through psql \d): ...
2
votes
0answers
25 views

postgis query performance

The db structure is more or less like this and can't be modified. I can only add some indexes but can't set for example foreign keys: CREATE TABLE adresspoint ( id character varying(3999) NOT ...
1
vote
1answer
22 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 ...
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
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
14 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 ...
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
0answers
18 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
34 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 ...
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. ...
0
votes
1answer
25 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 ...
0
votes
0answers
58 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: ...
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,...
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 ...
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:...
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 ...
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
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
2answers
48 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
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 ...
0
votes
0answers
32 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
21 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 ...
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 ...
1
vote
0answers
29 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 ...
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
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
47 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 (...
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), ...
0
votes
2answers
39 views

Arcpy Select by attributes IN operator with Tuple

I have two layers 1. Buffer zones with a string ID 2. the same buffer zones with the String ID plus an extra field call it zone B *this process is taking place within a loop already, just to give ...
1
vote
1answer
68 views

In Postgres how to create columns with geometry?

I have point data stored in the postgis server and I need to create a new table with their geometry values. How can I extract their coordinates and translate them into a table. Something like: ...
3
votes
1answer
52 views

Creating one layer through use of SQL queries for land use categories

I have a map with about 63 grids and trying to determine the land cover user category of the greatest area size in each grid. The land cover categories have been converted to polygons and I already ...
5
votes
2answers
97 views

SQL MAX Subquery in arcpy.MakeFeatureLayer_management

I am having an issue with subsequent subqueries in making a feature layer in arcpy. My table has fields: OBJECTID, pointid (long), grid_code (double) I can successfully extract MAX(grid_code), ...
0
votes
1answer
50 views

select neighbour polygons in sql

I have a database of few milion records (all houses in my country). Now I want to select all records who have a neighbouring record (a house next to it) and give this a status 'T'. Each record has a ...
1
vote
0answers
13 views

Append object from another layer to the new layer through form (drop-down list)

I'm trying to get to know is it possible to append object from another layer to the new layer through form (drop-down list)? Do I need to create an application? If yes please tell me what language ...
0
votes
0answers
58 views

Why does ST_Area in SQL give a different value to $area in QGIS?

The area value I'm getting using the SQL term 'ST_Area' is markedly different from that gained from QGIS functions like $area, the area measure tool and area as a derived feature (all of which agree ...
1
vote
1answer
64 views

Recurring SQL Expression Parsing Error on Query Builder

I am using Query Builder in QGIS 2.14.2-Essen to select one country (Peru) among 237 for which to show two layers (states_provinces, boundary lines) from the Natural Earth database. I am paying close ...
3
votes
1answer
75 views

How to use a polygon as a reverse cookie cutter on features in a Postgresql database

I want to be able to use a polygon in a database to remove all features and parts of features that falls within the polygon. Not as part of a query transferring the database to another database. I ...
1
vote
1answer
45 views

Postgres st_intersection points/polygon

I am trying to use the ST_Intersection function to intersect points by county and find the counts by county, but I am having no luck. SELECT counties.name, FROM counties INNER JOIN routes ON ...
1
vote
1answer
38 views

Postgres/postgis st_makepoint

I am looping through a csv, taking latlng values and trying to add there geometry to postgis enabled postgres table. xy values are int's conn = psycopg2.connect("connected") cur = conn.cursor() cur....
0
votes
1answer
82 views

Python to Postgres insert Geometry syntax

Having trouble creating geom columns and inserting geometry lat lng values into postgres table Is my syntax correct in creating the point geometry fields? st_makepoint is the point constructor. ...
1
vote
2answers
47 views

Convert colum type in PostGiS via DB Manager/ SQL in QGIS

I have a csv file that I want to bring into a PostGIS database through DB Manager in QGIS. I have a column/ field called "Location" that contains geometry (e.g. (40.789423 -75.628493 232....
0
votes
2answers
25 views

Wildcard on Geoserver SQL View

I have made the following SQL view on Geoserver: SELECT * FROM areas WHERE landuse = '%landuse%' This works perfectly fine when I specify the landuse in the URL, for example 'grass'. However when I ...
3
votes
1answer
94 views

How to loop in PostGIS to add the next lat long to a route

I want to loop over the results of a query and then pass row(n)'s longitude, latitude and row(n+1)'s longitude and latitude to another function. I have a query which returns a set of coordinates from ...
1
vote
1answer
24 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
52 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 ...
1
vote
1answer
25 views

How to get the geometry of all tables in a postgresql database?

How can I return all tables geom?