Questions tagged [sql]

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

http://en.wikipedia.org/wiki/SQL

1841 questions
4
votes
4 answers

Select by attributes - records with the largest attribute value

Using 'Select By Attributes' how can I select records from a shapefile database table where a numeric field contains the largest value. Need to use MAX function or something like that but can't get the syntax right.
Bahny
  • 49
  • 1
  • 1
  • 2
4
votes
1 answer

Which function should I use to find polygon overlaps with other polygon?

I need a spatial function to detect given polygon is overlapping with existing polygons in the database. I tried to use ST_Intersects(). It returns true if polygons touch each other. But In my case touching i okay. I also tried ST_Overlaps(). This…
hurelhuyag
  • 143
  • 3
2
votes
1 answer

SQL-based query to project from 4326 to 3857?

While most SQL databases have in-built projection tools (usually st_transform), BigQuery does not. I'm looking for a SQL query that takes decimal degrees in 4326 and projects them into the meter-based 3857. I have searched SO and the internet, and…
Encomium
  • 3,133
  • 2
  • 14
  • 41
2
votes
1 answer

Spatial join points and polygons in BigQuery?

I have two tables; one has points (e.g., specific addresses with one geography POINT per row) another has areas (e.g., neighbourhoods with one geography POLYGON per row). I'd like to join them, to have the neighbourhood associated with the address.…
Yaniv Aknin
  • 123
  • 4
2
votes
1 answer

send to WFS a custom sql query using jquery

If anyone please, could gimme me a hand on this question. I have a web sql client that the user can write a sql statement and I want to sent it via WFS to geoserver, run it, and based on the results, to mark on map what I have found. So, I know that…
DiLIVIO
  • 21
  • 2
1
vote
1 answer

Test for linestring self-intersection with SQL Server

Is there a query to see whether a linestring is intersecting on itself in SQL Management Studio? The line will be a geometry data type. The line string can be for example: LINESTRING(318400 745924,318525 745908,318524 745920,318453 745912,318389…
1
vote
0 answers

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 one will list the edges(edgekey, from_junction,…
Amo
  • 11
  • 1
1
vote
1 answer

Aggregating taxi data to census block data based on number of taxi trips?

I am doing a study on taxi demand using block level census data and taxi drop off and pick data in the form of Latitude and Longitude around the united states. I am hoping to create a map that shows block level counts for taxi demands based on…
ABaut
  • 101
  • 1
  • 4
1
vote
0 answers

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. So the search should take place within the column…
maria
  • 11
  • 1
0
votes
0 answers

SQL loops and query

I need to apply an ST_distance query to find distance from the given table. How should I tell my query to take points one after the other consecutively on its own or like if the teacher specifies to find the distance between point 3 and 5? I just…
Ayman
  • 1