OSMIUM-INDEX-TYPES(5)
π OSMIUM-INDEX-TYPES π
okay bestie, so this is the osmium-index-types page from the osmium manual (section 5, the file formats one π«Ά), and it's literally all about the different index types you can use to store node locations. let's get into it β¨
πΈ NAME πΈ
osmium-index-types β the index types used to store node locations π
β¨ DESCRIPTION β¨
So like, the osmium add-locations-to-ways and osmium export commands have to keep an index of the node locations somewhere while they're doing their thing β either in memory or in a temporary file on disk. and the way that happens? there's several different ways it can go down, and they all have different advantages and disadvantages. it's giving choices π
Use the --show-index-types/-I option on these commands to show all the available index types. heads up tho β which index types are available depends on your operating system. so like, not all of them are gonna show up everywhere, iykyk.
Use the --index-type/-i option on these commands to set which index type gets used. π
The default index type is flex_mem, which keeps all the data in memory and works for small extracts as well as the whole planet file. lowkey iconic. it's the right choice for almost all use cases β as long as you have enough memory to keep the whole index in memory. π§ β¨
For the osmium export command specifically, there's a special type called none that's used when you're reading from files that already have the node locations on the ways. (peep osmium-add-node-locations-to-ways(1) if you wanna know how to get a file like that π)
You can use one of the file-based indexes for the node location store to minimize memory use, but bestie... performance will suffer. π in that case:
- use
sparse_file_arrayif you have a small or medium sized extract - use
dense_file_arrayif you're working with a full planet or a really large extract
When you're using the file-based index types (*_file_array), you add the filename you want to use for the index after a comma, like so:
... -i dense_file_array,index.dat ...
slay π
π§ MEMORY USE π§
How much memory you need depends on which index type you're using, so let's break it down:
- For
sparse_*_arraytypes, 16 bytes per node in the input file are used. - For
dense_*_arraytypes, 8 bytes times the largest node ID in the input file are used.
The *_mem_* types use potentially up to twice this amount. π
The *mem* and *mmap* types store the data in memory, and the *file* types store it in a file on disk.
The flex_mem type automatically switches between something similar to sparse_mmap_array for smaller extracts and dense_mmap_array for larger extracts or the whole planet file. main character energy fr fr π
And if you specify the --verbose/-v option, Osmium will display how much memory was used for the index. very demure, very mindful π
π SEE ALSO π
osmium(1),osmium-add-locations-to-ways(1),osmium-export(1)- Osmium website
- Index types
π COPYRIGHT π
Copyright (C) 2013-2026 Jochen Topf <jochen@topf.org>.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
π CONTACT π
If you have any questions or want to report a bug, please go to <https://osmcode.org/contact.html> π«Ά
β AUTHORS β
Jochen Topf <jochen@topf.org>.
and that's the whole page, bestie π this was version 1.19.1 of the osmium-index-types(5) manual page β go forth and index responsibly, no cap πβ¨π¦
π¦ where this page comes from
- fedora 44: osmium-tool 1.19.1-1.fc44 Β· GPL-3.0-only
- nixos 26.05: osmium-tool 1.19.1
- nixpkgs unstable: osmium-tool 1.19.1
- ubuntu stonking: osmium-tool 1.19.1-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms