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

learn more… | top users | synonyms

4
votes
1answer
109 views

How to use %value% (from For iterator) in SQL expression of Calculate Field in ModelBuilder?

I have a shapefile with data of fish specimens and the coordinates where they were tagged for research purposes. One of the fields in the attribute table of these shapefiles is the fish length in ...
3
votes
0answers
76 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
196 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
32 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
112 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
158 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
16 views

connecting cartodb to existing mysql database

I'm trying to create a simple heat map based on longitudinal and latitudinal map coordinates that can be transferred from a database on mysql that I've created. I read that cartodb can be connected to ...
1
vote
0answers
44 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 ...
1
vote
0answers
73 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0answers
36 views

Is it possible to retrieve lost versioned data in SQL Server Management Studio?

One of my staff accidentally deleted a feature class she was creating in her version before I reconciled it. I have grabbed a back up of the database from yesterday in SQL Management Studio. Is ...
1
vote
0answers
59 views

arcgis 10.2 spatial stored procedure in oracle throws pls-00707 compilation error

Package def: create or replace PACKAGE POSEIDON_PACK AS procedure tester; END POSEIDON_PACK; Body: create or replace PACKAGE BODY POSEIDON_PACK AS procedure tester as d number; begin ...
1
vote
0answers
39 views

Selecting a bounded area within a raster

I am new to postgresql. I have imported a 256kb sample raster (.tiff) into postgres with tilesize 100x100. Now I need to select the area (rectangle) from the center of the image using sql query. Then ...
1
vote
0answers
106 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 ...
1
vote
0answers
138 views

Using sql SELECT DISTINCT in Fusion Tables API

How do I go about using sql SELECT DISTINCT in fusion tables API?
1
vote
0answers
52 views

How do I make vectorlayer with sql on PostGis via python code

I need to make a vectorLayer and fill with the SQL's results on PostGIS via python code. I'm working with python 2.7, QGIS 1.8 and PyQt 4.5 How do I it ? thanks
1
vote
0answers
48 views

IQueryDescription SQL Query Returning Limited Records

I created a SQL query that is working in SQL Management Studio, but as soon as I transfer the query into ArcMap's IQueryDescription to try and run it with a User Form, the results that I'm getting ...
1
vote
0answers
365 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 ...
1
vote
0answers
52 views

How do I prevent Arcmap from verifying SQL expressions when using a plugin dataset?

I've written a plugin workspace for ArcGIS. I'm able to compose a where clause containing syntax that my implementation of IPluginDatasetHelper understands, assign it to IQueryFilter.Whereclause, and ...
1
vote
0answers
48 views

given sets of vehicle passing on each edge, how to get most used vehicle to avoid transition?

I have two tables: one, the resulting table from converting osm.xml via osm2po so I can use pgRouting, and another one that contains information on what edges each public vehicle passes through ...
1
vote
0answers
519 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 $$ ...
1
vote
0answers
1k views

How to populate data from postgresql using dynamic php\html listing

In the form I created, I need two fields to be dynamically populated from the database while the other fields will be manually entered and push to the database. I have written a script that is able ...
1
vote
0answers
66 views

Database has duplicate values after running pgrouting

I am a newbie with postgresql and sql statements so maybe it is a trivial question, I'm sorry for that. I am working on a postgis database and try to use the pgrouting function. My goal is to store ...
1
vote
0answers
97 views

How to find loops in a network

I am a new in this field and need help, how to code using SQL spatial a function that retrieve loops in a network.The input, flag: Geography and barrier: Geography and two spatial tables, first ...
1
vote
0answers
102 views

Acceptable Reduce() amounts for google maps zoom levels?

I'm using SQL Server Spatial to return large polygons to Google Maps for display. Given that google maps has a zoom scale of 1 - 20, I would like to reduce my polygons (reduce function uses the ...
1
vote
0answers
274 views

Add building height from xyz points in PostGIS

I have been trying to get this query right and just can' seem to. I have a building polygon table with over 7 million polygons, indexed I then have a grided height XYZ table with attribute 'height' ...
1
vote
0answers
225 views

Manifold 'Link drawing to query' - can I do this in QGIS?

Manifold GIS allows the creation of dynamic drawings linked to queries. Unfortunately I do not have access to Manifold as my employer refuses to pay for it, so am currently investigating ...
1
vote
0answers
285 views

T-SQL with SDE and Web Map ArcGIS Server 10 MSSQL 2008

I need to build a system whereby the user of a web map (the standard web map that ArcGIS Server Manager builds) can edit a feature class's attributes. The attribute will be a 'Comments' field. The ...
1
vote
0answers
207 views

Color polygons using SQL Database based Rules in Openlayers

I want the rules to be applied according to values in a database. Is it possible to include external database information that is not in the shapefile? In spoken words the original rule is "Color all ...
0
votes
0answers
10 views

Neighbours list extracted out of polygon regions

I've got a SQL database which contains some coded polygon structures. Those can be extracted as follows poly <- data.frame(sqldf("SELECT ST_astext(geometry) FROM table")) The data.frame 'poly' ...
0
votes
0answers
13 views

How to get sql error from postgis when a plugin fail to load vector layer?

