Libosmium: osmium::io Namespace Reference

Libosmium Fast and flexible C++ library for working with OpenStreetMap data

Loading...
Searching...
No Matches
Classes | Enumerations | Functions
osmium::io Namespace Reference

Everything related to input and output of OSM data. More...

## Classes
class | Bzip2BufferDecompressor
class | Bzip2Compressor
class | Bzip2Decompressor
class | CompressionFactory
class | Compressor
class | Decompressor
class | DummyDecompressor
class | File
class | GzipBufferDecompressor
class | GzipCompressor
class | GzipDecompressor
class | Header
class | InputIterator
class | InputIteratorRange
class | NoCompressor
class | NoDecompressor
class | OutputIterator
class | Reader
class | ReaderWithProgressBar
class | Writer

## Enumerations
enum class | file_compression { none = 0 , gzip = 1 , bzip2 = 2 }
enum class | file_format { unknown = 0 , xml = 1 , pbf = 2 , opl = 3 , json = 4 , o5m = 5 , debug = 6 , blackhole = 7 , ids = 8 , last = 8 }
enum class | read_meta { no = 0 , yes = 1 }
enum class | buffers_type { any = 0 , single = 1 }
enum class | overwrite : bool { no = false , allow = true }
enum class | fsync : bool { no = false , yes = true }

## Functions
const char * | as_string (file_compression compression)
template<typename TChar, typename TTraits>
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const file_compression compression)
const char * | as_string (const file_format format) noexcept
template<typename TChar, typename TTraits>
std::basic_ostream< TChar, TTraits > & | operator<< (std::basic_ostream< TChar, TTraits > &out, const file_format format)
template<typename TItem, typename TSource>
InputIteratorRange< TSource, TItem > | make_input_iterator_range (TSource &source)
template<typename TDest>
OutputIterator< TDest > | make_output_iterator (TDest &destination)
std::vector< std::string > | supported_pbf_compression_types ()
template<typename... TArgs>
osmium::memory::Buffer | read_file (TArgs &&... args)
InputIterator< Reader > | begin (Reader &reader)
InputIterator< Reader > | end (Reader &)
InputIterator< ReaderWithProgressBar > | begin (ReaderWithProgressBar &reader)
InputIterator< ReaderWithProgressBar > | end (ReaderWithProgressBar &)

## Detailed Description

Everything related to input and output of OSM data.

## Enumeration Type Documentation

## ◆ buffers_type

enum class osmium::io::buffers_type
| strong

Enumerator
any |
single |

## ◆ file_compression

enum class osmium::io::file_compression
| strong

Enumerator
none |
gzip |
bzip2 |

## ◆ file_format

enum class osmium::io::file_format
| strong

Enumerator
unknown |
xml |
pbf |
opl |
json |
o5m |
debug |
blackhole |
ids |
last |

## ◆ fsync

enum class osmium::io::fsync : bool
| strong

Should writer do an fsync before closing the file?

Enumerator
no |
yes |

## ◆ overwrite

enum class osmium::io::overwrite : bool
| strong

Allow overwriting of existing file?

Enumerator
no |
allow |

## ◆ read_meta

enum class osmium::io::read_meta
| strong

Enumerator
no |
yes |

## Function Documentation

## ◆ as_string() [1/2]

const char * osmium::io::as_string | ( | const file_format | format | ) |
| inlinenoexcept

## ◆ as_string() [2/2]

const char * osmium::io::as_string | ( | file_compression | compression | ) |
| inline

## ◆ begin() [1/2]

InputIterator< Reader > osmium::io::begin | ( | Reader & | reader | ) |
| inline

## ◆ begin() [2/2]

InputIterator< ReaderWithProgressBar > osmium::io::begin | ( | ReaderWithProgressBar & | reader | ) |
| inline

## ◆ end() [1/2]

InputIterator< Reader > osmium::io::end | ( | Reader & |  | ) |
| inline

## ◆ end() [2/2]

InputIterator< ReaderWithProgressBar > osmium::io::end | ( | ReaderWithProgressBar & |  | ) |
| inline

## ◆ make_input_iterator_range()

template<typename TItem, typename TSource>

InputIteratorRange< TSource, TItem > osmium::io::make_input_iterator_range | ( | TSource & | source | ) |

## ◆ make_output_iterator()

template<typename TDest>

OutputIterator< TDest > osmium::io::make_output_iterator | ( | TDest & | destination | ) |

## ◆ operator<<() [1/2]

template<typename TChar, typename TTraits>

std::basic_ostream< TChar, TTraits > & osmium::io::operator<< | ( | std::basic_ostream< TChar, TTraits > & | out,
|  | const file_compression | compression )
| inline

## ◆ operator<<() [2/2]

template<typename TChar, typename TTraits>

std::basic_ostream< TChar, TTraits > & osmium::io::operator<< | ( | std::basic_ostream< TChar, TTraits > & | out,
|  | const file_format | format )
| inline

## ◆ read_file()

template<typename... TArgs>

osmium::memory::Buffer osmium::io::read_file | ( | TArgs &&... | args | ) |

Read contents of the given file into a buffer in one go. Takes the same arguments as any of the Reader constructors.

The buffer can take up quite a lot of memory, so don't do this unless you are working with small OSM files and/or have lots of RAM.

## ◆ supported_pbf_compression_types()

std::vector< std::string > osmium::io::supported_pbf_compression_types | ( |  | ) |
| inline

Get a list of all compression types supported for PBF files.