Questions tagged [spatial-query]

a special type of database query on geodata

A spatial query is a special type of database query supported by geodatabases and spatial databases.

Unlike non-spatial SQL queries, these queries use geometry data types such as points, lines and polygons and they consider the spatial relationship between these geometries.

Implementations vary between databases, for instance by adding an extension like for PostgreSQL or using a planar spatial data type like geometry in Microsoft SQL Server.

416 questions
0
votes
2 answers

Data structure for spatial queries (kNN) on dynamic data

For spatial queries like nearest neighbor search, in theory, KD tree or Voronoi or R tree(or one of its variants) work. But what is the preferred data structure/algo for dynamic data?
mithya
  • 363
  • 1
  • 10
0
votes
1 answer

How to use SDO_JOIN to find if one object is inside another

I have two table. One has a point SDO_GEOMETRY and the other has a circle SDO_GEOMETRY object. I want to check using SDO_JOIN, all the objects of table1 that are inside of table2. Can someone guide as to how to write this query? My output is…
Khawar Ali
  • 3,462
  • 4
  • 27
  • 55
0
votes
1 answer

Azure SQL Server Spatial Index Error Cannot create...because column is computed

[UPDATE] I tried the index definition below and received the following error message: Cannot create primary xml, selective xml or spatial index 'SI_Property' on table 'BTSOne.dbo.Properties', column 'Point', because the column is computed. This…
Will Lopez
  • 2,089
  • 3
  • 40
  • 64
0
votes
1 answer

SQL Server check if where clause is true for any row

I'm going to select those provinces which intersects any railroad. So I do it like this (Using SQL Spatial): SELECT * FROM ProvinceTable WHERE ( SELECT count(*) FROM RailroadTable WHERE…
Hossein Narimani Rad
  • 31,361
  • 18
  • 86
  • 116
0
votes
1 answer

SDO_JOIN table join on large tables no longer returns results after upgrade from Oracle 11.2.0.1 to 11.2.0.4

I have the same database on 2 different Oracle servers, one is 11.2.0.1.0 and the other is 11.2.0.4.0. I have the same 2 geometry tables in both databases and run the following query on both servers. When run on an 11.2.0.1.0 version of Oracle, the…
0
votes
3 answers

Using spatial data in IBM bluemix

I have a set of data in a table which contains latitude and longitude as well. I need to query these data which has Lat,Long within 5 km in radius. I have tried using IBM bluemix with BigSQL and DashDB. Please sugguest a possible solution. Note: I…
Viswanath Lekshmanan
  • 9,945
  • 1
  • 40
  • 64
0
votes
1 answer

How to port simple spatial index using SQLite R-Trees to Postgres?

I have implemented a simple spatial indexing schema based on bounding boxes by following the SQLite R*Tree tutorial, which has given me the following schema: CREATE VIRTUAL TABLE events_region USING rtree( id, -- primary key …
nedned
  • 3,552
  • 8
  • 38
  • 41
0
votes
1 answer

Compute Distance Using Absolute Positions (X,Y)

I've added a geography column to my table (MICROSOFT SQL SERVER) and inserted geography point data in it (4326). Now I am able to compute distance of all points from a specific point using below query: DECLARE @X geography = geography::Point(0, 0 ,…
Shane
  • 128
  • 1
  • 3
  • 15
0
votes
1 answer

Can't insert Point in PostGIS

I wrote next Insert function: INSERT INTO test(datetime, points) VALUES('2014-12-29 12:09:35', ST_GeomFromText('POINT(6370526.653 11224882.055)', 3395)); When I run it, I am getting error, that function "ST_GeomFromText not found". I can't…
Suliman
  • 1,469
  • 3
  • 13
  • 19
0
votes
1 answer

SQL Server 2008: Spatial Query - Return 5 closest sites

I'm trying to create an origin/destination matrix selection with SQL Server 2008. I want to find the closest 5 sites to any given site. The matrix should include the origin ID, Destination ID and the distance between the two. So far I have managed…
Danny_44
  • 7
  • 2
0
votes
3 answers

SQL Azure STDistance performance

I have a big performance problem with STDistance function on SQL Azure. I'm testing the same query SELECT Coordinate FROM MyTable WHERE Coordinate.STDistance(@Center) < 50000 on a SQL Azure database (Standard) and on my local machine database. Same…
0
votes
1 answer

How to Load Spatial Data using the Hadoop GIS framework

I am trying to use the Hadoop GIS Framework, in order to add Spatial support to hive. One of the things I want to do is to create a spatial table from external data (from PostGIS). Unfortunately, the serializer provided by ESRI maps to a ESRI JSON…
doublebyte
  • 1,225
  • 3
  • 13
  • 22
0
votes
1 answer

RavenDB - How to can one make a WithinRadiusOf(radius,lat,lng) query where radius is a document property?

I would like to make the following query, but am struggling with it syntactically: var query = session.Advanced.LuceneQuery().WithinRadiusOf(doc.MaxRadius,latitude,longitude).Where(x => x.StringProperty.Contains("xxx")); The…
Josh Wheelock
  • 369
  • 4
  • 9
0
votes
1 answer

Find the points using Oracle spatial directly in front of a polgon

I have many polygons and many points and want to find the point such that when a line is drawn between that point and the polygon it does not intersect with any other polygon. So basically I need a point that is very close to the polygon and no…
user16666
  • 47
  • 1
  • 2
  • 6
0
votes
1 answer

Can't update table off ST_INTERSECT Query in Netezza

So basically I have two simple line datasets in Netezza, I want to create a table which just includes lines from dataset 1 that do not intersect any lines from dataset 2. ST_DISJOINT doesn't seem to work, it returns thousands and thousands of…