/* Generated by Cython 0.15.1 on Sun Mar  4 18:31:10 2012 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else

#include <stddef.h> /* For offsetof */
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif

#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif

#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif

#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif

#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
#endif

#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
#endif

#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)

  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;

  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)

#endif

#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#endif

#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif

#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#endif

#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif

#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)

#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif

#if PY_VERSION_HEX < 0x03020000
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif

#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif

#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__osmium__handler
#define __PYX_HAVE_API__osmium__handler
#include <string>
#include "osmium.hpp"
#include "stdint.h"
#include "time.h"
#include "osmium/osm/types.hpp"
#include "osmium/osm/tag.hpp"
#include "osmium/osm/tag_list.hpp"
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "osmium/osm/position.hpp"
#include "osmium/osm/bounds.hpp"
#include "osmium/osm/meta.hpp"
#include "osmium/osm/object.hpp"
#include "osmium/osm/node.hpp"
#include "osmium/osm/way_node.hpp"
#include "osmium/osm/way_node_list.hpp"
#include "osmium/osm/way.hpp"
#include "osmium/osm/relation_member.hpp"
#include "osmium/osm/relation_member_list.hpp"
#include "osmium/osm/relation.hpp"
#include "osmium/osm/area.hpp"
#include "osmium/handler.hpp"
#include "osmium/handler/debug.hpp"
#include "osmium/handler/progress.hpp"
#include "osmium/output.hpp"
#include "osmium/osmfile.hpp"
#include "pyerrors.h"
#include "_callback_handler.hpp"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif


/* inline attribute */
#ifndef CYTHON_INLINE
  #if defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

/* unused attribute */
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || defined(__INTEL_COMPILER)
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif

typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/


/* Type Conversion Predeclarations */

#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))

#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "handler.pyx",
  "handler_debug_impl.pxi",
  "handler_progress_impl.pxi",
  "handler_tee_impl.pxi",
  "handler.pxd",
  "handler_forward_impl.pxi",
  "handler_callback_impl.pxi",
  "osm.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_6osmium_3osm_TagList;
struct __pyx_obj_6osmium_3osm_WayNodeList;
struct __pyx_obj_6osmium_3osm_Object;
struct __pyx_obj_6osmium_3osm_Node;
struct StopReading_struct;
struct osmhandler_struct;
struct __pyx_obj_6osmium_7handler_Tee;
struct __pyx_obj_6osmium_3osm_Meta;
struct __pyx_obj_6osmium_3osm_Relation;
struct __pyx_obj_6osmium_7handler_Debug;
struct __pyx_obj_6osmium_3osm_RelationMemberList;
struct __pyx_obj_6osmium_7handler_Forward;
struct __pyx_obj_6osmium_3osm_Bounds;
struct __pyx_obj_6osmium_7handler_Progress;
struct __pyx_obj_6osmium_3osm_Way;

/* "osmium/osm.pxd":3
 * from c_osmium.osm cimport TagList as c_TagList, ObjectPtr, WayPtr, RelationPtr, Meta as c_Meta, Bounds as c_Bounds
 * 
 * cdef class TagList:             # <<<<<<<<<<<<<<
 *     cdef ObjectPtr *c_object
 * 
 */
struct __pyx_obj_6osmium_3osm_TagList {
  PyObject_HEAD
  shared_ptr<const Osmium::OSM::Object> *c_object;
};


/* "osmium/osm.pxd":6
 *     cdef ObjectPtr *c_object
 * 
 * cdef class WayNodeList:             # <<<<<<<<<<<<<<
 *     cdef WayPtr *c_way
 * 
 */
struct __pyx_obj_6osmium_3osm_WayNodeList {
  PyObject_HEAD
  shared_ptr<const Osmium::OSM::Way> *c_way;
};


/* "osmium/osm.pxd":12
 *     cdef RelationPtr *c_relation
 * 
 * cdef class Object:             # <<<<<<<<<<<<<<
 *     """Base class for OSM objects
 * 
 */
struct __pyx_obj_6osmium_3osm_Object {
  PyObject_HEAD
  shared_ptr<const Osmium::OSM::Object> *c_object;
};


/* "osmium/osm.pxd":19
 *     cdef ObjectPtr *c_object
 * 
 * cdef class Node(Object):             # <<<<<<<<<<<<<<
 *     """OSM Node object
 * 
 */
struct __pyx_obj_6osmium_3osm_Node {
  struct __pyx_obj_6osmium_3osm_Object __pyx_base;
};


/* "osmium/handler.pxd":11
 *         pass
 * 
 * cdef public class StopReading(Exception) [object StopReading_struct, type StopReading_type]:             # <<<<<<<<<<<<<<
 *     """raise this exception to immediately stop reading the input file
 *     """
 */
struct StopReading_struct {
  PyBaseExceptionObject __pyx_base;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) StopReading_type;

/* "osmium/handler.pxd":16
 *     pass
 * 
 * cdef public class Base[object osmhandler_struct, type osmhandler_type]:             # <<<<<<<<<<<<<<
 *     """base class for python implemented handlers
 *     """
 */
struct osmhandler_struct {
  PyObject_HEAD
  struct __pyx_vtabstruct_6osmium_7handler_Base *__pyx_vtab;
  struct __pyx_obj_6osmium_3osm_Node *cur_node;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) osmhandler_type;

/* "osmium/handler.pxd":42
 *     cpdef show_cursor(self)
 * 
 * cdef class Tee(Base):             # <<<<<<<<<<<<<<
 *     cdef public Base handler1
 *     cdef public Base handler2
 */
struct __pyx_obj_6osmium_7handler_Tee {
  struct osmhandler_struct __pyx_base;
  struct osmhandler_struct *handler1;
  struct osmhandler_struct *handler2;
};


/* "osmium/osm.pxd":40
 * 
 * 
 * cdef class Meta:             # <<<<<<<<<<<<<<
 *     """Meta information from the header of an OSM file.
 *     """
 */
struct __pyx_obj_6osmium_3osm_Meta {
  PyObject_HEAD
  struct __pyx_vtabstruct_6osmium_3osm_Meta *__pyx_vtab;
  Osmium::OSM::Meta *c_meta;
  struct __pyx_obj_6osmium_3osm_Bounds *bounds;
};


/* "osmium/osm.pxd":31
 *     pass
 * 
 * cdef class Relation(Object):             # <<<<<<<<<<<<<<
 *     """OSM Relation object
 *     """
 */
struct __pyx_obj_6osmium_3osm_Relation {
  struct __pyx_obj_6osmium_3osm_Object __pyx_base;
};


/* "osmium/handler.pxd":34
 *     cpdef final(self)
 * 
 * cdef class Debug(Base):             # <<<<<<<<<<<<<<
 *     cdef c_Debug *c_handler
 * 
 */
struct __pyx_obj_6osmium_7handler_Debug {
  struct osmhandler_struct __pyx_base;
  Osmium::Handler::Debug *c_handler;
};


/* "osmium/osm.pxd":9
 *     cdef WayPtr *c_way
 * 
 * cdef class RelationMemberList:             # <<<<<<<<<<<<<<
 *     cdef RelationPtr *c_relation
 * 
 */
struct __pyx_obj_6osmium_3osm_RelationMemberList {
  PyObject_HEAD
  shared_ptr<const Osmium::OSM::Relation> *c_relation;
};


/* "osmium/handler.pxd":46
 *     cdef public Base handler2
 * 
 * cdef class Forward(Base):             # <<<<<<<<<<<<<<
 *     cdef public Base handler
 */
struct __pyx_obj_6osmium_7handler_Forward {
  struct osmhandler_struct __pyx_base;
  struct osmhandler_struct *handler;
};


/* "osmium/osm.pxd":36
 *     pass
 * 
 * cdef class Bounds:             # <<<<<<<<<<<<<<
 *     cdef c_Bounds* c_bounds
 * 
 */
struct __pyx_obj_6osmium_3osm_Bounds {
  PyObject_HEAD
  Osmium::OSM::Bounds *c_bounds;
};


/* "osmium/handler.pxd":37
 *     cdef c_Debug *c_handler
 * 
 * cdef class Progress(Base):             # <<<<<<<<<<<<<<
 *     cdef c_Progress *c_handler
 *     cpdef hide_cursor(self)
 */
struct __pyx_obj_6osmium_7handler_Progress {
  struct osmhandler_struct __pyx_base;
  Osmium::Handler::Progress *c_handler;
};


/* "osmium/osm.pxd":26
 *     pass
 * 
 * cdef class Way(Object):             # <<<<<<<<<<<<<<
 *     """OSM Way object
 *     """
 */
struct __pyx_obj_6osmium_3osm_Way {
  struct __pyx_obj_6osmium_3osm_Object __pyx_base;
};



/* "osmium/osm.pxd":40
 * 
 * 
 * cdef class Meta:             # <<<<<<<<<<<<<<
 *     """Meta information from the header of an OSM file.
 *     """
 */

struct __pyx_vtabstruct_6osmium_3osm_Meta {
  PyObject *(*set_from_c)(struct __pyx_obj_6osmium_3osm_Meta *, Osmium::OSM::Meta &);
};
static struct __pyx_vtabstruct_6osmium_3osm_Meta *__pyx_vtabptr_6osmium_3osm_Meta;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) osmhandler_type;

/* "osmium/handler.pyx":10
 * 
 * 
 * cdef public class Base[object osmhandler_struct, type osmhandler_type]:             # <<<<<<<<<<<<<<
 *     """base class for python implemented handlers
 *     """
 */