I am writing a plugin for qgis that load a sql layer from postgis database. I am disappointed that when the layer fails to load i can't find a way to get the sql error message from database server. ...
0
votes
0answers
10 views

Uisng Directed force graphic to connect terminals in CartoDB?

I am starting using SQL for my internship, we are creating a map for terminals (points representating a port, train station or logistic centre) and what I would like to do is use the Directed force ...
0
votes
0answers
19 views

time complexity of selected algorithm - SQL

I use PostGIS - SQL 1) I need know time complexity of algorithm which in I use these functions: ST_Equals, ST_Overlaps, ST_Distance_Spheroid and ST_Dwithin Is a time complexity diferent when I use ...
0
votes
0answers
27 views

Postgresql (soln would be basic SQL I think): ORDER by distance to a point and return those distances in array pairs w/ the full records

so I know there have been some questions asked about how to calculate distance using postgis and how to order results by their distance from a respective point. I'm not very talented at SQL (at all) ...
0
votes
0answers
9 views

Epoch Time Incorrectly Auto-formatted As Int

I'm accessing seismic data from a USGS geojson (set to sync in CartoDB). When the data is brought into CartoDB the column is set as an int when it should be a long int. What is the best way to ...
0
votes
0answers
28 views

CartoDB - renamed table and changed API calls but still failing

I used the SQL API to make a new table with some data from an existing table. I also renamed all the API calls in my code to point to the new table. However, no point markers show up on my map now. ...
0
votes
0answers
55 views

Geoserver SQL View layer not displaying on map

I am trying to create a SQL View in GeoServer from my SQL Server 2008 R2 data store. It is a very basic query: SELECT [Id] ,[Location] FROM [schema_name].[table_name] I set the Id column, ...
0
votes
0answers
28 views

Why there is no output (path) for Dijkstra in pgrouting

I have a road network table and I am implementing pgRouting. everything was working fine previously but now there is something odd here. I am getting no route now. I am checking through sql query in ...
0
votes
0answers
44 views

How do I use Arcpy to label based on two different expressions, then convert to annotation?

I am trying to open an mxd and turn on labels before converting them to annotation. I would like to turn on labels with 2 different classes, based on 2 different expressions, then convert them to 1 ...
0
votes
0answers
47 views

Group Nearest neighbor query in SQL Server 2012 spatial database

I am looking for way to perform GNN query over road networks in SQL Server. Any pointers
0
votes
0answers
20 views

GeoDatabase user access based on administration boundry

I have silverlight application consuming Map service. Now I want to create user login. The scenarion is somethinkg like when a user logs he should only be able to query on data belongs to his area. ...
0
votes
0answers
49 views

Multiple geometry in a cursor SQL

I have a cursor which I create from a table which has one geometry field only. But in my cursor I would be using two geometry fields as I need to calculate two different areas.Below is the sql ...
0
votes
0answers
29 views

SQL cursor issue

I am trying to create a new table using a cursor and a select statements. Declare Cursor c1 is select store_number from table1 where CLIENT_ID= 1 and ORG_ID = 1 ; Type C1_TAB_TYPE ...
0
votes
0answers
60 views

Is there a limitation in quantity of joined tables using spatialite views?

I've one point layer in qgis and several non spatial tables in a spatialite database. Now I want to create a view as you can see in the following: CREATE VIEW testansicht10 AS SELECT ...
0
votes
0answers
21 views

Multiple cursors in sql for SDO_DIFFERNCE

This is a follow up to a previous question I had regarding sdo_difference. Now in this case I am trying to use cursors so that I can do it for all records at once.In the below code I select a list ...
0
votes
0answers
118 views

Date Parameter in model builder - ArcMap

Basically I'm building a model where the user has to select the data from a drop down list and the result is executed. I have a problem when trying to pass a date as a parameter. Below you can find ...
0
votes
0answers
77 views

Trying to load ThinkGeo shapefiles into SQL

I am new to GIS, but have a work project that I need to integrate CoastLine geometry data in to a report. I downloaded some of ThinkGeo's OpenStreetMap shapefiles and have tried to load them using ...
0
votes
0answers
123 views

Geoservices REST JSON to SQL Server Geometry using Python

I'd like to hit a Geoservices REST endpoint (below) to return json and push this into a SQL Server Geometry table using Python. Ok so I can achieve this via ogr using below via command line: ...
0
votes
0answers
40 views

Can I create a table showing all the Srid values for all the tables in my DB?

Hi I can identify the current SRID of one table (at a time) in my database, but I was wondering if there was a way to bring back a single table that would tell me all the datasets that do not ...
0
votes
0answers
122 views

SQL Spatial: MakeValid() splits a polygon into 3 separate polygons

I am trying to import one of the EPSG (http://www.epsg-registry.org/) area polygons (the polygon with area code 1999) into SQL Spatial. The polygon is in GML format and covers the southern hemisphere ...
0
votes
0answers
106 views

Can osm way records in SQL spatial be merged to one geographic record if they have same Id?

I've imported England shp file of roads to mssql using OSM2MSSQL and I've noticed that the same road has couple of records with same Id but different geographic (probably it was segmented). Is there ...