Map with more than 3k Markers

503 views Asked by At

I'm trying to draw a map with a lot of markers on it. Just say more than 3000 markers, and this is taking a very long time to process and is using a lot of memory.

But I have the same map on Google Earth and this open very quickly. Somebody knows a way to speedup the process using gmLib?

1

There are 1 answers

1
Arnaud Bouchez On

Take a look at RTree structures.

R-trees are tree data structures used for spatial access methods, i.e., for indexing multi-dimensional information such as geographical coordinates, rectangles or polygons.

A common real-world usage for an R-tree might be to store spatial objects such as restaurant locations or the polygons that typical maps are made of: streets, buildings, outlines of lakes, coastlines, etc. and then find answers quickly to queries such as "Find all museums within 2 km of my current location", "retrieve all road segments within 2 km of my location"

Queries like the one you expect will become almost immediate... :)

I use the RTree extension available in SQLite3. Our Open Source framework interfaces this kind of virtual tables with Delphi classes. BTW it works from Delphi 6 up to XE5.

If you are afraid of using a RTree, just ordering the data in order will help a lot searching e.g. via a binary search algorithm.