struct __pyx_vtabstruct_6osmium_7handler_Base {
  PyObject *(*handle_infile)(struct osmhandler_struct *, Osmium::OSMFile *);
  PyObject *(*init)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch);
  PyObject *(*before_nodes)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*node)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch);
  PyObject *(*after_nodes)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*before_ways)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*way)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch);
  PyObject *(*after_ways)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*before_relations)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*relation)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch);
  PyObject *(*after_relations)(struct osmhandler_struct *, int __pyx_skip_dispatch);
  PyObject *(*final)(struct osmhandler_struct *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6osmium_7handler_Base *__pyx_vtabptr_6osmium_7handler_Base;


/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":3
 * # vim: filetype=pyrex
 * 
 * cdef class Progress(Base):             # <<<<<<<<<<<<<<
 *     u"""Progress
 *         Simple handler that shows progress on terminal by counting
 */

struct __pyx_vtabstruct_6osmium_7handler_Progress {
  struct __pyx_vtabstruct_6osmium_7handler_Base __pyx_base;
  PyObject *(*hide_cursor)(struct __pyx_obj_6osmium_7handler_Progress *, int __pyx_skip_dispatch);
  PyObject *(*show_cursor)(struct __pyx_obj_6osmium_7handler_Progress *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6osmium_7handler_Progress *__pyx_vtabptr_6osmium_7handler_Progress;


struct __pyx_vtabstruct_6osmium_7handler_Forward {
  struct __pyx_vtabstruct_6osmium_7handler_Base __pyx_base;
};
static struct __pyx_vtabstruct_6osmium_7handler_Forward *__pyx_vtabptr_6osmium_7handler_Forward;


struct __pyx_vtabstruct_6osmium_7handler_Debug {
  struct __pyx_vtabstruct_6osmium_7handler_Base __pyx_base;
};
static struct __pyx_vtabstruct_6osmium_7handler_Debug *__pyx_vtabptr_6osmium_7handler_Debug;


struct __pyx_vtabstruct_6osmium_7handler_Tee {
  struct __pyx_vtabstruct_6osmium_7handler_Base __pyx_base;
};
static struct __pyx_vtabstruct_6osmium_7handler_Tee *__pyx_vtabptr_6osmium_7handler_Tee;

#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif

#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif /* CYTHON_REFNANNY */

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict,
    const char* function_name, int kw_allowed); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

#ifndef __Pyx_CppExn2PyErr
static void __Pyx_CppExn2PyErr() {
  // Catch a handful of different errors here and turn them into the
  // equivalent Python errors.
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    // Unfortunately, in standard C++ we have no way of distinguishing EOF
    // from other errors here; be careful with the exception mask
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    // Change out_of_range to IndexError
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static int __Pyx_check_binary_version(void);

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static void* __Pyx_GetVtable(PyObject *dict); /*proto*/

static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig); /*proto*/

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

/* Module declarations from 'libcpp' */

/* Module declarations from 'libcpp.string' */

/* Module declarations from 'c_osmium' */

/* Module declarations from 'libc.stdint' */

/* Module declarations from 'c_osmium.osm' */

/* Module declarations from 'c_osmium.handler' */

/* Module declarations from 'c_osmium.output' */

/* Module declarations from 'c_osmium.osmfile' */

/* Module declarations from 'osmium.osm' */
static PyTypeObject *__pyx_ptype_6osmium_3osm_TagList = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_WayNodeList = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_RelationMemberList = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Object = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Node = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Way = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Relation = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Bounds = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm_Meta = 0;
static struct __pyx_obj_6osmium_3osm_Node **__pyx_vp_6osmium_3osm__cache_node = 0;
#define __pyx_v_6osmium_3osm__cache_node (*__pyx_vp_6osmium_3osm__cache_node)
static struct __pyx_obj_6osmium_3osm_Way **__pyx_vp_6osmium_3osm__cache_way = 0;
#define __pyx_v_6osmium_3osm__cache_way (*__pyx_vp_6osmium_3osm__cache_way)
static struct __pyx_obj_6osmium_3osm_Relation **__pyx_vp_6osmium_3osm__cache_relation = 0;
#define __pyx_v_6osmium_3osm__cache_relation (*__pyx_vp_6osmium_3osm__cache_relation)
static struct __pyx_obj_6osmium_3osm_TagList **__pyx_vp_6osmium_3osm__cache_taglist = 0;
#define __pyx_v_6osmium_3osm__cache_taglist (*__pyx_vp_6osmium_3osm__cache_taglist)
static struct __pyx_obj_6osmium_3osm_WayNodeList **__pyx_vp_6osmium_3osm__cache_waynodelist = 0;
#define __pyx_v_6osmium_3osm__cache_waynodelist (*__pyx_vp_6osmium_3osm__cache_waynodelist)
static struct __pyx_obj_6osmium_3osm_RelationMemberList **__pyx_vp_6osmium_3osm__cache_relationmemberlist = 0;
#define __pyx_v_6osmium_3osm__cache_relationmemberlist (*__pyx_vp_6osmium_3osm__cache_relationmemberlist)

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.ref' */

/* Module declarations from 'osmium._callback_handler' */

/* Module declarations from 'osmium.handler' */
static PyTypeObject *__pyx_ptype_6osmium_7handler_Exception = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_StopReading = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_Base = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_Debug = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_Progress = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_Tee = 0;
static PyTypeObject *__pyx_ptype_6osmium_7handler_Forward = 0;
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_init_callback(struct osmhandler_struct *, Osmium::OSM::Meta &); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_before_nodes_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_after_nodes_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_before_ways_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_after_ways_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_before_relations_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_after_relations_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_final_callback(struct osmhandler_struct *); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_node_callback(struct osmhandler_struct *, const shared_ptr<const Osmium::OSM::Node> &); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_way_callback(struct osmhandler_struct *, const shared_ptr<const Osmium::OSM::Way> &); /*proto*/
__PYX_EXTERN_C CYTHON_INLINE DL_EXPORT(int) c_relation_callback(struct osmhandler_struct *, const shared_ptr<const Osmium::OSM::Relation> &); /*proto*/
#define __Pyx_MODULE_NAME "osmium.handler"
int __pyx_module_is_main_osmium__handler = 0;

/* Implementation of 'osmium.handler' */
static char __pyx_k__way[] = "way";
static char __pyx_k__init[] = "init";
static char __pyx_k__node[] = "node";
static char __pyx_k__step[] = "step";
static char __pyx_k__final[] = "final";
static char __pyx_k__handler[] = "handler";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__handler1[] = "handler1";
static char __pyx_k__handler2[] = "handler2";
static char __pyx_k__relation[] = "relation";
static char __pyx_k__after_ways[] = "after_ways";
static char __pyx_k__after_nodes[] = "after_nodes";
static char __pyx_k__before_ways[] = "before_ways";
static char __pyx_k__hide_cursor[] = "hide_cursor";
static char __pyx_k__show_cursor[] = "show_cursor";
static char __pyx_k__before_nodes[] = "before_nodes";
static char __pyx_k__after_relations[] = "after_relations";
static char __pyx_k__before_relations[] = "before_relations";
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s__after_nodes;
static PyObject *__pyx_n_s__after_relations;
static PyObject *__pyx_n_s__after_ways;
static PyObject *__pyx_n_s__before_nodes;
static PyObject *__pyx_n_s__before_relations;
static PyObject *__pyx_n_s__before_ways;
static PyObject *__pyx_n_s__final;
static PyObject *__pyx_n_s__handler;
static PyObject *__pyx_n_s__handler1;
static PyObject *__pyx_n_s__handler2;
static PyObject *__pyx_n_s__hide_cursor;
static PyObject *__pyx_n_s__init;
static PyObject *__pyx_n_s__node;
static PyObject *__pyx_n_s__relation;
static PyObject *__pyx_n_s__show_cursor;
static PyObject *__pyx_n_s__step;
static PyObject *__pyx_n_s__way;

/* "osmium/handler.pyx":14
 *     """
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.cur_node = Node()
 * 
 */

static int __pyx_pf_6osmium_7handler_4Base___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_4Base___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;

  /* "osmium/handler.pyx":15
 * 
 *     def __init__(self):
 *         self.cur_node = Node()             # <<<<<<<<<<<<<<
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Node)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct osmhandler_struct *)__pyx_v_self)->cur_node);
  __Pyx_DECREF(((PyObject *)((struct osmhandler_struct *)__pyx_v_self)->cur_node));
  ((struct osmhandler_struct *)__pyx_v_self)->cur_node = ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":17
 *         self.cur_node = Node()
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):             # <<<<<<<<<<<<<<
 *         """Creates the correct Handler class and calls the read method
 * 
 */

static PyObject *__pyx_f_6osmium_7handler_4Base_handle_infile(struct osmhandler_struct *__pyx_v_self, Osmium::OSMFile *__pyx_v_infile) {
  CallbackHandler *__pyx_v_handler;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_infile");

  /* "osmium/handler.pyx":23
 *         handlers.
 *         """
 *         cdef CallbackHandler *handler = new CallbackHandler(self)             # <<<<<<<<<<<<<<
 *         infile.read(handler[0])
 * 
 */
  __pyx_v_handler = new CallbackHandler(__pyx_v_self);

  /* "osmium/handler.pyx":24
 *         """
 *         cdef CallbackHandler *handler = new CallbackHandler(self)
 *         infile.read(handler[0])             # <<<<<<<<<<<<<<
 * 
 *     cpdef init(self, Meta curmeta):
 */
  try {__pyx_v_infile->read((__pyx_v_handler[0]));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Base.handle_infile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":26
 *         infile.read(handler[0])
 * 
 *     cpdef init(self, Meta curmeta):             # <<<<<<<<<<<<<<
 *         """init_callback(self, meta)
 *         default handler for init
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_curmeta); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_init(struct osmhandler_struct *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_curmeta, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_1init)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_curmeta));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_curmeta));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_curmeta));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":30
 *         default handler for init
 *         """
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef before_nodes(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Base.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":26
 *         infile.read(handler[0])
 * 
 *     cpdef init(self, Meta curmeta):             # <<<<<<<<<<<<<<
 *         """init_callback(self, meta)
 *         default handler for init
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_curmeta); /*proto*/
static char __pyx_doc_6osmium_7handler_4Base_1init[] = "init_callback(self, meta)\n        default handler for init\n        ";
static PyObject *__pyx_pf_6osmium_7handler_4Base_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_curmeta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curmeta), __pyx_ptype_6osmium_3osm_Meta, 1, "curmeta", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->init(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_curmeta), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":32
 *         pass
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_2before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_before_nodes(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_2before_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":33
 * 
 *     cpdef before_nodes(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef node(self, Node curnode):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":32
 *         pass
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_2before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_2before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->before_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":35
 *         pass
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         """node_callback(self, curnode)
 *         default handler for nodes
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_3node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_node(struct osmhandler_struct *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Node *__pyx_v_curnode, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_3node)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_curnode));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_curnode));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_curnode));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":39
 *         default handler for nodes
 *         """
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef after_nodes(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Base.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":35
 *         pass
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         """node_callback(self, curnode)
 *         default handler for nodes
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_3node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static char __pyx_doc_6osmium_7handler_4Base_3node[] = "node_callback(self, curnode)\n        default handler for nodes\n        ";
static PyObject *__pyx_pf_6osmium_7handler_4Base_3node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curnode), __pyx_ptype_6osmium_3osm_Node, 1, "curnode", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->node(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_curnode), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":41
 *         pass
 * 
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_4after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_after_nodes(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_4after_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":42
 * 
 *     cpdef after_nodes(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef before_ways(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":41
 *         pass
 * 
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_4after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_4after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->after_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":44
 *         pass
 * 
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_5before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_before_ways(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_5before_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":45
 * 
 *     cpdef before_ways(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef way(self, Way curway):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":44
 *         pass
 * 
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_5before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_5before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->before_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":47
 *         pass
 * 
 *     cpdef way(self, Way curway):             # <<<<<<<<<<<<<<
 *         """way_callback(self, curway)
 *         default handler for ways
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_6way(PyObject *__pyx_v_self, PyObject *__pyx_v_curway); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_way(struct osmhandler_struct *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Way *__pyx_v_curway, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__way); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_6way)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_curway));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_curway));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_curway));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":51
 *         default handler for ways
 *         """
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef after_ways(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Base.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":47
 *         pass
 * 
 *     cpdef way(self, Way curway):             # <<<<<<<<<<<<<<
 *         """way_callback(self, curway)
 *         default handler for ways
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_6way(PyObject *__pyx_v_self, PyObject *__pyx_v_curway); /*proto*/
static char __pyx_doc_6osmium_7handler_4Base_6way[] = "way_callback(self, curway)\n        default handler for ways\n        ";
static PyObject *__pyx_pf_6osmium_7handler_4Base_6way(PyObject *__pyx_v_self, PyObject *__pyx_v_curway) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curway), __pyx_ptype_6osmium_3osm_Way, 1, "curway", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->way(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_curway), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":53
 *         pass
 * 
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_7after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_after_ways(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_7after_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":54
 * 
 *     cpdef after_ways(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef before_relations(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":53
 *         pass
 * 
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_7after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_7after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->after_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":56
 *         pass
 * 
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_8before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_before_relations(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_8before_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":57
 * 
 *     cpdef before_relations(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef relation(self, Relation currel):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":56
 *         pass
 * 
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_8before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_8before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->before_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":59
 *         pass
 * 
 *     cpdef relation(self, Relation currel):             # <<<<<<<<<<<<<<
 *         """relation_callback(self, curway)
 *         default handler for relations
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_9relation(PyObject *__pyx_v_self, PyObject *__pyx_v_currel); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_relation(struct osmhandler_struct *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_currel, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__relation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_9relation)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_currel));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_currel));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_currel));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":63
 *         default handler for relations
 *         """
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef after_relations(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Base.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":59
 *         pass
 * 
 *     cpdef relation(self, Relation currel):             # <<<<<<<<<<<<<<
 *         """relation_callback(self, curway)
 *         default handler for relations
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_9relation(PyObject *__pyx_v_self, PyObject *__pyx_v_currel); /*proto*/
static char __pyx_doc_6osmium_7handler_4Base_9relation[] = "relation_callback(self, curway)\n        default handler for relations\n        ";
static PyObject *__pyx_pf_6osmium_7handler_4Base_9relation(PyObject *__pyx_v_self, PyObject *__pyx_v_currel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_currel), __pyx_ptype_6osmium_3osm_Relation, 1, "currel", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->relation(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_currel), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":65
 *         pass
 * 
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_after_relations(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_10after_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":66
 * 
 *     cpdef after_relations(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 *     cpdef final(self):
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":65
 *         pass
 * 
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->after_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":68
 *         pass
 * 
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_4Base_final(struct osmhandler_struct *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__final); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_4Base_11final)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "osmium/handler.pyx":69
 * 
 *     cpdef final(self):
 *         pass             # <<<<<<<<<<<<<<
 * 
 * include "handler_debug_impl.pxi"
 */

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Base.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pyx":68
 *         pass
 * 
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_4Base_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_4Base_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)((struct osmhandler_struct *)__pyx_v_self)->__pyx_vtab)->final(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Base.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":9
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_handler = new c_Debug()
 * 
 */

static int __pyx_pf_6osmium_7handler_5Debug___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_5Debug___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":10
 * 
 *     def __cinit__(self):
 *         self.c_handler = new c_Debug()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->c_handler = new Osmium::Handler::Debug();

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":12
 *         self.c_handler = new c_Debug()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_handler
 * 
 */

static void __pyx_pf_6osmium_7handler_5Debug_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6osmium_7handler_5Debug_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":13
 * 
 *     def __dealloc__(self):
 *         del self.c_handler             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  delete ((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->c_handler;

  __Pyx_RefNannyFinishContext();
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":15
 *         del self.c_handler
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static int __pyx_pf_6osmium_7handler_5Debug_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_5Debug_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__");
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":18
 *         pass
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):             # <<<<<<<<<<<<<<
 *         infile.read(self.c_handler[0])
 * 
 */

static PyObject *__pyx_f_6osmium_7handler_5Debug_handle_infile(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, Osmium::OSMFile *__pyx_v_infile) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_infile");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":19
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):
 *         infile.read(self.c_handler[0])             # <<<<<<<<<<<<<<
 * 
 *     cpdef init(self, Meta meta):
 */
  try {__pyx_v_infile->read((__pyx_v_self->c_handler[0]));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Debug.handle_infile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":21
 *         infile.read(self.c_handler[0])
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.c_handler.init(meta.c_meta[0])
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_3init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_init(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_meta, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_3init)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_meta));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_meta));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_meta));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":22
 * 
 *     cpdef init(self, Meta meta):
 *         self.c_handler.init(meta.c_meta[0])             # <<<<<<<<<<<<<<
 * 
 *     cpdef node(self, Node curnode):
 */
  __pyx_v_self->c_handler->init((__pyx_v_meta->c_meta[0]));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Debug.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":21
 *         infile.read(self.c_handler[0])
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.c_handler.init(meta.c_meta[0])
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_3init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_3init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meta), __pyx_ptype_6osmium_3osm_Meta, 1, "meta", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_meta), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":24
 *         self.c_handler.init(meta.c_meta[0])
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_4node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_node(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Node *__pyx_v_curnode, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_4node)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_curnode));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_curnode));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_curnode));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":25
 * 
 *     cpdef node(self, Node curnode):
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef way(self, Way way):
 */
  __pyx_v_self->c_handler->node(boost::static_pointer_cast<const Osmium::OSM::Node>((__pyx_v_curnode->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Debug.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":24
 *         self.c_handler.init(meta.c_meta[0])
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_4node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_4node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curnode), __pyx_ptype_6osmium_3osm_Node, 1, "curnode", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.node(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_curnode), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":27
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_5way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_way(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Way *__pyx_v_way, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__way); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_5way)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_way));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_way));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_way));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":28
 * 
 *     cpdef way(self, Way way):
 *         self.c_handler.way(castWayPtr(way.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef relation(self, Relation rel):
 */
  __pyx_v_self->c_handler->way(boost::static_pointer_cast<const Osmium::OSM::Way>((__pyx_v_way->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Debug.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":27
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_5way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_5way(PyObject *__pyx_v_self, PyObject *__pyx_v_way) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_way), __pyx_ptype_6osmium_3osm_Way, 1, "way", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.way(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_way), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":30
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_6relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_relation(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_rel, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__relation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_6relation)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_rel));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_rel));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rel));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":31
 * 
 *     cpdef relation(self, Relation rel):
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->c_handler->relation(boost::static_pointer_cast<const Osmium::OSM::Relation>((__pyx_v_rel->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Debug.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":30
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_6relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_6relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rel), __pyx_ptype_6osmium_3osm_Relation, 1, "rel", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.relation(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_rel), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":34
 * 
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_nodes()
 *     cpdef after_nodes(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_7before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_before_nodes(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_7before_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":35
 * 
 *     cpdef before_nodes(self):
 *         self.c_handler.before_nodes()             # <<<<<<<<<<<<<<
 *     cpdef after_nodes(self):
 *         self.c_handler.after_nodes()
 */
  __pyx_v_self->c_handler->before_nodes();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":34
 * 
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_nodes()
 *     cpdef after_nodes(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_7before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_7before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":36
 *     cpdef before_nodes(self):
 *         self.c_handler.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_nodes()
 *     cpdef before_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_8after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_after_nodes(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_8after_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":37
 *         self.c_handler.before_nodes()
 *     cpdef after_nodes(self):
 *         self.c_handler.after_nodes()             # <<<<<<<<<<<<<<
 *     cpdef before_ways(self):
 *         self.c_handler.before_ways()
 */
  __pyx_v_self->c_handler->after_nodes();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":36
 *     cpdef before_nodes(self):
 *         self.c_handler.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_nodes()
 *     cpdef before_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_8after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_8after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":38
 *     cpdef after_nodes(self):
 *         self.c_handler.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_ways()
 *     cpdef after_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_9before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_before_ways(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_9before_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":39
 *         self.c_handler.after_nodes()
 *     cpdef before_ways(self):
 *         self.c_handler.before_ways()             # <<<<<<<<<<<<<<
 *     cpdef after_ways(self):
 *         self.c_handler.after_ways()
 */
  __pyx_v_self->c_handler->before_ways();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":38
 *     cpdef after_nodes(self):
 *         self.c_handler.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_ways()
 *     cpdef after_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_9before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_9before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":40
 *     cpdef before_ways(self):
 *         self.c_handler.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_ways()
 *     cpdef before_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_10after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_after_ways(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_10after_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":41
 *         self.c_handler.before_ways()
 *     cpdef after_ways(self):
 *         self.c_handler.after_ways()             # <<<<<<<<<<<<<<
 *     cpdef before_relations(self):
 *         self.c_handler.before_relations()
 */
  __pyx_v_self->c_handler->after_ways();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":40
 *     cpdef before_ways(self):
 *         self.c_handler.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_ways()
 *     cpdef before_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_10after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_10after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":42
 *     cpdef after_ways(self):
 *         self.c_handler.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_relations()
 *     cpdef after_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_11before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_before_relations(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_11before_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":43
 *         self.c_handler.after_ways()
 *     cpdef before_relations(self):
 *         self.c_handler.before_relations()             # <<<<<<<<<<<<<<
 *     cpdef after_relations(self):
 *         self.c_handler.after_relations()
 */
  __pyx_v_self->c_handler->before_relations();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":42
 *     cpdef after_ways(self):
 *         self.c_handler.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.before_relations()
 *     cpdef after_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_11before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_11before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":44
 *     cpdef before_relations(self):
 *         self.c_handler.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_relations()
 *     cpdef final(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_12after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_after_relations(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_12after_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":45
 *         self.c_handler.before_relations()
 *     cpdef after_relations(self):
 *         self.c_handler.after_relations()             # <<<<<<<<<<<<<<
 *     cpdef final(self):
 *         self.c_handler.final()
 */
  __pyx_v_self->c_handler->after_relations();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":44
 *     cpdef before_relations(self):
 *         self.c_handler.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.after_relations()
 *     cpdef final(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_12after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_12after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":46
 *     cpdef after_relations(self):
 *         self.c_handler.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_13final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_5Debug_final(struct __pyx_obj_6osmium_7handler_Debug *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__final); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_5Debug_13final)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":47
 *         self.c_handler.after_relations()
 *     cpdef final(self):
 *         self.c_handler.final()             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->c_handler->final();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Debug.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_debug_impl.pxi":46
 *     cpdef after_relations(self):
 *         self.c_handler.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_5Debug_13final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_5Debug_13final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Debug *)((struct __pyx_obj_6osmium_7handler_Debug *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.final(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Debug.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":18
 * 
 * 
 *     def __cinit__(self, int step=1000):             # <<<<<<<<<<<<<<
 *         self.c_handler = new c_Progress(step)
 * 
 */

static int __pyx_pf_6osmium_7handler_8Progress___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_8Progress___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_step;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__step,0};
  __Pyx_RefNannySetupContext("__cinit__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_step == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_step = ((int)1000);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.handler.Progress.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":19
 * 
 *     def __cinit__(self, int step=1000):
 *         self.c_handler = new c_Progress(step)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->c_handler = new Osmium::Handler::Progress(__pyx_v_step);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":21
 *         self.c_handler = new c_Progress(step)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_handler
 * 
 */

static void __pyx_pf_6osmium_7handler_8Progress_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6osmium_7handler_8Progress_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":22
 * 
 *     def __dealloc__(self):
 *         del self.c_handler             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, int step=1000):
 */
  delete ((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->c_handler;

  __Pyx_RefNannyFinishContext();
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":24
 *         del self.c_handler
 * 
 *     def __init__(self, int step=1000):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

static int __pyx_pf_6osmium_7handler_8Progress_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_8Progress_2__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_step;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__step,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__step);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_step = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_step == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_step = ((int)1000);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.handler.Progress.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":27
 *         pass
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):             # <<<<<<<<<<<<<<
 *         infile.read(self.c_handler[0])
 * 
 */

static PyObject *__pyx_f_6osmium_7handler_8Progress_handle_infile(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, Osmium::OSMFile *__pyx_v_infile) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_infile");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":28
 * 
 *     cdef handle_infile(self, c_OSMFile *infile):
 *         infile.read(self.c_handler[0])             # <<<<<<<<<<<<<<
 * 
 *     cpdef hide_cursor(self):
 */
  try {__pyx_v_infile->read((__pyx_v_self->c_handler[0]));} catch(...) {__Pyx_CppExn2PyErr(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}}

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Progress.handle_infile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":30
 *         infile.read(self.c_handler[0])
 * 
 *     cpdef hide_cursor(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.hide_cursor()
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_3hide_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_hide_cursor(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hide_cursor");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__hide_cursor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_3hide_cursor)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":31
 * 
 *     cpdef hide_cursor(self):
 *         self.c_handler.hide_cursor()             # <<<<<<<<<<<<<<
 * 
 *     cpdef show_cursor(self):
 */
  __pyx_v_self->c_handler->hide_cursor();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Progress.hide_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":30
 *         infile.read(self.c_handler[0])
 * 
 *     cpdef hide_cursor(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.hide_cursor()
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_3hide_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_3hide_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("hide_cursor");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->hide_cursor(((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.hide_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":33
 *         self.c_handler.hide_cursor()
 * 
 *     cpdef show_cursor(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.show_cursor()
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_4show_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_show_cursor(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("show_cursor");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__show_cursor); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_4show_cursor)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":34
 * 
 *     cpdef show_cursor(self):
 *         self.c_handler.show_cursor()             # <<<<<<<<<<<<<<
 * 
 *     cpdef init(self, Meta meta):
 */
  __pyx_v_self->c_handler->show_cursor();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Progress.show_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":33
 *         self.c_handler.hide_cursor()
 * 
 *     cpdef show_cursor(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.show_cursor()
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_4show_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_4show_cursor(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("show_cursor");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->show_cursor(((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.show_cursor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":36
 *         self.c_handler.show_cursor()
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.c_handler.init(meta.c_meta[0])
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_5init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_init(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_meta, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_5init)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_meta));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_meta));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_meta));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":37
 * 
 *     cpdef init(self, Meta meta):
 *         self.c_handler.init(meta.c_meta[0])             # <<<<<<<<<<<<<<
 * 
 *     cpdef node(self, Node curnode):
 */
  __pyx_v_self->c_handler->init((__pyx_v_meta->c_meta[0]));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Progress.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":36
 *         self.c_handler.show_cursor()
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.c_handler.init(meta.c_meta[0])
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_5init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_5init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meta), __pyx_ptype_6osmium_3osm_Meta, 1, "meta", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_meta), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":39
 *         self.c_handler.init(meta.c_meta[0])
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_6node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_node(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Node *__pyx_v_curnode, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_6node)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_curnode));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_curnode));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_curnode));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":40
 * 
 *     cpdef node(self, Node curnode):
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef way(self, Way way):
 */
  __pyx_v_self->c_handler->node(boost::static_pointer_cast<const Osmium::OSM::Node>((__pyx_v_curnode->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Progress.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":39
 *         self.c_handler.init(meta.c_meta[0])
 * 
 *     cpdef node(self, Node curnode):             # <<<<<<<<<<<<<<
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_6node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_6node(PyObject *__pyx_v_self, PyObject *__pyx_v_curnode) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_curnode), __pyx_ptype_6osmium_3osm_Node, 1, "curnode", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.node(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_curnode), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":42
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_7way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_way(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Way *__pyx_v_way, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__way); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_7way)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_way));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_way));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_way));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":43
 * 
 *     cpdef way(self, Way way):
 *         self.c_handler.way(castWayPtr(way.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef relation(self, Relation rel):
 */
  __pyx_v_self->c_handler->way(boost::static_pointer_cast<const Osmium::OSM::Way>((__pyx_v_way->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Progress.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":42
 *         self.c_handler.node(castNodePtr(curnode.c_object[0]))
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_7way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_7way(PyObject *__pyx_v_self, PyObject *__pyx_v_way) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_way), __pyx_ptype_6osmium_3osm_Way, 1, "way", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.way(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_way), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":45
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_8relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_relation(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_rel, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__relation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_8relation)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_rel));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_rel));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rel));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":46
 * 
 *     cpdef relation(self, Relation rel):
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))             # <<<<<<<<<<<<<<
 * 
 *     cpdef final(self):
 */
  __pyx_v_self->c_handler->relation(boost::static_pointer_cast<const Osmium::OSM::Relation>((__pyx_v_rel->__pyx_base.c_object[0])));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Progress.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":45
 *         self.c_handler.way(castWayPtr(way.c_object[0]))
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_8relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_8relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rel), __pyx_ptype_6osmium_3osm_Relation, 1, "rel", 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.relation(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_rel), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":48
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_9final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_8Progress_final(struct __pyx_obj_6osmium_7handler_Progress *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__final); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_8Progress_9final)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":49
 * 
 *     cpdef final(self):
 *         self.c_handler.final()             # <<<<<<<<<<<<<<
 */
  __pyx_v_self->c_handler->final();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Progress.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_progress_impl.pxi":48
 *         self.c_handler.relation(castRelationPtr(rel.c_object[0]))
 * 
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.c_handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_8Progress_9final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_8Progress_9final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Progress *)((struct __pyx_obj_6osmium_7handler_Progress *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.final(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Progress.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":8
 *     """
 * 
 *     def __init__(self, handler1, handler2):             # <<<<<<<<<<<<<<
 *         self.handler1 = handler1
 *         self.handler2 = handler2
 */

static int __pyx_pf_6osmium_7handler_3Tee___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_3Tee___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_handler1 = 0;
  PyObject *__pyx_v_handler2 = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handler1,&__pyx_n_s__handler2,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handler1);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handler2);
        if (likely(values[1])) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_handler1 = values[0];
    __pyx_v_handler2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.handler.Tee.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":9
 * 
 *     def __init__(self, handler1, handler2):
 *         self.handler1 = handler1             # <<<<<<<<<<<<<<
 *         self.handler2 = handler2
 * 
 */
  if (!(likely(((__pyx_v_handler1) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_handler1, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_handler1);
  __Pyx_GIVEREF(__pyx_v_handler1);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1 = ((struct osmhandler_struct *)__pyx_v_handler1);

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":10
 *     def __init__(self, handler1, handler2):
 *         self.handler1 = handler1
 *         self.handler2 = handler2             # <<<<<<<<<<<<<<
 * 
 *     cpdef init(self, Meta meta):
 */
  if (!(likely(((__pyx_v_handler2) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_handler2, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_handler2);
  __Pyx_GIVEREF(__pyx_v_handler2);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2 = ((struct osmhandler_struct *)__pyx_v_handler2);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Tee.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":12
 *         self.handler2 = handler2
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.handler1.init(meta)
 *         self.handler2.init(meta)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_init(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_meta, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_1init)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_meta));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_meta));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_meta));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":13
 * 
 *     cpdef init(self, Meta meta):
 *         self.handler1.init(meta)             # <<<<<<<<<<<<<<
 *         self.handler2.init(meta)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->init(__pyx_v_self->handler1, __pyx_v_meta, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":14
 *     cpdef init(self, Meta meta):
 *         self.handler1.init(meta)
 *         self.handler2.init(meta)             # <<<<<<<<<<<<<<
 * 
 *     cpdef node(self, Node node):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->init(__pyx_v_self->handler2, __pyx_v_meta, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Tee.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":12
 *         self.handler2 = handler2
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.handler1.init(meta)
 *         self.handler2.init(meta)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meta), __pyx_ptype_6osmium_3osm_Meta, 1, "meta", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_meta), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":16
 *         self.handler2.init(meta)
 * 
 *     cpdef node(self, Node node):             # <<<<<<<<<<<<<<
 *         self.handler1.node(node)
 *         self.handler2.node(node)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_node(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Node *__pyx_v_node, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_2node)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_node));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_node));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":17
 * 
 *     cpdef node(self, Node node):
 *         self.handler1.node(node)             # <<<<<<<<<<<<<<
 *         self.handler2.node(node)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->node(__pyx_v_self->handler1, __pyx_v_node, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":18
 *     cpdef node(self, Node node):
 *         self.handler1.node(node)
 *         self.handler2.node(node)             # <<<<<<<<<<<<<<
 * 
 *     cpdef way(self, Way way):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->node(__pyx_v_self->handler2, __pyx_v_node, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Tee.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":16
 *         self.handler2.init(meta)
 * 
 *     cpdef node(self, Node node):             # <<<<<<<<<<<<<<
 *         self.handler1.node(node)
 *         self.handler2.node(node)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_6osmium_3osm_Node, 1, "node", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.node(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_node), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":20
 *         self.handler2.node(node)
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.handler1.way(way)
 *         self.handler2.way(way)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_way(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Way *__pyx_v_way, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__way); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_3way)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_way));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_way));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_way));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":21
 * 
 *     cpdef way(self, Way way):
 *         self.handler1.way(way)             # <<<<<<<<<<<<<<
 *         self.handler2.way(way)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->way(__pyx_v_self->handler1, __pyx_v_way, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":22
 *     cpdef way(self, Way way):
 *         self.handler1.way(way)
 *         self.handler2.way(way)             # <<<<<<<<<<<<<<
 * 
 *     cpdef relation(self, Relation rel):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->way(__pyx_v_self->handler2, __pyx_v_way, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Tee.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":20
 *         self.handler2.node(node)
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.handler1.way(way)
 *         self.handler2.way(way)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_way), __pyx_ptype_6osmium_3osm_Way, 1, "way", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.way(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_way), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":24
 *         self.handler2.way(way)
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.handler1.relation(rel)
 *         self.handler2.relation(rel)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_relation(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_rel, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__relation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_4relation)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_rel));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_rel));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rel));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":25
 * 
 *     cpdef relation(self, Relation rel):
 *         self.handler1.relation(rel)             # <<<<<<<<<<<<<<
 *         self.handler2.relation(rel)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->relation(__pyx_v_self->handler1, __pyx_v_rel, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":26
 *     cpdef relation(self, Relation rel):
 *         self.handler1.relation(rel)
 *         self.handler2.relation(rel)             # <<<<<<<<<<<<<<
 * 
 *     cpdef before_nodes(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->relation(__pyx_v_self->handler2, __pyx_v_rel, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Tee.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":24
 *         self.handler2.way(way)
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.handler1.relation(rel)
 *         self.handler2.relation(rel)
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rel), __pyx_ptype_6osmium_3osm_Relation, 1, "rel", 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.relation(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_rel), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":28
 *         self.handler2.relation(rel)
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_nodes()
 *         self.handler2.before_nodes()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_before_nodes(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_5before_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":29
 * 
 *     cpdef before_nodes(self):
 *         self.handler1.before_nodes()             # <<<<<<<<<<<<<<
 *         self.handler2.before_nodes()
 *     cpdef after_nodes(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->before_nodes(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":30
 *     cpdef before_nodes(self):
 *         self.handler1.before_nodes()
 *         self.handler2.before_nodes()             # <<<<<<<<<<<<<<
 *     cpdef after_nodes(self):
 *         self.handler1.after_nodes()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->before_nodes(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":28
 *         self.handler2.relation(rel)
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_nodes()
 *         self.handler2.before_nodes()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":31
 *         self.handler1.before_nodes()
 *         self.handler2.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_nodes()
 *         self.handler2.after_nodes()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_after_nodes(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_6after_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":32
 *         self.handler2.before_nodes()
 *     cpdef after_nodes(self):
 *         self.handler1.after_nodes()             # <<<<<<<<<<<<<<
 *         self.handler2.after_nodes()
 *     cpdef before_ways(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->after_nodes(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":33
 *     cpdef after_nodes(self):
 *         self.handler1.after_nodes()
 *         self.handler2.after_nodes()             # <<<<<<<<<<<<<<
 *     cpdef before_ways(self):
 *         self.handler1.before_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->after_nodes(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":31
 *         self.handler1.before_nodes()
 *         self.handler2.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_nodes()
 *         self.handler2.after_nodes()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":34
 *         self.handler1.after_nodes()
 *         self.handler2.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_ways()
 *         self.handler2.before_ways()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_before_ways(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_7before_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":35
 *         self.handler2.after_nodes()
 *     cpdef before_ways(self):
 *         self.handler1.before_ways()             # <<<<<<<<<<<<<<
 *         self.handler2.before_ways()
 *     cpdef after_ways(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->before_ways(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":36
 *     cpdef before_ways(self):
 *         self.handler1.before_ways()
 *         self.handler2.before_ways()             # <<<<<<<<<<<<<<
 *     cpdef after_ways(self):
 *         self.handler1.after_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->before_ways(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":34
 *         self.handler1.after_nodes()
 *         self.handler2.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_ways()
 *         self.handler2.before_ways()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":37
 *         self.handler1.before_ways()
 *         self.handler2.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_ways()
 *         self.handler2.after_ways()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_after_ways(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_8after_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":38
 *         self.handler2.before_ways()
 *     cpdef after_ways(self):
 *         self.handler1.after_ways()             # <<<<<<<<<<<<<<
 *         self.handler2.after_ways()
 *     cpdef before_relations(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->after_ways(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":39
 *     cpdef after_ways(self):
 *         self.handler1.after_ways()
 *         self.handler2.after_ways()             # <<<<<<<<<<<<<<
 *     cpdef before_relations(self):
 *         self.handler1.before_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->after_ways(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":37
 *         self.handler1.before_ways()
 *         self.handler2.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_ways()
 *         self.handler2.after_ways()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":40
 *         self.handler1.after_ways()
 *         self.handler2.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_relations()
 *         self.handler2.before_relations()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_before_relations(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_9before_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":41
 *         self.handler2.after_ways()
 *     cpdef before_relations(self):
 *         self.handler1.before_relations()             # <<<<<<<<<<<<<<
 *         self.handler2.before_relations()
 *     cpdef after_relations(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->before_relations(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":42
 *     cpdef before_relations(self):
 *         self.handler1.before_relations()
 *         self.handler2.before_relations()             # <<<<<<<<<<<<<<
 *     cpdef after_relations(self):
 *         self.handler1.after_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->before_relations(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":40
 *         self.handler1.after_ways()
 *         self.handler2.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler1.before_relations()
 *         self.handler2.before_relations()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":43
 *         self.handler1.before_relations()
 *         self.handler2.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_relations()
 *         self.handler2.after_relations()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_after_relations(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_10after_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":44
 *         self.handler2.before_relations()
 *     cpdef after_relations(self):
 *         self.handler1.after_relations()             # <<<<<<<<<<<<<<
 *         self.handler2.after_relations()
 *     cpdef final(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->after_relations(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":45
 *     cpdef after_relations(self):
 *         self.handler1.after_relations()
 *         self.handler2.after_relations()             # <<<<<<<<<<<<<<
 *     cpdef final(self):
 *         self.handler1.final()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->after_relations(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":43
 *         self.handler1.before_relations()
 *         self.handler2.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler1.after_relations()
 *         self.handler2.after_relations()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":46
 *         self.handler1.after_relations()
 *         self.handler2.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.handler1.final()
 *         self.handler2.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_3Tee_final(struct __pyx_obj_6osmium_7handler_Tee *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__final); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_3Tee_11final)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":47
 *         self.handler2.after_relations()
 *     cpdef final(self):
 *         self.handler1.final()             # <<<<<<<<<<<<<<
 *         self.handler2.final()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler1->__pyx_vtab)->final(__pyx_v_self->handler1, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":48
 *     cpdef final(self):
 *         self.handler1.final()
 *         self.handler2.final()             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler2->__pyx_vtab)->final(__pyx_v_self->handler2, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Tee.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_tee_impl.pxi":46
 *         self.handler1.after_relations()
 *         self.handler2.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.handler1.final()
 *         self.handler2.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Tee *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.final(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Tee.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pxd":43
 * 
 * cdef class Tee(Base):
 *     cdef public Base handler1             # <<<<<<<<<<<<<<
 *     cdef public Base handler2
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_8handler1___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_8handler1___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_3Tee_8handler1_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6osmium_7handler_3Tee_8handler1_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1 = ((struct osmhandler_struct *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Tee.handler1.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_3Tee_8handler1_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6osmium_7handler_3Tee_8handler1_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler1 = ((struct osmhandler_struct *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pxd":44
 * cdef class Tee(Base):
 *     cdef public Base handler1
 *     cdef public Base handler2             # <<<<<<<<<<<<<<
 * 
 * cdef class Forward(Base):
 */

static PyObject *__pyx_pf_6osmium_7handler_3Tee_8handler2___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_3Tee_8handler2___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_3Tee_8handler2_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6osmium_7handler_3Tee_8handler2_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2 = ((struct osmhandler_struct *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Tee.handler2.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_3Tee_8handler2_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6osmium_7handler_3Tee_8handler2_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2));
  ((struct __pyx_obj_6osmium_7handler_Tee *)__pyx_v_self)->handler2 = ((struct osmhandler_struct *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":10
 *     """
 * 
 *     def __init__(self, handler):             # <<<<<<<<<<<<<<
 *         self.handler = handler
 * 
 */

static int __pyx_pf_6osmium_7handler_7Forward___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_7handler_7Forward___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_handler = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__handler,0};
  __Pyx_RefNannySetupContext("__init__");
  {
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  0:
        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__handler);
        if (likely(values[0])) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_handler = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[5]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.handler.Forward.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":11
 * 
 *     def __init__(self, handler):
 *         self.handler = handler             # <<<<<<<<<<<<<<
 * 
 *     cpdef init(self, Meta meta):
 */
  if (!(likely(((__pyx_v_handler) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_handler, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_handler);
  __Pyx_GIVEREF(__pyx_v_handler);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler));
  ((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler = ((struct osmhandler_struct *)__pyx_v_handler);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Forward.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":13
 *         self.handler = handler
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.handler.init(meta)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_init(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_meta, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__init); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_1init)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_meta));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_meta));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_meta));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":14
 * 
 *     cpdef init(self, Meta meta):
 *         self.handler.init(meta)             # <<<<<<<<<<<<<<
 * 
 *     cpdef node(self, Node node):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->init(__pyx_v_self->handler, __pyx_v_meta, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Forward.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":13
 *         self.handler = handler
 * 
 *     cpdef init(self, Meta meta):             # <<<<<<<<<<<<<<
 *         self.handler.init(meta)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_1init(PyObject *__pyx_v_self, PyObject *__pyx_v_meta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("init");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_meta), __pyx_ptype_6osmium_3osm_Meta, 1, "meta", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.init(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_meta), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":16
 *         self.handler.init(meta)
 * 
 *     cpdef node(self, Node node):             # <<<<<<<<<<<<<<
 *         self.handler.node(node)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_node(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Node *__pyx_v_node, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_2node)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_node));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_node));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_node));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":17
 * 
 *     cpdef node(self, Node node):
 *         self.handler.node(node)             # <<<<<<<<<<<<<<
 * 
 *     cpdef way(self, Way way):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->node(__pyx_v_self->handler, __pyx_v_node, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Forward.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":16
 *         self.handler.init(meta)
 * 
 *     cpdef node(self, Node node):             # <<<<<<<<<<<<<<
 *         self.handler.node(node)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_2node(PyObject *__pyx_v_self, PyObject *__pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("node");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_6osmium_3osm_Node, 1, "node", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.node(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_node), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":19
 *         self.handler.node(node)
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.handler.way(way)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_way(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Way *__pyx_v_way, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__way); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_3way)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_way));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_way));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_way));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":20
 * 
 *     cpdef way(self, Way way):
 *         self.handler.way(way)             # <<<<<<<<<<<<<<
 * 
 *     cpdef relation(self, Relation rel):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->way(__pyx_v_self->handler, __pyx_v_way, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Forward.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":19
 *         self.handler.node(node)
 * 
 *     cpdef way(self, Way way):             # <<<<<<<<<<<<<<
 *         self.handler.way(way)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_3way(PyObject *__pyx_v_self, PyObject *__pyx_v_way) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("way");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_way), __pyx_ptype_6osmium_3osm_Way, 1, "way", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.way(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_way), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.way", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":22
 *         self.handler.way(way)
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.handler.relation(rel)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_relation(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_rel, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__relation); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_4relation)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(((PyObject *)__pyx_v_rel));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_rel));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_rel));
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":23
 * 
 *     cpdef relation(self, Relation rel):
 *         self.handler.relation(rel)             # <<<<<<<<<<<<<<
 * 
 *     cpdef before_nodes(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->relation(__pyx_v_self->handler, __pyx_v_rel, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.handler.Forward.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":22
 *         self.handler.way(way)
 * 
 *     cpdef relation(self, Relation rel):             # <<<<<<<<<<<<<<
 *         self.handler.relation(rel)
 * 
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_4relation(PyObject *__pyx_v_self, PyObject *__pyx_v_rel) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relation");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rel), __pyx_ptype_6osmium_3osm_Relation, 1, "rel", 0))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.relation(((struct osmhandler_struct *)__pyx_v_self), ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_rel), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.relation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":25
 *         self.handler.relation(rel)
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_nodes()
 *     cpdef after_nodes(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_before_nodes(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_5before_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":26
 * 
 *     cpdef before_nodes(self):
 *         self.handler.before_nodes()             # <<<<<<<<<<<<<<
 *     cpdef after_nodes(self):
 *         self.handler.after_nodes()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->before_nodes(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":25
 *         self.handler.relation(rel)
 * 
 *     cpdef before_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_nodes()
 *     cpdef after_nodes(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_5before_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.before_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":27
 *     cpdef before_nodes(self):
 *         self.handler.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_nodes()
 *     cpdef before_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_after_nodes(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_nodes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_6after_nodes)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":28
 *         self.handler.before_nodes()
 *     cpdef after_nodes(self):
 *         self.handler.after_nodes()             # <<<<<<<<<<<<<<
 *     cpdef before_ways(self):
 *         self.handler.before_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->after_nodes(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":27
 *     cpdef before_nodes(self):
 *         self.handler.before_nodes()
 *     cpdef after_nodes(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_nodes()
 *     cpdef before_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_6after_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_nodes");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_nodes(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.after_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":29
 *     cpdef after_nodes(self):
 *         self.handler.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_ways()
 *     cpdef after_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_before_ways(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_7before_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":30
 *         self.handler.after_nodes()
 *     cpdef before_ways(self):
 *         self.handler.before_ways()             # <<<<<<<<<<<<<<
 *     cpdef after_ways(self):
 *         self.handler.after_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->before_ways(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":29
 *     cpdef after_nodes(self):
 *         self.handler.after_nodes()
 *     cpdef before_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_ways()
 *     cpdef after_ways(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_7before_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.before_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":31
 *     cpdef before_ways(self):
 *         self.handler.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_ways()
 *     cpdef before_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_after_ways(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_ways); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_8after_ways)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":32
 *         self.handler.before_ways()
 *     cpdef after_ways(self):
 *         self.handler.after_ways()             # <<<<<<<<<<<<<<
 *     cpdef before_relations(self):
 *         self.handler.before_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->after_ways(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":31
 *     cpdef before_ways(self):
 *         self.handler.before_ways()
 *     cpdef after_ways(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_ways()
 *     cpdef before_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_8after_ways(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_ways");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_ways(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.after_ways", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":33
 *     cpdef after_ways(self):
 *         self.handler.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_relations()
 *     cpdef after_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_before_relations(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__before_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_9before_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":34
 *         self.handler.after_ways()
 *     cpdef before_relations(self):
 *         self.handler.before_relations()             # <<<<<<<<<<<<<<
 *     cpdef after_relations(self):
 *         self.handler.after_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->before_relations(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":33
 *     cpdef after_ways(self):
 *         self.handler.after_ways()
 *     cpdef before_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler.before_relations()
 *     cpdef after_relations(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_9before_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("before_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.before_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.before_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":35
 *     cpdef before_relations(self):
 *         self.handler.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_relations()
 *     cpdef final(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_after_relations(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__after_relations); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_10after_relations)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":36
 *         self.handler.before_relations()
 *     cpdef after_relations(self):
 *         self.handler.after_relations()             # <<<<<<<<<<<<<<
 *     cpdef final(self):
 *         self.handler.final()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->after_relations(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":35
 *     cpdef before_relations(self):
 *         self.handler.before_relations()
 *     cpdef after_relations(self):             # <<<<<<<<<<<<<<
 *         self.handler.after_relations()
 *     cpdef final(self):
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_10after_relations(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("after_relations");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.after_relations(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.after_relations", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":37
 *     cpdef after_relations(self):
 *         self.handler.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6osmium_7handler_7Forward_final(struct __pyx_obj_6osmium_7handler_Forward *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overriden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__final); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (void *)&__pyx_pf_6osmium_7handler_7Forward_11final)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":38
 *         self.handler.after_relations()
 *     cpdef final(self):
 *         self.handler.final()             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_self->handler->__pyx_vtab)->final(__pyx_v_self->handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.Forward.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_forward_impl.pxi":37
 *     cpdef after_relations(self):
 *         self.handler.after_relations()
 *     cpdef final(self):             # <<<<<<<<<<<<<<
 *         self.handler.final()
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_11final(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Forward *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base.final(((struct osmhandler_struct *)__pyx_v_self), 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.Forward.final", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/handler.pxd":47
 * 
 * cdef class Forward(Base):
 *     cdef public Base handler             # <<<<<<<<<<<<<<
 */

static PyObject *__pyx_pf_6osmium_7handler_7Forward_7handler___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_7handler_7Forward_7handler___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_7Forward_7handler_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6osmium_7handler_7Forward_7handler_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__");
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6osmium_7handler_Base))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler));
  ((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler = ((struct osmhandler_struct *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.handler.Forward.handler.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6osmium_7handler_7Forward_7handler_2__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_6osmium_7handler_7Forward_7handler_2__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__");
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler));
  ((struct __pyx_obj_6osmium_7handler_Forward *)__pyx_v_self)->handler = ((struct osmhandler_struct *)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":4
 * 
 * # Helper functions, call the appropriate methods of the associated osmhandler
 * cdef public inline int c_init_callback(Base handler, c_Meta &curmeta) except -1:             # <<<<<<<<<<<<<<
 *     cdef Meta pymeta = Meta()
 *     pymeta.set_from_c(curmeta)
 */

CYTHON_INLINE int c_init_callback(struct osmhandler_struct *__pyx_v_handler, Osmium::OSM::Meta &__pyx_v_curmeta) {
  struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_pymeta = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_init_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":5
 * # Helper functions, call the appropriate methods of the associated osmhandler
 * cdef public inline int c_init_callback(Base handler, c_Meta &curmeta) except -1:
 *     cdef Meta pymeta = Meta()             # <<<<<<<<<<<<<<
 *     pymeta.set_from_c(curmeta)
 *     handler.init(pymeta)
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Meta)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pymeta = ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":6
 * cdef public inline int c_init_callback(Base handler, c_Meta &curmeta) except -1:
 *     cdef Meta pymeta = Meta()
 *     pymeta.set_from_c(curmeta)             # <<<<<<<<<<<<<<
 *     handler.init(pymeta)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_3osm_Meta *)__pyx_v_pymeta->__pyx_vtab)->set_from_c(__pyx_v_pymeta, __pyx_v_curmeta); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":7
 *     cdef Meta pymeta = Meta()
 *     pymeta.set_from_c(curmeta)
 *     handler.init(pymeta)             # <<<<<<<<<<<<<<
 * 
 * cdef public inline int c_before_nodes_callback(Base handler) except -1:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->init(__pyx_v_handler, __pyx_v_pymeta, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_init_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_pymeta);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":9
 *     handler.init(pymeta)
 * 
 * cdef public inline int c_before_nodes_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.before_nodes()
 * cdef public inline int c_after_nodes_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_before_nodes_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_before_nodes_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":10
 * 
 * cdef public inline int c_before_nodes_callback(Base handler) except -1:
 *     handler.before_nodes()             # <<<<<<<<<<<<<<
 * cdef public inline int c_after_nodes_callback(Base handler) except -1:
 *     handler.after_nodes()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->before_nodes(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_before_nodes_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":11
 * cdef public inline int c_before_nodes_callback(Base handler) except -1:
 *     handler.before_nodes()
 * cdef public inline int c_after_nodes_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.after_nodes()
 * cdef public inline int c_before_ways_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_after_nodes_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_after_nodes_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":12
 *     handler.before_nodes()
 * cdef public inline int c_after_nodes_callback(Base handler) except -1:
 *     handler.after_nodes()             # <<<<<<<<<<<<<<
 * cdef public inline int c_before_ways_callback(Base handler) except -1:
 *     handler.before_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->after_nodes(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_after_nodes_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":13
 * cdef public inline int c_after_nodes_callback(Base handler) except -1:
 *     handler.after_nodes()
 * cdef public inline int c_before_ways_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.before_ways()
 * cdef public inline int c_after_ways_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_before_ways_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_before_ways_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":14
 *     handler.after_nodes()
 * cdef public inline int c_before_ways_callback(Base handler) except -1:
 *     handler.before_ways()             # <<<<<<<<<<<<<<
 * cdef public inline int c_after_ways_callback(Base handler) except -1:
 *     handler.after_ways()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->before_ways(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_before_ways_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":15
 * cdef public inline int c_before_ways_callback(Base handler) except -1:
 *     handler.before_ways()
 * cdef public inline int c_after_ways_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.after_ways()
 * cdef public inline int c_before_relations_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_after_ways_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_after_ways_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":16
 *     handler.before_ways()
 * cdef public inline int c_after_ways_callback(Base handler) except -1:
 *     handler.after_ways()             # <<<<<<<<<<<<<<
 * cdef public inline int c_before_relations_callback(Base handler) except -1:
 *     handler.before_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->after_ways(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 16; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_after_ways_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":17
 * cdef public inline int c_after_ways_callback(Base handler) except -1:
 *     handler.after_ways()
 * cdef public inline int c_before_relations_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.before_relations()
 * cdef public inline int c_after_relations_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_before_relations_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_before_relations_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":18
 *     handler.after_ways()
 * cdef public inline int c_before_relations_callback(Base handler) except -1:
 *     handler.before_relations()             # <<<<<<<<<<<<<<
 * cdef public inline int c_after_relations_callback(Base handler) except -1:
 *     handler.after_relations()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->before_relations(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_before_relations_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":19
 * cdef public inline int c_before_relations_callback(Base handler) except -1:
 *     handler.before_relations()
 * cdef public inline int c_after_relations_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.after_relations()
 * cdef public inline int c_final_callback(Base handler) except -1:
 */

CYTHON_INLINE int c_after_relations_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_after_relations_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":20
 *     handler.before_relations()
 * cdef public inline int c_after_relations_callback(Base handler) except -1:
 *     handler.after_relations()             # <<<<<<<<<<<<<<
 * cdef public inline int c_final_callback(Base handler) except -1:
 *     handler.final()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->after_relations(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_after_relations_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":21
 * cdef public inline int c_after_relations_callback(Base handler) except -1:
 *     handler.after_relations()
 * cdef public inline int c_final_callback(Base handler) except -1:             # <<<<<<<<<<<<<<
 *     handler.final()
 * 
 */

CYTHON_INLINE int c_final_callback(struct osmhandler_struct *__pyx_v_handler) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_final_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":22
 *     handler.after_relations()
 * cdef public inline int c_final_callback(Base handler) except -1:
 *     handler.final()             # <<<<<<<<<<<<<<
 * 
 * cdef public inline int c_node_callback(Base handler, ConstNodePtr &node) except -1:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->final(__pyx_v_handler, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("osmium.handler.c_final_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":24
 *     handler.final()
 * 
 * cdef public inline int c_node_callback(Base handler, ConstNodePtr &node) except -1:             # <<<<<<<<<<<<<<
 *     global _cache_node, _cache_taglist
 * 
 */

CYTHON_INLINE int c_node_callback(struct osmhandler_struct *__pyx_v_handler, const shared_ptr<const Osmium::OSM::Node> &__pyx_v_node) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_node_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":27
 *     global _cache_node, _cache_taglist
 * 
 *     _cache_node.c_object[0] = node             # <<<<<<<<<<<<<<
 *     handler.node(_cache_node)
 * 
 */
  (__pyx_v_6osmium_3osm__cache_node->__pyx_base.c_object[0]) = __pyx_v_node;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":28
 * 
 *     _cache_node.c_object[0] = node
 *     handler.node(_cache_node)             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_node).ob_refcnt == 1:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_6osmium_3osm__cache_node);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->node(__pyx_v_handler, ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":30
 *     handler.node(_cache_node)
 * 
 *     if (<PyObject*>_cache_node).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_node.c_object.reset()
 *     else:
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_node)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":31
 * 
 *     if (<PyObject*>_cache_node).ob_refcnt == 1:
 *         _cache_node.c_object.reset()             # <<<<<<<<<<<<<<
 *     else:
 *         _cache_node = Node()
 */
    __pyx_v_6osmium_3osm__cache_node->__pyx_base.c_object->reset();
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":33
 *         _cache_node.c_object.reset()
 *     else:
 *         _cache_node = Node()             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Node)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_node));
    __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_node));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_v_6osmium_3osm__cache_node = ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":35
 *         _cache_node = Node()
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_taglist.c_object.reset()
 * 
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_taglist)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":36
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 *         _cache_taglist.c_object.reset()             # <<<<<<<<<<<<<<
 * 
 * cdef public inline int c_way_callback(Base handler, ConstWayPtr &way) except -1:
 */
    __pyx_v_6osmium_3osm__cache_taglist->c_object->reset();
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.c_node_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":38
 *         _cache_taglist.c_object.reset()
 * 
 * cdef public inline int c_way_callback(Base handler, ConstWayPtr &way) except -1:             # <<<<<<<<<<<<<<
 *     global _cache_way, _cache_taglist, _cache_waynodelist
 * 
 */

CYTHON_INLINE int c_way_callback(struct osmhandler_struct *__pyx_v_handler, const shared_ptr<const Osmium::OSM::Way> &__pyx_v_way) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_way_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":41
 *     global _cache_way, _cache_taglist, _cache_waynodelist
 * 
 *     _cache_way.c_object[0] = way             # <<<<<<<<<<<<<<
 *     handler.way(_cache_way)
 * 
 */
  (__pyx_v_6osmium_3osm__cache_way->__pyx_base.c_object[0]) = __pyx_v_way;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":42
 * 
 *     _cache_way.c_object[0] = way
 *     handler.way(_cache_way)             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_way).ob_refcnt == 1:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_6osmium_3osm__cache_way);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->way(__pyx_v_handler, ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":44
 *     handler.way(_cache_way)
 * 
 *     if (<PyObject*>_cache_way).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_way.c_object.reset()
 *     else:
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_way)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":45
 * 
 *     if (<PyObject*>_cache_way).ob_refcnt == 1:
 *         _cache_way.c_object.reset()             # <<<<<<<<<<<<<<
 *     else:
 *         _cache_way = Way()
 */
    __pyx_v_6osmium_3osm__cache_way->__pyx_base.c_object->reset();
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":47
 *         _cache_way.c_object.reset()
 *     else:
 *         _cache_way = Way()             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Way)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_way));
    __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_way));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_v_6osmium_3osm__cache_way = ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":49
 *         _cache_way = Way()
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_taglist.c_object.reset()
 * 
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_taglist)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":50
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 *         _cache_taglist.c_object.reset()             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_waynodelist).ob_refcnt == 1:
 */
    __pyx_v_6osmium_3osm__cache_taglist->c_object->reset();
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":52
 *         _cache_taglist.c_object.reset()
 * 
 *     if (<PyObject*>_cache_waynodelist).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_waynodelist.c_way.reset()
 * 
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":53
 * 
 *     if (<PyObject*>_cache_waynodelist).ob_refcnt == 1:
 *         _cache_waynodelist.c_way.reset()             # <<<<<<<<<<<<<<
 * 
 * cdef public inline int c_relation_callback(Base handler, ConstRelationPtr &rel) except -1:
 */
    __pyx_v_6osmium_3osm__cache_waynodelist->c_way->reset();
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.c_way_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":55
 *         _cache_waynodelist.c_way.reset()
 * 
 * cdef public inline int c_relation_callback(Base handler, ConstRelationPtr &rel) except -1:             # <<<<<<<<<<<<<<
 *     global _cache_relation, _cache_taglist, _cache_relationmemberlist
 * 
 */

CYTHON_INLINE int c_relation_callback(struct osmhandler_struct *__pyx_v_handler, const shared_ptr<const Osmium::OSM::Relation> &__pyx_v_rel) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("c_relation_callback");

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":58
 *     global _cache_relation, _cache_taglist, _cache_relationmemberlist
 * 
 *     _cache_relation.c_object[0] = rel             # <<<<<<<<<<<<<<
 *     handler.relation(_cache_relation)
 * 
 */
  (__pyx_v_6osmium_3osm__cache_relation->__pyx_base.c_object[0]) = __pyx_v_rel;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":59
 * 
 *     _cache_relation.c_object[0] = rel
 *     handler.relation(_cache_relation)             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_relation).ob_refcnt == 1:
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_6osmium_3osm__cache_relation);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_6osmium_7handler_Base *)__pyx_v_handler->__pyx_vtab)->relation(__pyx_v_handler, ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":61
 *     handler.relation(_cache_relation)
 * 
 *     if (<PyObject*>_cache_relation).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_relation.c_object.reset()
 *     else:
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_relation)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":62
 * 
 *     if (<PyObject*>_cache_relation).ob_refcnt == 1:
 *         _cache_relation.c_object.reset()             # <<<<<<<<<<<<<<
 *     else:
 *         _cache_relation = Relation()
 */
    __pyx_v_6osmium_3osm__cache_relation->__pyx_base.c_object->reset();
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":64
 *         _cache_relation.c_object.reset()
 *     else:
 *         _cache_relation = Relation()             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Relation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relation));
    __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relation));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_v_6osmium_3osm__cache_relation = ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":66
 *         _cache_relation = Relation()
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_taglist.c_object.reset()
 * 
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_taglist)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":67
 * 
 *     if (<PyObject*>_cache_taglist).ob_refcnt == 1:
 *         _cache_taglist.c_object.reset()             # <<<<<<<<<<<<<<
 * 
 *     if (<PyObject*>_cache_relationmemberlist).ob_refcnt == 1:
 */
    __pyx_v_6osmium_3osm__cache_taglist->c_object->reset();
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":69
 *         _cache_taglist.c_object.reset()
 * 
 *     if (<PyObject*>_cache_relationmemberlist).ob_refcnt == 1:             # <<<<<<<<<<<<<<
 *         _cache_relationmemberlist.c_relation.reset()
 */
  __pyx_t_3 = (((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist)->ob_refcnt == 1);
  if (__pyx_t_3) {

    /* "/home/johannes/proj/2012/osm/progs/osmium/pyosm/osmium/handler_callback_impl.pxi":70
 * 
 *     if (<PyObject*>_cache_relationmemberlist).ob_refcnt == 1:
 *         _cache_relationmemberlist.c_relation.reset()             # <<<<<<<<<<<<<<
 */
    __pyx_v_6osmium_3osm__cache_relationmemberlist->c_relation->reset();
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.handler.c_relation_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6osmium_7handler_StopReading(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_ptype_6osmium_7handler_Exception->tp_new(t, a, k);
  if (!o) return 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_StopReading(PyObject *o) {
  __pyx_ptype_6osmium_7handler_Exception->tp_dealloc(o);
}

static PyMethodDef __pyx_methods_6osmium_7handler_StopReading[] = {
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_StopReading = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_StopReading = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StopReading = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_StopReading = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

DL_EXPORT(PyTypeObject) StopReading_type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.StopReading"), /*tp_name*/
  sizeof(struct StopReading_struct), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_StopReading, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_StopReading, /*tp_as_number*/
  &__pyx_tp_as_sequence_StopReading, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StopReading, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_StopReading, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("raise this exception to immediately stop reading the input file\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_StopReading, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_StopReading, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6osmium_7handler_Base __pyx_vtable_6osmium_7handler_Base;

static PyObject *__pyx_tp_new_6osmium_7handler_Base(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct osmhandler_struct *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct osmhandler_struct *)o);
  p->__pyx_vtab = __pyx_vtabptr_6osmium_7handler_Base;
  p->cur_node = ((struct __pyx_obj_6osmium_3osm_Node *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_Base(PyObject *o) {
  struct osmhandler_struct *p = (struct osmhandler_struct *)o;
  Py_XDECREF(((PyObject *)p->cur_node));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6osmium_7handler_Base(PyObject *o, visitproc v, void *a) {
  int e;
  struct osmhandler_struct *p = (struct osmhandler_struct *)o;
  if (p->cur_node) {
    e = (*v)(((PyObject*)p->cur_node), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_7handler_Base(PyObject *o) {
  struct osmhandler_struct *p = (struct osmhandler_struct *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->cur_node);
  p->cur_node = ((struct __pyx_obj_6osmium_3osm_Node *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6osmium_7handler_Base[] = {
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_1init, METH_O, __Pyx_DOCSTR(__pyx_doc_6osmium_7handler_4Base_1init)},
  {__Pyx_NAMESTR("before_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_2before_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("node"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_3node, METH_O, __Pyx_DOCSTR(__pyx_doc_6osmium_7handler_4Base_3node)},
  {__Pyx_NAMESTR("after_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_4after_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_5before_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("way"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_6way, METH_O, __Pyx_DOCSTR(__pyx_doc_6osmium_7handler_4Base_6way)},
  {__Pyx_NAMESTR("after_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_7after_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_8before_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("relation"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_9relation, METH_O, __Pyx_DOCSTR(__pyx_doc_6osmium_7handler_4Base_9relation)},
  {__Pyx_NAMESTR("after_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_10after_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("final"), (PyCFunction)__pyx_pf_6osmium_7handler_4Base_11final, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Base = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Base = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Base = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Base = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

DL_EXPORT(PyTypeObject) osmhandler_type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.Base"), /*tp_name*/
  sizeof(struct osmhandler_struct), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_Base, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Base, /*tp_as_number*/
  &__pyx_tp_as_sequence_Base, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Base, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Base, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("base class for python implemented handlers\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_7handler_Base, /*tp_traverse*/
  __pyx_tp_clear_6osmium_7handler_Base, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_Base, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_7handler_4Base___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_Base, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6osmium_7handler_Debug __pyx_vtable_6osmium_7handler_Debug;

static PyObject *__pyx_tp_new_6osmium_7handler_Debug(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_7handler_Debug *p;
  PyObject *o = __pyx_tp_new_6osmium_7handler_Base(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_7handler_Debug *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6osmium_7handler_Base*)__pyx_vtabptr_6osmium_7handler_Debug;
  if (__pyx_pf_6osmium_7handler_5Debug___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_Debug(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_7handler_5Debug_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6osmium_7handler_Base(o);
}

static PyMethodDef __pyx_methods_6osmium_7handler_Debug[] = {
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_3init, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("node"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_4node, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("way"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_5way, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("relation"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_6relation, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_7before_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_8after_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_9before_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_10after_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_11before_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_12after_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("final"), (PyCFunction)__pyx_pf_6osmium_7handler_5Debug_13final, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Debug = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Debug = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Debug = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Debug = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6osmium_7handler_Debug = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.Debug"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_7handler_Debug), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_Debug, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Debug, /*tp_as_number*/
  &__pyx_tp_as_sequence_Debug, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Debug, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Debug, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("fast debug handler\n\n    Dumps information about each callback and about each object to stdout.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_7handler_Base, /*tp_traverse*/
  __pyx_tp_clear_6osmium_7handler_Base, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_Debug, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_7handler_5Debug_2__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_Debug, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6osmium_7handler_Progress __pyx_vtable_6osmium_7handler_Progress;

static PyObject *__pyx_tp_new_6osmium_7handler_Progress(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_7handler_Progress *p;
  PyObject *o = __pyx_tp_new_6osmium_7handler_Base(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_7handler_Progress *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6osmium_7handler_Base*)__pyx_vtabptr_6osmium_7handler_Progress;
  if (__pyx_pf_6osmium_7handler_8Progress___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_Progress(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_7handler_8Progress_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  __pyx_tp_dealloc_6osmium_7handler_Base(o);
}

static PyMethodDef __pyx_methods_6osmium_7handler_Progress[] = {
  {__Pyx_NAMESTR("hide_cursor"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_3hide_cursor, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("show_cursor"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_4show_cursor, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_5init, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("node"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_6node, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("way"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_7way, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("relation"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_8relation, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("final"), (PyCFunction)__pyx_pf_6osmium_7handler_8Progress_9final, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Progress = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Progress = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Progress = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Progress = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6osmium_7handler_Progress = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.Progress"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_7handler_Progress), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_Progress, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Progress, /*tp_as_number*/
  &__pyx_tp_as_sequence_Progress, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Progress, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Progress, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Progress  \n        Simple handler that shows progress on terminal by counting\n        the number of nodes, ways, and relations already read and\n        printing those counts to stdout.\n         \n        If stdout is not a terminal, nothing is printed.\n         \n        Note that this handler will hide the cursor. If the program\n        is terminated before the final handler is called, it will not\n        be re-activated. Call show_cursor() from an interrupt\n        handler or similar, to do this properly.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_7handler_Base, /*tp_traverse*/
  __pyx_tp_clear_6osmium_7handler_Base, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_Progress, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_7handler_8Progress_2__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_Progress, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6osmium_7handler_Tee __pyx_vtable_6osmium_7handler_Tee;

static PyObject *__pyx_tp_new_6osmium_7handler_Tee(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_7handler_Tee *p;
  PyObject *o = __pyx_tp_new_6osmium_7handler_Base(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_7handler_Tee *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6osmium_7handler_Base*)__pyx_vtabptr_6osmium_7handler_Tee;
  p->handler1 = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  p->handler2 = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_Tee(PyObject *o) {
  struct __pyx_obj_6osmium_7handler_Tee *p = (struct __pyx_obj_6osmium_7handler_Tee *)o;
  Py_XDECREF(((PyObject *)p->handler1));
  Py_XDECREF(((PyObject *)p->handler2));
  __pyx_tp_dealloc_6osmium_7handler_Base(o);
}

static int __pyx_tp_traverse_6osmium_7handler_Tee(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_7handler_Tee *p = (struct __pyx_obj_6osmium_7handler_Tee *)o;
  e = __pyx_tp_traverse_6osmium_7handler_Base(o, v, a); if (e) return e;
  if (p->handler1) {
    e = (*v)(((PyObject*)p->handler1), a); if (e) return e;
  }
  if (p->handler2) {
    e = (*v)(((PyObject*)p->handler2), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_7handler_Tee(PyObject *o) {
  struct __pyx_obj_6osmium_7handler_Tee *p = (struct __pyx_obj_6osmium_7handler_Tee *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_7handler_Base(o);
  tmp = ((PyObject*)p->handler1);
  p->handler1 = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->handler2);
  p->handler2 = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6osmium_7handler_3Tee_handler1(PyObject *o, void *x) {
  return __pyx_pf_6osmium_7handler_3Tee_8handler1___get__(o);
}

static int __pyx_setprop_6osmium_7handler_3Tee_handler1(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6osmium_7handler_3Tee_8handler1_1__set__(o, v);
  }
  else {
    return __pyx_pf_6osmium_7handler_3Tee_8handler1_2__del__(o);
  }
}

static PyObject *__pyx_getprop_6osmium_7handler_3Tee_handler2(PyObject *o, void *x) {
  return __pyx_pf_6osmium_7handler_3Tee_8handler2___get__(o);
}

static int __pyx_setprop_6osmium_7handler_3Tee_handler2(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6osmium_7handler_3Tee_8handler2_1__set__(o, v);
  }
  else {
    return __pyx_pf_6osmium_7handler_3Tee_8handler2_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6osmium_7handler_Tee[] = {
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_1init, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("node"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_2node, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("way"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_3way, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("relation"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_4relation, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_5before_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_6after_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_7before_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_8after_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_9before_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_10after_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("final"), (PyCFunction)__pyx_pf_6osmium_7handler_3Tee_11final, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6osmium_7handler_Tee[] = {
  {(char *)"handler1", __pyx_getprop_6osmium_7handler_3Tee_handler1, __pyx_setprop_6osmium_7handler_3Tee_handler1, 0, 0},
  {(char *)"handler2", __pyx_getprop_6osmium_7handler_3Tee_handler2, __pyx_setprop_6osmium_7handler_3Tee_handler2, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Tee = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Tee = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Tee = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Tee = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6osmium_7handler_Tee = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.Tee"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_7handler_Tee), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_Tee, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Tee, /*tp_as_number*/
  &__pyx_tp_as_sequence_Tee, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Tee, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Tee, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Tee\n    Passes events to two handlers\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_7handler_Tee, /*tp_traverse*/
  __pyx_tp_clear_6osmium_7handler_Tee, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_Tee, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_7handler_Tee, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_7handler_3Tee___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_Tee, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};
static struct __pyx_vtabstruct_6osmium_7handler_Forward __pyx_vtable_6osmium_7handler_Forward;

static PyObject *__pyx_tp_new_6osmium_7handler_Forward(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_7handler_Forward *p;
  PyObject *o = __pyx_tp_new_6osmium_7handler_Base(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_7handler_Forward *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6osmium_7handler_Base*)__pyx_vtabptr_6osmium_7handler_Forward;
  p->handler = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6osmium_7handler_Forward(PyObject *o) {
  struct __pyx_obj_6osmium_7handler_Forward *p = (struct __pyx_obj_6osmium_7handler_Forward *)o;
  Py_XDECREF(((PyObject *)p->handler));
  __pyx_tp_dealloc_6osmium_7handler_Base(o);
}

static int __pyx_tp_traverse_6osmium_7handler_Forward(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_7handler_Forward *p = (struct __pyx_obj_6osmium_7handler_Forward *)o;
  e = __pyx_tp_traverse_6osmium_7handler_Base(o, v, a); if (e) return e;
  if (p->handler) {
    e = (*v)(((PyObject*)p->handler), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_7handler_Forward(PyObject *o) {
  struct __pyx_obj_6osmium_7handler_Forward *p = (struct __pyx_obj_6osmium_7handler_Forward *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_7handler_Base(o);
  tmp = ((PyObject*)p->handler);
  p->handler = ((struct osmhandler_struct *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6osmium_7handler_7Forward_handler(PyObject *o, void *x) {
  return __pyx_pf_6osmium_7handler_7Forward_7handler___get__(o);
}

static int __pyx_setprop_6osmium_7handler_7Forward_handler(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6osmium_7handler_7Forward_7handler_1__set__(o, v);
  }
  else {
    return __pyx_pf_6osmium_7handler_7Forward_7handler_2__del__(o);
  }
}

static PyMethodDef __pyx_methods_6osmium_7handler_Forward[] = {
  {__Pyx_NAMESTR("init"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_1init, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("node"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_2node, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("way"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_3way, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("relation"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_4relation, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_5before_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_nodes"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_6after_nodes, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_7before_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_ways"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_8after_ways, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("before_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_9before_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("after_relations"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_10after_relations, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("final"), (PyCFunction)__pyx_pf_6osmium_7handler_7Forward_11final, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6osmium_7handler_Forward[] = {
  {(char *)"handler", __pyx_getprop_6osmium_7handler_7Forward_handler, __pyx_setprop_6osmium_7handler_7Forward_handler, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Forward = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Forward = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Forward = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Forward = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

static PyTypeObject __pyx_type_6osmium_7handler_Forward = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.handler.Forward"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_7handler_Forward), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_7handler_Forward, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  0, /*tp_repr*/
  &__pyx_tp_as_number_Forward, /*tp_as_number*/
  &__pyx_tp_as_sequence_Forward, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Forward, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Forward, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Forward\n    This handler forwards all calls to another handler.\n    Use this as a base for your handler instead of Base() if you want calls\n    forwarded by default.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_7handler_Forward, /*tp_traverse*/
  __pyx_tp_clear_6osmium_7handler_Forward, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_7handler_Forward, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_7handler_Forward, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_7handler_7Forward___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_7handler_Forward, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("handler"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s__after_nodes, __pyx_k__after_nodes, sizeof(__pyx_k__after_nodes), 0, 0, 1, 1},
  {&__pyx_n_s__after_relations, __pyx_k__after_relations, sizeof(__pyx_k__after_relations), 0, 0, 1, 1},
  {&__pyx_n_s__after_ways, __pyx_k__after_ways, sizeof(__pyx_k__after_ways), 0, 0, 1, 1},
  {&__pyx_n_s__before_nodes, __pyx_k__before_nodes, sizeof(__pyx_k__before_nodes), 0, 0, 1, 1},
  {&__pyx_n_s__before_relations, __pyx_k__before_relations, sizeof(__pyx_k__before_relations), 0, 0, 1, 1},
  {&__pyx_n_s__before_ways, __pyx_k__before_ways, sizeof(__pyx_k__before_ways), 0, 0, 1, 1},
  {&__pyx_n_s__final, __pyx_k__final, sizeof(__pyx_k__final), 0, 0, 1, 1},
  {&__pyx_n_s__handler, __pyx_k__handler, sizeof(__pyx_k__handler), 0, 0, 1, 1},
  {&__pyx_n_s__handler1, __pyx_k__handler1, sizeof(__pyx_k__handler1), 0, 0, 1, 1},
  {&__pyx_n_s__handler2, __pyx_k__handler2, sizeof(__pyx_k__handler2), 0, 0, 1, 1},
  {&__pyx_n_s__hide_cursor, __pyx_k__hide_cursor, sizeof(__pyx_k__hide_cursor), 0, 0, 1, 1},
  {&__pyx_n_s__init, __pyx_k__init, sizeof(__pyx_k__init), 0, 0, 1, 1},
  {&__pyx_n_s__node, __pyx_k__node, sizeof(__pyx_k__node), 0, 0, 1, 1},
  {&__pyx_n_s__relation, __pyx_k__relation, sizeof(__pyx_k__relation), 0, 0, 1, 1},
  {&__pyx_n_s__show_cursor, __pyx_k__show_cursor, sizeof(__pyx_k__show_cursor), 0, 0, 1, 1},
  {&__pyx_n_s__step, __pyx_k__step, sizeof(__pyx_k__step), 0, 0, 1, 1},
  {&__pyx_n_s__way, __pyx_k__way, sizeof(__pyx_k__way), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  return 0;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC inithandler(void); /*proto*/
PyMODINIT_FUNC inithandler(void)
#else
PyMODINIT_FUNC PyInit_handler(void); /*proto*/
PyMODINIT_FUNC PyInit_handler(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_handler(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __pyx_binding_PyCFunctionType_USED
  if (__pyx_binding_PyCFunctionType_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("handler"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_osmium__handler) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_ptype_6osmium_7handler_Exception = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "Exception", sizeof(PyBaseExceptionObject), 0); if (unlikely(!__pyx_ptype_6osmium_7handler_Exception)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  StopReading_type.tp_base = __pyx_ptype_6osmium_7handler_Exception;
  if (PyType_Ready(&StopReading_type) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "StopReading", (PyObject *)&StopReading_type) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_StopReading = &StopReading_type;
  __pyx_vtabptr_6osmium_7handler_Base = &__pyx_vtable_6osmium_7handler_Base;
  __pyx_vtable_6osmium_7handler_Base.handle_infile = (PyObject *(*)(struct osmhandler_struct *, Osmium::OSMFile *))__pyx_f_6osmium_7handler_4Base_handle_infile;
  __pyx_vtable_6osmium_7handler_Base.init = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_init;
  __pyx_vtable_6osmium_7handler_Base.before_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_before_nodes;
  __pyx_vtable_6osmium_7handler_Base.node = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_node;
  __pyx_vtable_6osmium_7handler_Base.after_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_after_nodes;
  __pyx_vtable_6osmium_7handler_Base.before_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_before_ways;
  __pyx_vtable_6osmium_7handler_Base.way = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_way;
  __pyx_vtable_6osmium_7handler_Base.after_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_after_ways;
  __pyx_vtable_6osmium_7handler_Base.before_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_before_relations;
  __pyx_vtable_6osmium_7handler_Base.relation = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_relation;
  __pyx_vtable_6osmium_7handler_Base.after_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_after_relations;
  __pyx_vtable_6osmium_7handler_Base.final = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_4Base_final;
  if (PyType_Ready(&osmhandler_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(osmhandler_type.tp_dict, __pyx_vtabptr_6osmium_7handler_Base) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Base", (PyObject *)&osmhandler_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_Base = &osmhandler_type;
  __pyx_vtabptr_6osmium_7handler_Debug = &__pyx_vtable_6osmium_7handler_Debug;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base = *__pyx_vtabptr_6osmium_7handler_Base;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.handle_infile = (PyObject *(*)(struct osmhandler_struct *, Osmium::OSMFile *))__pyx_f_6osmium_7handler_5Debug_handle_infile;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.init = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_init;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.before_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_before_nodes;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.node = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_node;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.after_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_after_nodes;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.before_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_before_ways;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.way = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_way;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.after_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_after_ways;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.before_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_before_relations;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.relation = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_relation;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.after_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_after_relations;
  __pyx_vtable_6osmium_7handler_Debug.__pyx_base.final = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_5Debug_final;
  __pyx_type_6osmium_7handler_Debug.tp_base = __pyx_ptype_6osmium_7handler_Base;
  if (PyType_Ready(&__pyx_type_6osmium_7handler_Debug) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6osmium_7handler_Debug.tp_dict, __pyx_vtabptr_6osmium_7handler_Debug) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Debug", (PyObject *)&__pyx_type_6osmium_7handler_Debug) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_Debug = &__pyx_type_6osmium_7handler_Debug;
  __pyx_vtabptr_6osmium_7handler_Progress = &__pyx_vtable_6osmium_7handler_Progress;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base = *__pyx_vtabptr_6osmium_7handler_Base;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.handle_infile = (PyObject *(*)(struct osmhandler_struct *, Osmium::OSMFile *))__pyx_f_6osmium_7handler_8Progress_handle_infile;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.init = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_init;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.node = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_node;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.way = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_way;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.relation = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_relation;
  __pyx_vtable_6osmium_7handler_Progress.__pyx_base.final = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_final;
  __pyx_vtable_6osmium_7handler_Progress.hide_cursor = (PyObject *(*)(struct __pyx_obj_6osmium_7handler_Progress *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_hide_cursor;
  __pyx_vtable_6osmium_7handler_Progress.show_cursor = (PyObject *(*)(struct __pyx_obj_6osmium_7handler_Progress *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_8Progress_show_cursor;
  __pyx_type_6osmium_7handler_Progress.tp_base = __pyx_ptype_6osmium_7handler_Base;
  if (PyType_Ready(&__pyx_type_6osmium_7handler_Progress) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6osmium_7handler_Progress.tp_dict, __pyx_vtabptr_6osmium_7handler_Progress) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Progress", (PyObject *)&__pyx_type_6osmium_7handler_Progress) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_Progress = &__pyx_type_6osmium_7handler_Progress;
  __pyx_vtabptr_6osmium_7handler_Tee = &__pyx_vtable_6osmium_7handler_Tee;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base = *__pyx_vtabptr_6osmium_7handler_Base;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.init = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_init;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.before_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_before_nodes;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.node = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_node;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.after_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_after_nodes;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.before_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_before_ways;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.way = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_way;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.after_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_after_ways;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.before_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_before_relations;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.relation = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_relation;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.after_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_after_relations;
  __pyx_vtable_6osmium_7handler_Tee.__pyx_base.final = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_3Tee_final;
  __pyx_type_6osmium_7handler_Tee.tp_base = __pyx_ptype_6osmium_7handler_Base;
  if (PyType_Ready(&__pyx_type_6osmium_7handler_Tee) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6osmium_7handler_Tee.tp_dict, __pyx_vtabptr_6osmium_7handler_Tee) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Tee", (PyObject *)&__pyx_type_6osmium_7handler_Tee) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_Tee = &__pyx_type_6osmium_7handler_Tee;
  __pyx_vtabptr_6osmium_7handler_Forward = &__pyx_vtable_6osmium_7handler_Forward;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base = *__pyx_vtabptr_6osmium_7handler_Base;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.init = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Meta *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_init;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.before_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_before_nodes;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.node = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Node *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_node;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.after_nodes = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_after_nodes;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.before_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_before_ways;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.way = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Way *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_way;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.after_ways = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_after_ways;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.before_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_before_relations;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.relation = (PyObject *(*)(struct osmhandler_struct *, struct __pyx_obj_6osmium_3osm_Relation *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_relation;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.after_relations = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_after_relations;
  __pyx_vtable_6osmium_7handler_Forward.__pyx_base.final = (PyObject *(*)(struct osmhandler_struct *, int __pyx_skip_dispatch))__pyx_f_6osmium_7handler_7Forward_final;
  __pyx_type_6osmium_7handler_Forward.tp_base = __pyx_ptype_6osmium_7handler_Base;
  if (PyType_Ready(&__pyx_type_6osmium_7handler_Forward) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6osmium_7handler_Forward.tp_dict, __pyx_vtabptr_6osmium_7handler_Forward) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Forward", (PyObject *)&__pyx_type_6osmium_7handler_Forward) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_7handler_Forward = &__pyx_type_6osmium_7handler_Forward;
  /*--- Type import code ---*/
  __pyx_ptype_6osmium_3osm_TagList = __Pyx_ImportType("osmium.osm", "TagList", sizeof(struct __pyx_obj_6osmium_3osm_TagList), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_TagList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 3; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_WayNodeList = __Pyx_ImportType("osmium.osm", "WayNodeList", sizeof(struct __pyx_obj_6osmium_3osm_WayNodeList), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_WayNodeList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_RelationMemberList = __Pyx_ImportType("osmium.osm", "RelationMemberList", sizeof(struct __pyx_obj_6osmium_3osm_RelationMemberList), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_RelationMemberList)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Object = __Pyx_ImportType("osmium.osm", "Object", sizeof(struct __pyx_obj_6osmium_3osm_Object), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Object)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Node = __Pyx_ImportType("osmium.osm", "Node", sizeof(struct __pyx_obj_6osmium_3osm_Node), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Node)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Way = __Pyx_ImportType("osmium.osm", "Way", sizeof(struct __pyx_obj_6osmium_3osm_Way), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Way)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Relation = __Pyx_ImportType("osmium.osm", "Relation", sizeof(struct __pyx_obj_6osmium_3osm_Relation), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Relation)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Bounds = __Pyx_ImportType("osmium.osm", "Bounds", sizeof(struct __pyx_obj_6osmium_3osm_Bounds), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Bounds)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Meta = __Pyx_ImportType("osmium.osm", "Meta", sizeof(struct __pyx_obj_6osmium_3osm_Meta), 1); if (unlikely(!__pyx_ptype_6osmium_3osm_Meta)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_vtabptr_6osmium_3osm_Meta = (struct __pyx_vtabstruct_6osmium_3osm_Meta*)__Pyx_GetVtable(__pyx_ptype_6osmium_3osm_Meta->tp_dict); if (unlikely(!__pyx_vtabptr_6osmium_3osm_Meta)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Variable import code ---*/
  __pyx_t_1 = __Pyx_ImportModule("osmium.osm"); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_node", (void **)&__pyx_vp_6osmium_3osm__cache_node, "struct __pyx_obj_6osmium_3osm_Node *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_way", (void **)&__pyx_vp_6osmium_3osm__cache_way, "struct __pyx_obj_6osmium_3osm_Way *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_relation", (void **)&__pyx_vp_6osmium_3osm__cache_relation, "struct __pyx_obj_6osmium_3osm_Relation *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_taglist", (void **)&__pyx_vp_6osmium_3osm__cache_taglist, "struct __pyx_obj_6osmium_3osm_TagList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_waynodelist", (void **)&__pyx_vp_6osmium_3osm__cache_waynodelist, "struct __pyx_obj_6osmium_3osm_WayNodeList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ImportVoidPtr(__pyx_t_1, "_cache_relationmemberlist", (void **)&__pyx_vp_6osmium_3osm__cache_relationmemberlist, "struct __pyx_obj_6osmium_3osm_RelationMemberList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "osmium/handler.pyx":1
 * # cython: language_level=3             # <<<<<<<<<<<<<<
 * from cpython.ref cimport PyObject
 * from _callback_handler cimport CallbackHandler
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init osmium.handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init osmium.handler");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* Runtime support code */

#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif /* CYTHON_REFNANNY */

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%s() takes %s %"PY_FORMAT_SIZE_T"d positional argument%s (%"PY_FORMAT_SIZE_T"d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #else
        if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key)))
        #endif
            goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (!strict && ((PyTypeObject *)result)->tp_basicsize > (Py_ssize_t)size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility",
            module_name, class_name);
        #if PY_VERSION_HEX < 0x02050000
        if (PyErr_Warn(NULL, warning) < 0) goto bad;
        #else
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
        #endif
    }
    else if (((PyTypeObject *)result)->tp_basicsize != (Py_ssize_t)size) {
        PyErr_Format(PyExc_ValueError,
            "%s.%s has the wrong size, try recompiling",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyMapping_GetItemString(dict, (char *)"__pyx_vtable__");
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

#ifndef __PYX_HAVE_RT_ImportVoidPtr
#define __PYX_HAVE_RT_ImportVoidPtr
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;

    d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
    if (!d)
        goto bad;
    cobj = PyDict_GetItemString(d, name);
    if (!cobj) {
        PyErr_Format(PyExc_ImportError,
            "%s does not export expected C variable %s",
                PyModule_GetName(module), name);
        goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    if (!PyCapsule_IsValid(cobj, sig)) {
        PyErr_Format(PyExc_TypeError,
            "C variable %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
        goto bad;
    }
    *p = PyCapsule_GetPointer(cobj, sig);
#else
    {const char *desc, *s1, *s2;
    desc = (const char *)PyCObject_GetDesc(cobj);
    if (!desc)
        goto bad;
    s1 = desc; s2 = sig;
    while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
    if (*s1 != *s2) {
        PyErr_Format(PyExc_TypeError,
            "C variable %s.%s has wrong signature (expected %s, got %s)",
             PyModule_GetName(module), name, sig, desc);
        goto bad;
    }
    *p = PyCObject_AsVoidPtr(cobj);}
#endif
    if (!(*p))
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(d);
    return -1;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
                               int __pyx_lineno, const char *__pyx_filename) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}

static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
