Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am searching for C# library which has code that builds spatial index in memory based on geometry bounds and enables fast searching for all geometry inside given bounds.

I prefer free library.

share|improve this question but you say where your source data is coming from MYSQL? POSTGRES, SQLSERVER, ORACLE? or file – Mapperz Dec 2 '11 at 16:20
I have many data sources, so I will look for most generic solution from suggestions all gave. – watbywbarif Dec 3 '11 at 17:24
I was looking for C# bindings for libspatialindex, but I currently don't see anything beyond Rtree for Python. – Mike T Dec 3 '11 at 23:50
up vote 1 down vote accepted

There is a C#/.NET port of JTS Topology Suite:

Here's the index classes:

share|improve this answer
This looks OK, I will try to use this code and check this as answer if there is no problems. – watbywbarif Dec 3 '11 at 17:19
Using 1.11 version, looks OK for now. – watbywbarif Dec 14 '11 at 15:23

Maybe try googling for specific indexing methods. For example, when I Google for C# r-tree this is the first result.

share|improve this answer
Of course my life would have been more simple in start if I knew that I was looking for R-Tree ;) Thx! – watbywbarif Dec 3 '11 at 17:21

Another option is to use SQLite + Spatialite in memory. Create a table with a geometry column and a spatial index and insert your geometries there. Then use SQL queries to get the matching geometries.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.