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

learn more… | top users | synonyms

6
votes
0answers
165 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
312 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
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 ...
3
votes
0answers
40 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 ...
3
votes
0answers
23 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
93 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
133 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
388 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
395 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
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 ...
2
votes
0answers
33 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
29 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
45 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
36 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
92 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
74 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
63 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
116 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
115 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
236 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 ...
2
votes
0answers
42 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
186 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
179 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
235 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
14 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 ...
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 ...
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.
1
vote
0answers
20 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
44 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
27 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
31 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
70 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
77 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
47 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 ...
1
vote
0answers
63 views

User Permissions on ArcSDE Geodatabase in SQL Server 2012

We set up an enterprise geodatabase in SQL Server 2012; Is it possible to set user permissions at a feature class/table level to only view certain attribute types? For example, a pipe layer has ...
1
vote
0answers
35 views

In ArcSDE, SQL Studio Manager 2012, How to get pixel data using a point layer?

I was using 'where' and 'ST_Intersects' with polygon data to get values 'under' my point layer. Example: Select rd.[FORESTNAME] as Forest, Count(Distinct morel.[OBJECTID]) AS Observations From ...
1
vote
0answers
66 views

How to Load SQL Geometry Data on OpenLayers3?

I am New in OpenLayers 3. I have to load Geometry data from sql to my OpenLayers map. This is my code : var tileLayer = new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: 'osm' }) }) var ...
1
vote
0answers
104 views

ArcSDESQLExecute to query and update from multiple SDE Databases

I am trying to use ArcSDESQLExecute to return the results of a join and then write the return query into a Feature Class located in a different database. Using Microsoft SQL Server and Arc10.2.2 Is ...
1
vote
0answers
218 views

ESRI JavaScript API Web Application and SQL Queries in ASP.NET?

My workflow (and security restrictions) for a new html/javascript based web application is making me think that I could program an ASP.NET application, inside which I load the 'map' and the 'legends' ...
1
vote
0answers
27 views

SpatiaLite / QspatiaLite: get subgroup row ids

I'm using QspatiaLite plugin to join polygon ids to points that are within those polygons. Now I' d like to get subgroup rownumbers for each subgroup of points with same polygon id! Like so.. grp_ID ...
1
vote
0answers
72 views

Apply raster contraints on single table with multiple files

I have a raster table (pre-created using CREATE TABLE) containing multiple individual raster files that I append piece by piece to a final table. The table itself is in its own tablespace 'gisdir' and ...
1
vote
0answers
165 views

Making Map with Color Ramp Using SQL Database Intergration?

This could be a trivial question, but I've been kind of stuck on it for awhile. I'm trying to construct multiple maps that reflect aggregated data showing overall risk by county in a SQL Database ...
1
vote
0answers
18 views

Creating weighted list using Select tool in ModelBuilder?

I've done a raster to point conversion and have a column of the grid codes. Let's say it is composed of 10 numbers [9,5,7,1,7,3,7,2,8,1]. Right now I am doing a selection on those numbers based on ...
1
vote
0answers
218 views

How to export data from sql database in the decimal format in QGIS?

Currently I am working with QGIS and fetching data from SQL server and export it in the format of shapefile in QGIS. While importing the data from sql server attribute table showing data with ...
1
vote
0answers
82 views

Hindi character support in MS SQL 2012

I have spatial MS SQL 2012 and i need to store hindi characters in a column. I tried using nvarchar datatype but I'm getting only "Question marks(????)". Is it possible to store non-english ...
1
vote
0answers
117 views

How can I make PROC GMAP (SAS) run is less time?

I am trying to create a map of Australia, by Local Government Area (LGA), with shaded regions displaying the population for each LGA. The shape file can be downloaded from the Australian Bureau of ...
1
vote
0answers
400 views

SQL-query should return GeoJSON FeatureCollection

I'm trying to return a GeoJSON FeatureCollection object from a SQL-query with PostgreSQL 9.3 and PostGIS 2.1. This is my query so far: SELECT row_to_json(fc) AS p FROM (SELECT 'FeatureCollection' ...
1
vote
0answers
124 views

How to Build Query Table from two OLE DB tables using ArcPy?

When I run the following code to create a subset of a table, the error says "An invalid SQL statement was used" [Query]. The error shows in line 39. Is there any idea you can figure this out? import ...