Spatial indexes are data structures the support searches and computation that depend on geometric relationships between the stored data (k-nearest-neighbors, identify elements in a defined region, etc). Use this tag for questions about selecting, writing, or using spatial indexes in your code, including the use of spatial indexes in database management systems.
Questions tagged [spatial-index]
281 questions
2
votes
3 answers
Creating a spatial index on oracle
I have a table 'floating_options', and I want to create a spatial index on a column 'area_geo' (which is a sdo_geometry column, with two rows of data that appear as expected when I select * from floating_options).
I have used the following code but…

jedge
- 937
- 2
- 11
- 18
2
votes
2 answers
what is the best R tree variant
I am recently reading papers and codes on R-tree and its variants: linear, quadratic, R*-tree, and also R tree packing (STR). It seems to me that different techniques are different in the time complexities of tree creation, range search, and knn…

daydayup
- 2,049
- 5
- 22
- 47
2
votes
2 answers
Another Why Is This Nearest Neighbor Spatial Query So Slow?
Following this recommendation for an optimized nearest neighbor update, I'm using the below tsql to update a GPS table of 11,000 points with the nearest point of interest to each point.
WHILE (2 > 1)
BEGIN
BEGIN TRANSACTION
UPDATE TOP…

tpcolson
- 716
- 1
- 11
- 27
2
votes
2 answers
Finding the nearest neighboring edge in a Quadtree
I have stored a set of Points in a Quadtree. Once the quadtree has been created with the points, I then add all the edges to the quadtree such that each edge gets stored in ALL the leaf nodes that it crosses, begins or ends at.
Now, I have a point,…

SLearner
- 1,419
- 5
- 18
- 22
2
votes
2 answers
Comparison of the runtime of Nearest Neighbor queries on different data structures
Given n points in d-dimensional space, there are several data structures, such as Kd-Trees, Quadtrees, etc. to index the points. On these data structures it is possible to implement straight-forward algorithm for nearest neighbor queries around a…

Skrodde
- 655
- 3
- 7
- 19
2
votes
1 answer
Efficiently find the polygon in a Voronoi diagram that contains a point
I am projecting images on a Voronoi diagram. For each non-black pixel of the image, I find the corresponding polygon in the diagram and color it. (The site, to get an idea what I mean.) With a few hundred polygons, a brute force approach is…

mknecht
- 1,205
- 11
- 20
2
votes
1 answer
Is it possible to generate generate thiessen (Voronoï) polygons using the SQL Server Spatial datatypes?
I have a bunch of points in a SQL Server database using the geography data type, that I would like to be able to generate thiessen polygons for.
Is this processing available natively within SQL Server, or must this processing be done outside of the…

Rowland Shaw
- 37,700
- 14
- 97
- 166
2
votes
1 answer
st_intersect() not working in postgresql
i am using postgresql version :
"PostgreSQL 9.3.1 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2), 64-bit"
i have created 2 tables A and B with point and polygon as a data type.
now i want to know whether point…

virtual
- 57
- 3
- 11
2
votes
2 answers
Spatial query w/o spatial data
I trying to execute a next query on Oracle Database 11g Enterprise Edition (11.1.0.6.0):
SELECT "__ItemId"
FROM "Cities"
WHERE "Longitude" IS NOT NULL AND "Latitude" IS NOT NULL
AND SDO_ANYINTERACT(SDO_GEOMETRY('POINT(' || "Longitude" || ' ' ||…

Viacheslav Ivanov
- 1,535
- 13
- 22
2
votes
1 answer
Perform a subquery on a spatial table in MySQL
I have a spatial table of polygons. I am trying to find what polygon a lat/lng point lies within in a MySQL spatial table efficiently.
I know ST_Within is available for MySQL 5.6 however my version pre-dates this so I am combining two functions I…

Gga
- 4,311
- 14
- 39
- 74
2
votes
2 answers
MongoDB spatial query on source and destination
I have a collection, name Events:
Each document in Events collection has source and destination in lat-long.
I would like to make a query on the Events collection and get only those events that are within some distance from source and within some…

Anup
- 627
- 5
- 19
2
votes
1 answer
Spatial index in Azure Mobile Services and Xamarin Azure component
Is it possible to add a spatial index to Windows Azure Mobile Services?
I added a free Mobile Service free 20mb database, then a table, then a geography type column.
I couldnt add an index to geography column using the 'management portal.' But I…

fractal
- 1,649
- 17
- 31
2
votes
1 answer
RavenDB Spatial index for LineString
How do I create a RavenDB Spatial Index for LineString geo data ?
I am trying to create a spatial index for LINESTRING of geo data, But search query does not return any data.
Please use following testcase as reference, since I am new to RavenDb I am…

user2144147
- 85
- 8
2
votes
1 answer
SQL Server 2008 Spatial Query performance
I have an application where user's store their commute routes in our database.
The routes are stored as polylines (linestrings).
The database also stores incidents, traffic accidents that kind of thing.
Periodically we need to query a route to see…

CianM
- 397
- 5
- 17
2
votes
1 answer
How to find points, sort them based on closeness, and get 1-20, 21-40, etc. Efficiently using Myisam and mysql and spatial index
Say I want to find 20 closest business near me. Latter I want to see the next 20 closest, etc. Yes I have myisam. I have spatial indexes on the point. I am looking for actual SQL command I should send.
To make it clear:
Note:
I am using mysql…

user4951
- 32,206
- 53
- 172
- 282