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

learn more… | top users | synonyms

3
votes
2answers
467 views

Execute SQL in File Geodatabase

Is there a way to execute SQL queries on file geodatabase from Python? I'm looking for the same functionality provided by arcpy.ArcSDESQLExecute for SDE databases. Thanks,
0
votes
1answer
783 views

Building SQL statement in javascript and casting variables as strings

I'm working with Postgres 8.3/PostGIS which is storing some polygons. I'm writing a javascript function which will take in a parameter of a watershed id from another function. The javascript will ...
0
votes
2answers
143 views

oracle search against intersect of a region that covers the whole world doesnt find any records

I am new to Oracle Spatial, I am trying to implement a service that will take coordinates from a map, and search our database to find any geometries that intersect with that map view. I works fine for ...
1
vote
2answers
119 views

how to add a raw input to a SQL string?

I have this py script for selecting one point. # Within selected features, select only those points of a chosen value arcpy.SelectLayerByAttribute_management("Stations", "NEW_SELECTION", ' "OID" = ...
2
votes
2answers
221 views

Select by Attributes - If string has a letter

I'm running ArcMap 10.1. I'm using a File Geodatabase. I have a string coordinate field that I want to clean and some records have letters in it (mostly 'N' or 'E' or 'n' or 'e' e.g. '6213210N' or ...
1
vote
1answer
195 views

IQueryFilter where Clause quering two feature class at a time

I need to query two feature class at the same time using IQueryFIlter. For eg - FeatureClass -- A has field OBJECTID FeatureClass -- B has field OBJECTID what i am tring to do is -- IQueryFilter ...
1
vote
2answers
58 views

Find the majority area within another area

I have a survey grid overlaid unto several administrative areas. Both are polygon features and I have performed a union on both features in order to determine the areal contribution of the segments ...
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 ...
0
votes
1answer
83 views

pgrouting shortest_path return longest_path

I've got troubles with shortest path function from pgrouting. I try to calculate the shortest path between an address and a bus stop. I first found the nearest road points for the address and the bus ...
1
vote
1answer
302 views

How do I use the SearchCursor where_clause to get a max value from a column?

This is my first time asking a question on StackExchange. I hope I phrase my question and describe my attempts to understand my problem well enough! While working with SearchCursor, I'm trying to ...
1
vote
1answer
512 views

Why isn't my select by attributes query working?

I'm running ArcMap 10.1. I have a point feature class joined to a table and am trying to query a field. If I do [field] = 'TEST', it selects all the fields. But if I do [field] LIKE 'TES%', it ...
4
votes
3answers
148 views

Sql syntax in Model builder

In ModelBuilder I am trying to perform the following query, using the select by attribute tool. I am having great difficulty with the sql syntax. What I am trying to do is Select Top 3 (Avg) Price, ...
3
votes
1answer
248 views

Why is Spatialite showing dates in MM-DD-YYYY format?

I have a table with a dates column that is formatted in MM-DD-YYYY format, as shown in SQL SELECT statements. I'm using Qspatilite (QGIS 1.8) and Spatialite GUI. When I ORDER BY the date column it ...
1
vote
1answer
543 views

Trigger a python script to run after a row is added to the feature class

I have a Python script which runs on a SDE feature class daily (as a scheduled task). I would actually like this script to run whenever a new row is added to the feature class (data is captured in the ...
-2
votes
1answer
123 views

Qgis: Select multiple layers in sql-Filter [closed]

I have a Shape-File with lines of streets. Now I want qgis only to show the categories: Type: primary and Type: secondary and Type: motorway. How do I do this? This doesn't work: "type" = 'primary' ...
2
votes
1answer
259 views

PostgreSQL, find points near points

I'm going to have a database with a 'people' table and a 'shops' table. I'd like to find all people within 500m of a shop, and details from both tables. I'm used to working with mySQL, but I'm ...
0
votes
1answer
570 views

How to Export to PDF after zooming to extent of each feature that meets SQL where clause?

I realize that I've asked two similar questions recently, but following suggestions in the comment chain, I'll make this a separate question (separate as it is not the no output problem in ArcPy: ...
2
votes
1answer
266 views

Raster as Attribute Field Error

I'm using Arc 10.1. I am creating a parcel inventory where I would like to have a photo of the property attached as an attribute and view-able with an HTML popup. I have a polygon feature class built ...
6
votes
2answers
943 views

PostGIS SQL query to find a polygon that intersects with a line

I need to build a PostGIS query that would select every polygon inside an area the river is flowing through. I'd better describe with an example below: There is a river (blue line) flowing through ...
3
votes
0answers
202 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 ...
0
votes
2answers
892 views

Cannot insert simple geometry data

I installed PostgreSQL 9.2.4 and PostGIS 2.0.3 on my Windows 8 machine. Then I created a table using phpPgAdmin and added a geometry column using the following statement. SELECT ...
2
votes
1answer
676 views

What is the proper way to delete an SQL Server database in order to delete an SDE geodatabase?

I'm new to this SDE stuff and would like to know the best way to cleanly delete an SQL Server database in order to delete the SDE geodatabase. Is it as easy as right clicking on the database in SQL ...
1
vote
4answers
408 views

Get vector features inside a specific extent

The problem: I have a very large vector layer with many features and a much smaller raster layer in a defined region. I want to get only those vector features which are within the raster layers ...
2
votes
2answers
117 views

Trying to use an integer in a WHERE clause

I'm trying to use an integer value in a WHERE clause (looking at an integer field). expression = "'SERVICE' = 'Service' " expression = expression + 'AND ' expression = expression + "'GPS_TIME_TOTAL' ...
3
votes
1answer
237 views

What formula does SQL Server 2008 use in STDistance?

I am analyzing the accuracy of the STDistance function for geographical objects in SQL Server 2008, in order to understand its behaviour better I need to find the underlying formula. Does anyone ...
1
vote
1answer
164 views

Why does this SQL syntax produce empty feature class with ArcGIS Select_analysis?

I'm working on a script that involves an arcpy.select_analysis function. The problem I have is that when I run the script it produces an empty file. I've verified that the whole thing works when in ...
1
vote
2answers
457 views

Plotting large numbers of objects on a chart using R and WKT format

I am retrieving thousands of geometry lines in WKT format from a Microsoft SQL Server database. I would like to plot all of those lines in one map, but I am having some difficulty with the code. How ...
1
vote
0answers
381 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 ...
9
votes
2answers
291 views

How do I perform a 3 parameter geotransformation and projection in Sql Server 2012?

I have a table with latitude longitude (NAD27) columns in it. I compute two other columns, X and Y, representing Web Mercator (WGS84) location. Currently I'm using a Arcmap to do this, by applying ...
2
votes
1answer
183 views

SQL Command to convert pgRouting result to GeoJSON

My goal is to produce a Web UI for pgRouting using this tutorial. I have already imported my data from an OSM pBF to PostGIS using osm2po. Using the pgRoutingLayer plugin for QGIS, I was able to ...
1
vote
1answer
131 views

How to share *.sql files between ArcGIS and MapInfo?

In Denmark many municipalities have the same provider of public data. These data are pushed to a local database – often a SQL Server. The DBMS layout is the same for all municipalities. When I create ...
5
votes
2answers
713 views

How to find the nearest land mark from a given longitude and latitude?

I have a table called osm_places with place_name geometry, place_type and many other info related to the city. My database system is PostGIS. My requirement is: Given a latitude and longitude ...
0
votes
1answer
333 views

ST_Box2D in PostGIS 2.0

I am getting an error trying to create a bounding box of a geometry using ST_Box2D(). Is the function deprecated? If so, what is the equivalent function? SELECT ST_Box2D(ST_GeomFromText('LINESTRING(1 ...
2
votes
0answers
113 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" ...
4
votes
2answers
556 views

Calculate Field based on field value in a second table

I have a table in a MSSQL Server Enterprise SDE database. I need to join a table from a MS SQLExpress Workgroup SDE database and then calculate 11 fields in the Enterprise table based on values in ...
12
votes
5answers
5k views

Use arcgis with SQL Server 2008 as a backend

I'm wondering how best to use arcgis] and sql 2008 together. At the moment we run manual imports and exports between sql 2008 and arcgis 10 shape files. With sql 2008 having a geography data type I ...
2
votes
1answer
321 views

Select top 5 most items in a geodatabase

I'd like to know what is the best way to select the 5 most expensive items (in terms of actual monetary value) in my geodatabase where i have a price field. Prices are not necessarily ordered but can ...
3
votes
2answers
350 views

is there a public street database that I can do SQL queries on?

Sorry if this isn't strictly a GIS question. I want to know if there's a public database of US streets and US States that I can simply connect to (e.g. JDBC) and run SQL queries. For example, I want ...
3
votes
1answer
186 views

Given a lat/long point, determine if it's land or water?

I have a PostGIS-enabled PostgreSQL 9.1 installation with the 10M physical dataset from Natural Earth imported. It's been converted to 900913, and in QGIS I can visualize the data. So the plumbing's ...
4
votes
1answer
1k views

STIntersects - Update field to give me count of points in polygon

I have a points layer (dbo.ptLayer) Around 1M points Spatial Geometry Type (dbo.ptLayer.geom) No spatial index just yet, but will create one once data gathering complete. I have a polygon layer ...
0
votes
1answer
807 views

MapInfo equivalent of SQL 'AS' statement

I'm trying to execute a SQL query in MapInfo, and want to change some of the column names to something more readable. The SQL command 'AS' doesn't seem to work - is there a MapInfo equivalent?
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 ...
4
votes
2answers
248 views

Which Geodatabase supports SQL and is easily portable?

I want to choose the geodatabase type, which could be: permits direct sql queries. easily portable, because the app would installed in one computer. I know that the personal geodatabase is a good ...
3
votes
1answer
504 views

Routing with multiple points

I am using postgreSQL, postGIS and pgrouting. Now I am really confused on how am I going to find the shortest path between multiple points. I know how to find it between two points through dijkstra ...
3
votes
2answers
155 views

Traversing a PostGIS table tree

I'm developing a geospatial db for a company that operates at a number of large facilities. Its primary purpose is to help staff locate themselves and equipment within each facilities' multi-storey ...
4
votes
4answers
1k views

Updating 30 Shapefiles, adding attribute and populating based on data

I need to add an attribute to each shapefile attribute table in ArcMap, I was thinking to do it in SQL, but I'm not sure how to go about doing it since I'm very new to ArcMap. Can someone explain to ...
4
votes
2answers
322 views

PostGIS stored procedures

I am wondering if there are open source applications that make extensive uses of the special functions (the ST_* stored procedures) provided by PostGIS? I found many apps that support storing map data ...
1
vote
1answer
81 views

How to get routes in the database that intersects circle?

I have routes (linestrings) recorded in the database. I want to create a query which returns the routes that have some commonality with a circle whose center and radius are passed as parameter. I ...
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
211 views

SELECT DISTINCT from table in Geoserver SQL view [closed]

The postgis table I have has the following columns, id | name | style_id | unique_id | time_stamp | the_geom(polygon) and logically the unique constraint (not currently imposed in the db) lies with ...