Will constructing S2shapeindex with a large amount of geo data take up a lot of memory? #318
Replies: 3 comments 1 reply
-
MutableS2ShapeIndex goes out of its way to minimize its memory footprint by e.g. batching updates and applying them lazily as they come in. You can actually attach an S2MemoryTracker to it to track memory consumption as it works. This will even let you cancel the indexing operation if too much memory has been used before it gets to be a problem. If you use too much memory either you'll trigger the OOM collector (on linux) or you'll start swapping, same as any other program, and it'll depend on how your system is configured. FYI we generally assume that we'll have < a signed 32 bit integer number of shapes, so you'll likely experience strange things if you go past 2147483648. |
Beta Was this translation helpful? Give feedback.
-
Is there any code demo for geocomputing using S2? the official documentation gives few examples |
Beta Was this translation helpful? Give feedback.
-
It depends on what you want to do, S2 is closer to a toolkit than a plug-and-play geocomputing library. There's several projects that use it though, which can often be the best reference. R2 in particular has built a Geography type around it to emulate the GEOS geography type. |
Beta Was this translation helpful? Give feedback.
-
i learned S2ShapeIndex is an abstract base class for indexing polygonal geometry in memory.
If I have a lot of geo data, hundreds of millions or billions, will it take up a lot of memory if I build an index for these data? The second question, what happens if there is insufficient memory during the construction of the index?
Beta Was this translation helpful? Give feedback.
All reactions