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

learn more… | top users | synonyms

7
votes
0answers
187 views

Spatial query too slow to handle bigger OSM extracts

I'm trying to compute some statistics for OSM data using PostgreSQL 9.3.5 and PostGIS 2.1.4. I started with a small bavaria extract which I downloaded from Geofabrik. The db schema is the normal API ...
5
votes
0answers
330 views

Geoserver create SqlView Layer with Geoserver Manager

I would like to register a new sql view layer to geoserver through the rest api. I am using geoserver-manager. The registration is ok, the layer is working fine, except wms getFeatureInfo, which ...
4
votes
0answers
62 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 ...
4
votes
0answers
90 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 ...
3
votes
0answers
51 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, ...
3
votes
0answers
100 views

Visualizing variability in the size and shape of polygons

I am working with a data set of area restrictions imposed by criminal courts. These restrictions ban a person from entering a demarcated area. These restrictions vary in their size, shape, and ...
3
votes
0answers
155 views

Preserve datatypes when using SQLite and QGIS

Following Nathan's SpatiaLite/DBManager solution in this answer, I find that once the layer is loaded from DB Manager into QGIS (2.6.1), any calculated fields are appearing as text values instead of ...
3
votes
0answers
297 views

Tables from SQL Server to QGIS Layers

I'm a beginner SQL and GIS user and this my first time using stackexchange, so apologies if I'm asking the question properly. I'm trying to open some MSSQL tables in QGIS. I established a connection ...
3
votes
0answers
500 views

How to export data from sql server into shapefile in the decimal format in QGIS 2.4?

The last couple of days, I have been working on exporting data from SQL to a shapefile in QGIS 2.4. While converting into a shapefile, the data type changes automatically from Float to Integer in the ...
3
votes
0answers
110 views

How to express not within/inside predicate in spatial database with good performance

In our application we want to express some spatial predicates as objects not within some areas, but unfortunately it has very bad performance. The following SQL is generated by our application: ...
3
votes
0answers
437 views

Geoserver WMST Date Format

There is table in SLQ-Server 2008 R2. In this table i have date column with date format like this 2006-09-08 14:39:41.000. Now i make View from this table on Geoserver side but do nothing wiht date ...
2
votes
0answers
38 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 ...
2
votes
0answers
26 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
0answers
31 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.
2
votes
0answers
27 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 ...
2
votes
0answers
42 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 ...
2
votes
0answers
47 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 ...
2
votes
0answers
36 views

QGIS - WHERE SQL within a processing.runalg statement for v.surf.rst in python console

I'm creating lots of raster files with grass:v.surf.rst so rather than using the graphical interface I wanted to use the python console (and potentially put in in a script at some point). However ...
2
votes
0answers
64 views

Error on qGIS with postgresql views

I have a PostGIS database with various tables and views. With pgAdmin I can make requests on the tables, on the views, all is working. I add tables in QGIS 2.8, it's working, I can read, write, modify ...
2
votes
0answers
39 views

Aligning Points in Decimal Degrees

Running ArcMap 10.3 I am displaying a layer of manholes from a table coming from SQL. The XYs are in decimal degrees however they are displaying no where near my other layers (NYC PLUTO). I have ...
2
votes
0answers
139 views

set Default projection in postgis table

I've set the SRID 4326 for a table having geometry column, but when i insert a geometry without SRID, i get an error because no SRID specified is interpreted as -1 or 0, so how i can set a default ...
2
votes
0answers
88 views

ST_Buffer with segment AND endcap parameters

Making a QGis plugin that buffers a line and I want to declare a high number of segments and a flat endcap. ST_Buffer(geom, 40, 25, 'endcap=flat') This doesn't work with both parameters entered, ...
2
votes
0answers
74 views

Needing to find parent zip code of a bunch of missing zip codes in the US

We're using MapPoint to export zip code / territory combinations. Unfortunately, the export doesn't include PO Box zip codes which mean that we're missing a lot of zip codes The PO Box zip codes are ...
2
votes
0answers
125 views

SQL Query does not work in ModelBuilder (but works elsewhere)

