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_array if you have a small or medium sized extract
  • use dense_file_array if 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_*_array types, 16 bytes per node in the input file are used.
  • For dense_*_array types, 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 🌈


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