Questions tagged [spatial-index]

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.

281 questions
6
votes
2 answers

Spatial index slowing down query

Background I have a table that contains POLYGONS/MULTIPOLYGONS which represent customer territories: The table contains roughly 8,000 rows Approximately 90% of the polygons are circles The remainder of the polygons represent one or more states,…
David Budiac
  • 811
  • 2
  • 9
  • 21
6
votes
1 answer

Poor Lucene in-memory spatial index performance

In my application there is a use case to find the closest point to some other geo point. I decided to use in-memory spatial index and found several candidates: jeospatial and Lucene spatial. I made some benchmarks and was surprised to find out that…
Alexander Guz
  • 1,334
  • 12
  • 31
6
votes
1 answer

SOLR 4.2 - solr.LatLonType type vs solr.SpatialRecursivePrefixTreeFieldType

I am currently using SOLR 4.2 to index geospatial data (latitude and longitude data). I have configured my geospatial field as below.
Learner
  • 2,303
  • 9
  • 46
  • 81
6
votes
5 answers

Best Performance-Critical Algorithm for Solving Nearest Neighbor

We have a list of x,y pairs. Every pair represents a point on a 2D space. I want to find the closest point from this list, to a specific point xq,yq. What is the best performance-critical algorithm for this problem? Lisp of points is not going to…
5
votes
1 answer

Need help to optimize potentially erroneous spatial SQL query

Update: Since writing this post we decided to migrate our geospatial data to an ElasticSearch database, which yielded better results. I'm new to SQL and I need help to optimize a spatial query so that it runs under in under 2 seconds. We have…
5
votes
0 answers

Find K Closest pairs in a spatial database (Without specific query object)

Input: • N points {P1, …. , Pn} - each point is from the same dimension t: Pi = {x_1, …., x_t} where k is between 18-30 . • Distance function – dist(Pi, Pj) - returns a number that is the distance between the points. (The function is a…
5
votes
1 answer

MYSQL Using Spatial Index

I am attempting to utilize the spatial index. I have a table of ips, and a ip2geo table with ip block ranges. I'm attempting to assign Geo ID to each ip from the ip2geo table When attempting to to selected using a columns value the Spatial Index…
c3cris
  • 1,276
  • 2
  • 15
  • 37
5
votes
4 answers

Is it possible to efficiently count the number of line segments that overlap a single point P on a number line?

Is it possible to efficiently count the number of line segments that overlap a single point P on a number line? All the line segments are sitting on a single number line (its a 1-D world, not a 3-D world). Each line segment has a start coordinate X1…
Mathfan
  • 59
  • 4
5
votes
4 answers

Searching for a tuple with all elements greater than a given tuple efficiently

Consider the following list of tuples: [(5,4,5), (6,9,6), (3,8,3), (7,9,8)] I am trying to devise an algorithm to check whether there exists at least one tuple in the list where all elements of that tuple are greater than or equal to a given tuple…
Paul
  • 61
  • 2
  • 3
5
votes
1 answer

choice of parameters for R* Tree using SpatialIndex library

I am using the spatialindex library from http://libspatialindex.github.com/ I am creating an R* tree in the main memory: size_t capacity = 10; bool bWriteThrough = false; fileInMem = StorageManager ::createNewRandomEvictionsBuffer(*memStorage,…
arthur
  • 1,034
  • 2
  • 17
  • 31
5
votes
1 answer

Error when using Spatial Index in SQL Server

I use Spatial Index and when I try to execute WHERE statement: WHERE T.GEOMETRY.STIntersects(O.GEOMETRY) = 1 AND T.GEOMETRY.STTouches(O.GEOMETRY) = 0 It works fine, but when I try to execute with OR: WHERE T.GEOMETRY.STOverlaps(O.GEOMETRY) = 1 OR…
Nenad
  • 419
  • 6
  • 17
4
votes
2 answers

My spatial index in SQL Server is still requiring a lot of reads even on a very simple query. Why?

My trival query take 3 seconds to return and requires a ton of reads according to SQL Profiler. Why? I have a table filled with 5,000,000 accounts that are all geocoded points. All of the accounts are clustered within a 20 mile radius of a city. My…
Paul Mendoza
  • 5,709
  • 12
  • 53
  • 82
4
votes
2 answers

how to import spatial data to mysql 8 (Mysql WorkBench 8.0)

I have been trying to load spatial data to mysql 8 db and seems like it is not working. the import data section basically does not move from 0% but the tables are created with null values on every columns. Anyone know why this is happening? The…
4
votes
1 answer

Optimizing mysql query to select all points with in polygon using spatial indexes

Firstly, I admit that my experience with spatial functions is very minimal. I have a table in MySQL with 20 fields and 23549187 records that contain geographical data. One of the fields is 'point' which is of point data type and has spatial index on…
Rohith Mohan
  • 187
  • 1
  • 14
4
votes
1 answer

Spatial Indexing in sql server

I am trying to migrate from postgres to sql-server(windows). But I have no idea of ms-sql syntax and documentation is also doing me no good. I have a table 'geocodes' storing latitude and longitude data in decimal format. And I have an migration…
Abhinav Khare
  • 96
  • 1
  • 7
1 2
3
18 19