I am having issues getting a simple SQL query to work in model builder. It works fine when I use it with the standard "Select features by attributes tool", but ModelBuilder doesn't find the required ...
2
votes
0answers
123 views

SQL Error Message: Find and Replace for Date Field

Hi, I am attempting to use the find and replace function within the Attribute Table Options to replace fields that contain dates in the following format: month/day/year (e.g. 03/14/2014). The ...
2
votes
0answers
43 views

Multiple Cursors

Below is the sql statement which I have explained below. Declare Cursor c1 is select store_number ,0 as total_area,0 as BG_ID ,0 as store_geom from table1 where CLIENT_ID= 1 and ORG_ID ...
2
votes
0answers
189 views

How can I retrieve/query data from shape file for forms/grid in website?

I've made a site using openlayers and geoserver. currently im serving WMS layers from geoserver (shape files). I want to add in my site a search form that the user can search for data (which I have in ...
2
votes
0answers
2k views

PostGIS Better ST_Intersects Query

I am currently using the following queries to return all features that intersect a large and complex polygon. I initially tried to use a single ST_Intersect query but because the number of features it ...
2
votes
0answers
183 views

Matching points in table to polygons

this is my first post to this forum. I hope to start participating actively. I have a table with several records (aprox 200.000), each with its own coordinates. And I need to identify the "Polygon" ...
2
votes
0answers
1k views

How to handle postgresql/postgis geometry type errors in a function?

I have created the following function in PL/SQL to make a polygon from a set of linestrings: CREATE OR REPLACE FUNCTION _myfunction( _fid integer, _rid integer ) RETURNS VOID AS $$ ...
2
votes
0answers
246 views

Select a distinct attribute with maximum shape area

I am trying to manipulate a large dataset containing a lot of sliver polygons resulting from an overlay operations. (The eliminate tool is very time consuming to generalize them.) I identified the ...
1
vote
0answers
12 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 ...
1
vote
0answers
26 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, ...
1
vote
0answers
29 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 ...
1
vote
0answers
21 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
19 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 ...
1
vote
0answers
57 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
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 ...
1
vote
0answers
44 views

How do I create an attribute table in a web page from GeoServer using JavaScript?

I'm trying to create a custom web application using Leaflet and Geoserver. I've got my layers visible in a map viewer, but I'd also like to show an attribute table of the visible map layers. I can't ...
1
vote
0answers
23 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
44 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 ...
1
vote
0answers
36 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 ...
1
vote
0answers
18 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.
1
vote
0answers
39 views

Inserting search box using dataset column using CartoDB?

I have got some problems to add a search box that can runs searching points from a column of my dataset. I've read this article: How can I link the search box to a dataset column in CartoDB? but ...
1
vote
0answers
51 views

refine nearest_node with radius-distance ( ST_Distance, ST_DWithin )

i am a hobby-IT-person and currently stuck with some simple problem, maybe somebody can help me: This is my working POSTGIS-function, source by underdark: ALTER TABLE distance_graz ADD COLUMN ...
1
vote
0answers
29 views

How would I build the syntax inside a request in the case I wanted to multiply 2 variables?

I would like add something to my previous question (here: How to build QgsExpressions in python?) How would I build the syntax inside this request in the case I wanted field_name to be also a ...
1
vote
0answers
46 views

calculate positive difference by column common value with sql

I have one table with a few columns (and around 9000 rows) see below. Now I would like to calculate the positive difference from R where Xn has the same value and when Xn has the same value as Yn. ...
1
vote
0answers
127 views

PostGIS dijkstra routing - specifying source and target as bigint instead of int4?

I'm currently working on a problem where I have to use PostGIS's pgr_dijkstra to calculate the shortest route from a starting point to a destination, and then use ST_AsGeoJSON to convert the route to ...
1
vote
0answers
104 views

ArcGIS Model Builder-Interate 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 model builder to iterate over several tables and Make Query table for each one. I'm trying ...
1
vote
0answers
59 views

ogr2ogr: export intersected gml using shapefile

I'm trying to do the same as the ogr2ogr example given by http://gis.stackexchange.com/a/119404/6458 The difference is that my inputs are a GML and a shapefile. Export.shp should only contain the ...