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
10
votes
4 answers
Know of any C# spatial data libraries?
I'm looking at implementing spatial queries in .NET without using SQL2008. The first requirement is to be able to create a (BTree styled) spatial index and be able to query it.
Although SQL 2008 ships with .NET libraries for the types, you need to…

Simon Munro
- 5,399
- 6
- 33
- 40
9
votes
3 answers
2D Spatial Data Structure suitable for Flocking Boids in Java
I'm working on a flocking boids simulation just for fun, and I want to optimise it a bit.
The area that needs work is finding boids near a given boid. I figure that to do that some kind of spatial data-structure suited to the task would be my best…

Iskar Jarak
- 5,136
- 4
- 38
- 60
9
votes
2 answers
How to create spatial index using EF 6.1 fluent API
Well, the question is clear enough. Is it possible to create spatial indexes using Entity Framework 6.1 fluent API?

amiry jd
- 27,021
- 30
- 116
- 215
9
votes
4 answers
Why not B+-Tree MongoDB
Do anyone know why MongoDB use B-Tree but not B+-Tree?
As I know most DBMS use B+-Tree. Are there any special reason for MongoDB to use B-Tree?
thanks.

dykw
- 1,199
- 3
- 13
- 17
9
votes
2 answers
What spatial indexing algorithm should I use?
I want to implement some king of spatial indexing data structure for my MKAnnotations.
Currently it's horribly slow when I try to filter them based on distance criteria ( 3-4k of locations, currently extremely slow with a simple double for ...…

Templar
- 1,694
- 1
- 14
- 32
8
votes
2 answers
MySQL: Invalid GIS data provided to function st_geometryfromtext
Here's my code:
SET @poly =
'Polygon((-98.07697478272888 30.123832577126326,
-98.07697478272888 30.535734310413392,
-97.48302581787107 30.535734310413392,
-97.48302581787107…

neubert
- 15,947
- 24
- 120
- 212
8
votes
2 answers
What is an infinite scaleless quadtree called?
2D spatial indexing question:
What do you call a data structure that is essentially an infinite* quadtree whose nodes contain neither absolute coordinates nor absolute scales -- in which the coordinate system of each node has been normalized to the…

Todd Lehman
- 2,880
- 1
- 26
- 32
7
votes
2 answers
RTree: Count points in the neighbourhoods within each point of another set of points
Why is this not returning a count of number of points in each neighbourhoods (bounding box)?
import geopandas as gpd
def radius(points_neighbour, points_center, new_field_name, r):
"""
:param points_neighbour:
:param points_center:
…

ZHU
- 904
- 1
- 11
- 25
7
votes
2 answers
Benefits of nearest neighbor search with Morton-order?
While working on the simulation of particle interactions, I stumbled across grid indexing in Morton-order (Z-order)(Wikipedia link) which is regarded to provide an efficient nearest neighbor cell search. The main reason that I've read is the almost…

bbtrb
- 4,065
- 2
- 25
- 30
7
votes
2 answers
How can I speed up this SQL Server Spatial query?
I have (what I think) is a simple SQL Server spatial query:
Grab all the USA States that exist inside some 4 sided polygon (ie. the viewport/bounding box of a web page's Google/Bing map)
SELECT CAST(2 AS TINYINT) AS LocationType, a.Name AS FullName,…

Pure.Krome
- 84,693
- 113
- 396
- 647
7
votes
0 answers
Multiple geometry properties in Neo4j node
First, here is my stack description :
Neo4j 2.3.0 on GrapheneDB + Neo4j Spatial plugin 0.15
Ninja Framework 5.2.1 java server on my PC
Neo4j-OGM 1.1.3 for entity mapping
Geotools 14.0 for geostuffs
ApacheHttp for REST queries
I have Unit…

Zofren
- 1,190
- 2
- 11
- 22
7
votes
2 answers
How to implement Spatial(Geo-Location) searching in Grails?
I am working on Grails 1.3.2 with MySql. I need to store the latitude and longitude of certain locations in the database and then on the basis of the user's current location, I need to return the items that are within a particular radius of that…

Himanshu
- 196
- 1
- 5
7
votes
3 answers
Speeding up PostgreSQL query where data is between two dates
I have a large table (> 50m rows) which has some data with an ID and timestamp:
id, timestamp, data1, ..., dataN
...with a multi-column index on (id, timestamp).
I need to query the table to select all rows with a certain ID where the timestamp is…

Roger
- 71
- 1
- 1
- 3
7
votes
1 answer
SQL Optimising a spatial index for localised geography points
I have ~400k points of interest that are stored in GEOGRAPHY spatial sql.
I will be querying these points with PointOfInterest.STDistance(@CentralPoint) < @Radius to find PointOfInterest's within a certain radius of the @CentralPoint sent to the…

BritishDeveloper
- 13,219
- 9
- 52
- 62
7
votes
1 answer
Can I create a "Covering, Spatial" index in SQL Server 2008?
I currently have a site with a table that has Lat/Long float columns, and an index over those 2 columns plus another one I need to retrieve.
I'm constantly querying this table to get the rows that fall within a radius from a certain point (I'm…

Daniel Magliola
- 30,898
- 61
- 164
- 243