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

learn more… | top users | synonyms

4
votes
1answer
17 views

Cartodb API Read Only

Is it possible to generate an API-key in Cartodb with read-only permission? Seems like the default API-key has full controll
0
votes
2answers
98 views

Sql Query in Postgresql

I am trying to execute a query but I am stuck. I have two tables A and B. The a table has columns gid, geometry(line-string) and value which cells is empty , the B table has got 3 columns gid, ...
0
votes
1answer
25 views

Where clause in MapInfo Table Updates

Is it possible to add a where condition to an update query in MapInfo? At the moment I have to do a query to select the records I need and then do an update on that query. I believe this is ...
0
votes
1answer
35 views

GDAL -SQL or -where options

ogr2ogr -overwrite -t_srs EPSG:3978 -f "ESRI Shapefile" -sql "SELECT * FROM 'Layer Name' WHERE FIELD_NAME = 'A CLASS'" dst.shp src.shp help me out here - looking to 1) reproject a shape and 2) ...
0
votes
0answers
19 views

Selecting all cells not containing a number in SQL

I have a field containing some values. In edit mode, when I click on any one of these values it gets replaced by 1.#QNAN in the cell. I would like to query the table for all cells containing ...
2
votes
1answer
36 views

Show Log of the Sql statements that QGIS generates to retrieve Data from Postgis

Is there a ways to - make QGis log its generated SQL Statement or to - force POSTGIS to log all interaction with QGIS? There is something strange happening to the WFS layer I retrieve in QGIS, since ...
1
vote
1answer
24 views

How to select from geometry column in postgresql?

I've got a table which it has a geometry column filed by some point (ex. "POINT Z (116.309627 39.991285 148)"). now I want to select point's id from the table. I wrote follow sql Code but I force an ...
2
votes
2answers
54 views

how to snap points to lines in QGIS/PostGIS?

I'm attempting to snap approximately 900 points to a line table. I've tried recreating what I have found from a couple of PostGIS answers but not having much luck. To test, I've created two ...
1
vote
1answer
28 views

How to store multi-valued attributes in PostGis using Postgresql [closed]

