osmium
- Processing OSM files¶
Osmium processes files by reading data from a file and applying them
to a processing chain. Pyosmium offers a simplified wrapper to this
interface with the SimpleHandler
class from which an OSM file processor
can easily be derived.
For more fine grained control of the processing chain, the more basic functions and processors are exported as well in this module.
Input Handlers¶
An input handler implements provides the base class for writing custom data processors. They take input data, usually from a file, and forward it to handler functions.
SimpleWriter¶
The writer class can be used to create an OSM file. The writer is able to
handle native osmium.osm
objects as well as any Python object that
exposes the same attributes. It is not necessary to implement the full
list of attributes as any missing attributes will be replaced with a
sensible default value when writing. See Mutable OSM Objects
for a detailed discussion what data formats are understood for each attribute.
Warning
Writers are considerably faster in handling native osmium data types than Python objects. You should therefore avoid converting objects whereever possible. This is not only true for the OSM data types like Node, Way and Relation but also for tag lists, node lists and member lists.