Libosmium  2.15.4
Fast and flexible C++ library for working with OpenStreetMap data
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  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  file_compression { file_compression::none = 0, file_compression::gzip = 1, file_compression::bzip2 = 2 }
 
enum  file_format {
  file_format::unknown = 0, file_format::xml = 1, file_format::pbf = 2, file_format::opl = 3,
  file_format::json = 4, file_format::o5m = 5, file_format::debug = 6, file_format::blackhole = 7,
  file_format::last = 7
}
 
enum  read_meta { read_meta::no = 0, read_meta::yes = 1 }
 
enum  overwrite : bool { overwrite::no = false, overwrite::allow = true }
 
enum  fsync : bool { fsync::no = false, fsync::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)
 
template<typename TDest >
OSMIUM_DEPRECATED OutputIterator< TDest > make_output_iterator (TDest &destination, const size_t buffer_size)
 
template<typename... TArgs>
osmium::memory::Buffer read_file (TArgs &&... args)
 
InputIterator< Readerbegin (Reader &reader)
 
InputIterator< Readerend (Reader &)
 
InputIterator< ReaderWithProgressBarbegin (ReaderWithProgressBar &reader)
 
InputIterator< ReaderWithProgressBarend (ReaderWithProgressBar &)
 

Detailed Description

Everything related to input and output of OSM data.

Enumeration Type Documentation

◆ file_compression

Enumerator
none 
gzip 
bzip2 

◆ file_format

Enumerator
unknown 
xml 
pbf 
opl 
json 
o5m 
debug 
blackhole 
last 

◆ fsync

enum osmium::io::fsync : bool
strong

Should writer do an fsync before closing the file?

Enumerator
no 
yes 

◆ overwrite

enum osmium::io::overwrite : bool
strong

Allow overwriting of existing file?

Enumerator
no 
allow 

◆ read_meta

enum osmium::io::read_meta
strong
Enumerator
no 
yes 

Function Documentation

◆ as_string() [1/2]

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

◆ as_string() [2/2]

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

◆ 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]

◆ make_input_iterator_range()

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

◆ make_output_iterator() [1/2]

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

◆ make_output_iterator() [2/2]

template<typename TDest >
OSMIUM_DEPRECATED OutputIterator<TDest> osmium::io::make_output_iterator ( TDest &  destination,
const size_t  buffer_size 
)
Deprecated:
Use of buffer size argument on make_output_iterator is deprecated. Call Writer::set_buffer_size() instead if you want to change the default.

◆ 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.