I have a with meterid,meterreading,reader and date read.I wish to store this data using Postgis database. I used this code via postgresql to create the table CREATE TABLE MeterRdg( meterid ...
0
votes
1answer
20 views

Updating static GTFS data android

I have an android application that takes a static GTFS data that I manually turned into a database. My question is how do I update this GTFS data automatically? Or is that not possible? Any ...
0
votes
0answers
23 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 ...
0
votes
1answer
26 views

Differences between columns in MapInfo

I have two columns in a nodes table, one column has the ground level of the node taken from the model and the other column has the ground level inferred from LiDAR. Is there a query that can be used ...
5
votes
2answers
128 views

QGIS expression builder include relation attributes

I have a set of symbols based on a table in postgis such as this id|type|action_1|action_2|geom In QGIS I have this table symbolised using a rule expression which works effectively. However this ...
2
votes
1answer
38 views

How can I do a subquery inside a subquery in PostGIS?

I need to add a subquery to a working function. Instead of select * from table, I'd like to select * from (select * from table where height>1500) as sub, something that works in other functions I ...
1
vote
0answers
34 views

Running a custom function on each line of a PostGIS table

I am trying to run a custom function on each parcel in a PostGIS table, (in this case its a function that finds the standard deviation value of the pixels intersecting a raster) Here is the code for ...
1
vote
1answer
25 views

PgRouting: Target vertex error

I'm trying to make a matrix that shows the cost from a node to the rest of the nodes in a network. The final result I'm looking for is not the cost, but only know if a car can or can not reach each ...
0
votes
0answers
47 views

Database connection fails when using db authentication, succeeds using OS

When i attempt to make a connection to a database on my SQL Server 2014 sever via Database connections in ArcCatalog using with db authentication i get the lovely "Connection was attempted with an ...
0
votes
1answer
31 views

Querying a raster per pixel using a secondary raster as a condition

So here's the problem. I have two rasters containing bathymetry data: one containing the bathymetry of the sea floor, we'll call this raster1, and another containing the difference between two ...
2
votes
1answer
40 views

ST_Union based on attribute

I have a road network of center lines of MultiLinestrings.They have nodes at every intersection. I try to understand how I can merge roads together that have the same category as attribute (There are ...
3
votes
2answers
159 views

Column 'SHAPE' cannot be null in mysql database even if the query string is correct

I am trying to write an POLYGON into an column named SHAPE which is a geometry type. And created query which looks $sql = "INSERT INTO rokka(zone,district,location,area,SHAPE) VALUES ...
0
votes
1answer
59 views

What command to use in PostGIS to get same result as ArcGIS?

I have two shapefiles and i'm trying to do simple spatial analysis. When I want to know which polygon belongs to other polygon in other shapefile I always use select by location and in Spatial ...
0
votes
0answers
23 views

SQL query on field in Oracle does not return the same values that are seen in ArcMap/ArcCatalog

This is a very bizarre issue and I am at a loss as to why this is happening. A user running queries in SQL Developer brought this to our attention, and when we tried it we ran into the same problem: ...
1
vote
1answer
60 views

nearest neighbor query in SpatiaLite

I am trying to find the nearest line to each point in a layer, and I have over 1 million points. I want to be able to associated the closest unique line ID with the point unique IDs. I have tried to ...
0
votes
1answer
34 views

I'm not able to add SQL file to postgresql database

I started with basics and did these steps: createdb -U postgres -E UTF8 -O Peete gis -OK createlang -U postgres plpgsql gis (was already installed) -OK psql -U postgres -d gis -f ...
2
votes
1answer
92 views

Trouble using ST_Difference to remove overlapping features

I am trying to use ST_Difference to create a set of polygons (processing.trimmedparcelsnew) that do not contain any of the area covered by another set of polygons (test.single_geometry_1) using ...
1
vote
1answer
35 views

CartoDB (PostGIS) near function (distance) points to polygons

I have a CartoDB map here: Link: https://dms2203.cartodb.com/viz/78db6c02-3148-11e5-a42f-0e018d66dc29/public_map I'm trying to find the distance of the points to the polygon. If the points are ...
0
votes
1answer
26 views

Using ST_LINE_INTERPOLATE_POINT in OGR and python

I'm interested in finding the midpoint on a linestring using OGR and python. This can be a line with more segments. Could I use the ST_LINE_INTERPOLATE_POINT in python using the ExecuteSQL() method? ...
2
votes
2answers
32 views

CartoDB latlon change to lonlat

I have this script I am trying to use to search for a value within a CartoDB table. I can't seem to figure out how to reverse the order of the lat & long coordinates so they appear as lonlat... ...
0
votes
1answer
38 views

Spatial query ST_CONTAINS returns empty result

I want to create a database view in Postgres/PostGIS which returns a subset of the points stored in another table called locations. The subset is defined by an area stored in yet another table called ...
1
vote
2answers
29 views

Cartodb - Error: sql is read-only in NamedMaps

My map is not a named map. Map privacy is set to only people with the link. Why I I getting this error when trying to do queries? Has anyone else run into this?
2
votes
1answer
51 views

Joining data of two different datasets from varying distances and integrating into one dataset in ArcGIS

I have a pointfile of some 200 electrical boxes throughout the county. While the electrical boxes are "mapped", they are done so by using township range section data, so there actual location is not ...
1
vote
1answer
16 views

Table join not displaying in createLayer function in cartodb.js

I am trying to build on the cartodb tutorial to develop a map of fibre networks in Africa. The example works fine when my SQL select is very simple i.e. var layerSource = { ...
1
vote
0answers
42 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
23 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
34 views

Combining Datasets from multiple scraped data CSV files using FME [duplicate]

My main goal is to collect information of US Golf courses located in the United States and geocode them to create a meaningful map. I was able to scrape from four sites in which I created 4 CSV ...
1
vote
2answers
35 views

Inputting integer values into SQL statement using ArcPy?

I am defining a function for use in a ArcGIS tool that will verify attributes, catch errors, and obtain user input to rectify those error. I want the tool to select and zoom to the segment that is ...
0
votes
1answer
54 views

Referencing CSV file in Select By Attributes SQL query?

I have 2 databases: Database 1: Point Shapefile with adress and APN (parcel numbers) as attributes. (Huge number of points, addresses for an entire metropolitan area). Database 2: CSV file with a ...
0
votes
0answers
14 views

Error Save to FeatureDataset in ArcObject C# [duplicate]

I have a SQL GeoDB in my server. I want to write some data in one of feature dataset and for that i use below method. public string insertdata(string tablename, List<tableRow> fields, string ...
1
vote
1answer
48 views

Error #1064 from MySQL searching database for results near lat/long

I'm trying to run a SQL query to search for a term and a users location. I need help to search my database for locations near a user with the description of 'X'. The users location (lat, long) is ...
2
votes
1answer
185 views

How to make SQL definition query in ArcGIS to show only unique values (hide duplicates)?

I have a vector file with field of type LONG. Some values of this field are duplicates. Is it possible to make such SQL definition query in ArcGIS 10.3 to show only unique values without duplicates? ...
1
vote
1answer
29 views

Dynamic XY to line with SQL

using arcmap 10.3 Trying to create a 'live' draw of lines between two coordinate points. So far I have been able to easily create the lines into a new shapefile using the XY to Line tool however I ...
2
votes
0answers
31 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 ...
0
votes
1answer
20 views

Failure of non existant SQL statement after executing statements from a file with ArcSDESQLExecute object

As you see in my code I iterate and execute all the sql statements in an sql file using ArcSDESQLExecute object. It does work but when all statements have been executed the object returns 'None' ...
0
votes
1answer
43 views

Redirect if Clicked on a Marker in CartoDB

How can the user be redirected if he clicks on a marker in CartoDB? I have a dataset with the markers — the geometry and inside of the description-field the URL to redirect the user. I know I can ...
0
votes
1answer
52 views

Definition Query to find next date value in ArcSDE attribute table?

I have an ArcSDE feature class that contains a date field called "SALE_DATE". This sale date represents the bid date for ALberta crown mineral rights sales. A sale occurs about twice per month (one ...
1
vote
0answers
28 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
1answer
99 views

Split a table of Multi/Linestrings into Unique Linestrings

Is there an efficient way to split a table of Multi/Linestrings that overlap() and touch() into unique Linestrings (note: creating edges using topology is going very...very...very slow). Here is ...
0
votes
0answers
31 views

SQL fails in python. In ArcMap error FDO error: -2147024871 returned

I'm having issues with an SQL expression for a feature class in a file geodatabase. When working in ArcMap, the SQL will fail on its first attempt, and produce the following error: However, when I ...
1
vote
1answer
45 views

Select ID by most recent date

I have a personal GDB table that has a non-unique SLID field and a date field. Basically there are multiple records with the same SLID numbers but different dates. I want to select only the most ...
0
votes
0answers
40 views

Densifying OpenStreetMap (OSM) network nodes?

I am working with osmconverter to convert osm files(*.osm) to *.pbf, then i use osm2po to get sql file that run into PostGis to get a network table. The last step is to run a createTopology ...