---
name: "osmium-query-locations-index"
section: "1"
platform: "linux"
package: "osmium-tool"
version: "1.18.0-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/osmium-query-locations-index"
---

# osmium-query-locations-index(1)

query node locations index

## NAME

osmium-query-locations-index - query node locations index

## SYNOPSIS

**osmium query-locations-index** -i INDEX-FILE \[*OPTIONS*\] *NODE-ID*

**osmium query-locations-index** -i INDEX-FILE \[*OPTIONS*\] --dump

## DESCRIPTION

Get the location of a node from an index created with **osmium** **create-locations-index** or dump the whole index into an OSM file.

The index file format is compatible to the one created by “osmium add-location-to-ways -i dense\_file\_array,INDEX-FILE” and to the flatnode store created by osm2pgsql.

This command will not work with negative node IDs.

Note that when the **--dump** option is used, metadata (like version, timestamp, etc.) is not written to the output file because it is all empty anyway. Use the **--output-format/-f** option with `add_metadata=...` to overwrite this.

## OPTIONS

- \--dump

  Dump all node locations to an OSM file. Use the **--output/-o** and **--output-format/-f** options to set the file format to be used. Default is STDOUT and the OPL format, respectively.

- \-i, --index-file=FILENAME

  The name of the index file.

## COMMON OPTIONS

- \-h, --help

  Show usage help.

- \-v, --verbose

  Set verbose mode. The program will output information about what it is doing to STDERR.

## OUTPUT OPTIONS

- \-f, --output-format=FORMAT

  The format of the output file. Can be used to set the output file format if it can’t be autodetected from the output file name. See [**osmium-file-formats**(5)](/osmium-file-formats/5.md) or the libosmium manual for details.

- \--fsync

  Call fsync after writing the output file to force flushing buffers to disk.

- \--generator=NAME

  The name and version of the program generating the output file. It will be added to the header of the output file. Default is “*osmium/*” and the version of osmium.

- \-o, --output=FILE

  Name of the output file. Default is \`-' (STDOUT).

- \-O, --overwrite

  Allow an existing output file to be overwritten. Normally **osmium** will refuse to write over an existing file.

- \--output-header=OPTION=VALUE

  Add output header option. This command line option can be used multiple times for different OPTIONs. See the *[osmium-output-headers(5)](/osmium-output-headers/5.md)* man page for a list of available header options. For some commands you can use the special format “OPTION!” (ie. an exclamation mark after the OPTION and no value set) to set the value to the same as in the input file.

## DIAGNOSTICS

**osmium query-locations-index** exits with exit code

- 0

  if everything went alright and the node location was found,

- 1

  if the node location was not found,

- 2

  if there was a problem with the command line arguments.

## MEMORY USAGE

**osmium query-locations-index** will not use a lot of memory.

## EXAMPLES

Get location of node 1234 from locations.idx:

-

  ```
  osmium query-locations-index -i locations.idx 1234
  ```

Dump contents of locations.idx into an OPL file:

-

  ```
  osmium query-locations-index -i locations.idx --dump -o nodes.opl
  ```

## SEE ALSO

- •

  [**osmium**(1)](/osmium/1.md), [**osmium-create-locations-index**(1)](/osmium-create-locations-index/1.md), [**osmium-file-formats**(5)](/osmium-file-formats/5.md), [**osmium-output-headers**(5)](/osmium-output-headers/5.md)

- •

  Osmium website ⟨https://osmcode.org/osmium-tool/⟩\\c

- •

  osm2pgsql ⟨https://wiki.openstreetmap.org/wiki/Osm2pgsql⟩\\c

## COPYRIGHT

Copyright (C) 2013-2025 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\>.
