/* Generated by Cython 0.15.1 on Sun Mar  4 15:11:21 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__osm
#define __PYX_HAVE_API__osmium__osm
#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"
#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[] = {
  "osm.pyx",
};

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args, CYTHON_UNUSED PyObject *kwds);

typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);

/*--- Type declarations ---*/
struct __pyx_obj_6osmium_3osm_TagList;
struct __pyx_obj_6osmium_3osm_WayNodeList;
struct __pyx_obj_6osmium_3osm_Object;
struct __pyx_Generator_object;
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys;
struct __pyx_obj_6osmium_3osm_Node;
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__;
struct __pyx_obj_6osmium_3osm_Meta;
struct __pyx_obj_6osmium_3osm_Relation;
struct __pyx_obj_6osmium_3osm_RelationMemberList;
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values;
struct __pyx_obj_6osmium_3osm_Bounds;
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items;
struct __pyx_obj_6osmium_3osm_Way;
struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__;

/* "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.pyx":154
 *         return tmp[0][num].ref()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeListIterator* it = new c_WayNodeListIterator()
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 */
struct __pyx_Generator_object {
  PyObject_HEAD
  __pyx_generator_body_t body;
  int is_running;
  int resume_label;
  PyObject *exc_type;
  PyObject *exc_value;
  PyObject *exc_traceback;
};


/* "osmium/osm.pyx":277
 *         return res.decode('utf-8')
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys {
  struct __pyx_Generator_object __pyx_base;
  Osmium::OSM::TagList *__pyx_v_c_taglist;
  Osmium::OSM::TagList::iterator *__pyx_v_it;
  PyObject *__pyx_v_self;
};


/* "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/osm.pyx":216
 *         return res
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberListIterator *it = new c_RelationMemberListIterator()
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 */
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ {
  struct __pyx_Generator_object __pyx_base;
  Osmium::OSM::RelationMemberList *__pyx_v_c_ml;
  Osmium::OSM::RelationMemberList::iterator *__pyx_v_it;
  PyObject *__pyx_v_self;
};


/* "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/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/osm.pyx":290
 *         return self.keys()
 * 
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values {
  struct __pyx_Generator_object __pyx_base;
  Osmium::OSM::TagList *__pyx_v_c_taglist;
  Osmium::OSM::TagList::iterator *__pyx_v_it;
  PyObject *__pyx_v_self;
};


/* "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/osm.pyx":299
 *             it.inc()
 * 
 *     def items(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */
struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items {
  struct __pyx_Generator_object __pyx_base;
  Osmium::OSM::TagList *__pyx_v_c_taglist;
  Osmium::OSM::TagList::iterator *__pyx_v_it;
  PyObject *__pyx_v_self;
};


/* "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.pyx":154
 *         return tmp[0][num].ref()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeListIterator* it = new c_WayNodeListIterator()
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 */
struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ {
  struct __pyx_Generator_object __pyx_base;
  Osmium::OSM::WayNodeList *__pyx_v_c_waynodelist;
  Osmium::OSM::WayNodeList::iterator *__pyx_v_it;
  PyObject *__pyx_v_self;
};



/* "osmium/osm.pyx":353
 *         return res
 * 
 * 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;

#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 PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

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*/

#include <string.h>

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_object_id_t(osm_object_id_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_version_t(osm_version_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_changeset_id_t(osm_changeset_id_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_user_id_t(osm_user_id_t);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_time_t(time_t);

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 CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static int __Pyx_check_binary_version(void);

static int __Pyx_ExportVoidPtr(const char *name, void *p, const char *sig); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*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 'libc.stdint' */

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

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

/* 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 PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_Generator = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_scope_struct____iter__ = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_scope_struct_2_keys = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_scope_struct_3_values = 0;
static PyTypeObject *__pyx_ptype_6osmium_3osm___pyx_scope_struct_4_items = 0;
static struct __pyx_obj_6osmium_3osm_Node *__pyx_v_6osmium_3osm__cache_node = 0;
static struct __pyx_obj_6osmium_3osm_Way *__pyx_v_6osmium_3osm__cache_way = 0;
static struct __pyx_obj_6osmium_3osm_Relation *__pyx_v_6osmium_3osm__cache_relation = 0;
static struct __pyx_obj_6osmium_3osm_TagList *__pyx_v_6osmium_3osm__cache_taglist = 0;
static struct __pyx_obj_6osmium_3osm_WayNodeList *__pyx_v_6osmium_3osm__cache_waynodelist = 0;
static struct __pyx_obj_6osmium_3osm_RelationMemberList *__pyx_v_6osmium_3osm__cache_relationmemberlist = 0;
static CYTHON_INLINE Osmium::OSM::Object const* __pyx_f_6osmium_3osm__getOsmObject(const shared_ptr<const Osmium::OSM::Object> *); /*proto*/
static CYTHON_INLINE Osmium::OSM::TagList *__pyx_f_6osmium_3osm__getOsmTagList(const shared_ptr<const Osmium::OSM::Object> *); /*proto*/
static CYTHON_INLINE Osmium::OSM::Node const* __pyx_f_6osmium_3osm__getOsmNode(const shared_ptr<const Osmium::OSM::Object> *); /*proto*/
static CYTHON_INLINE Osmium::OSM::Way const* __pyx_f_6osmium_3osm__getOsmWay(const shared_ptr<const Osmium::OSM::Object> *); /*proto*/
static CYTHON_INLINE Osmium::OSM::WayNodeList *__pyx_f_6osmium_3osm__getOsmWayNodeList(shared_ptr<const Osmium::OSM::Way> *); /*proto*/
static CYTHON_INLINE Osmium::OSM::RelationMemberList *__pyx_f_6osmium_3osm__getOsmRelMemList(const shared_ptr<const Osmium::OSM::Relation> *); /*proto*/
#define __Pyx_MODULE_NAME "osmium.osm"
int __pyx_module_is_main_osmium__osm = 0;

/* Implementation of 'osmium.osm' */
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_chr;
static PyObject *__pyx_builtin_KeyError;
static char __pyx_k_1[] = "invalid ObjectPtr";
static char __pyx_k_2[] = "utf-8";
static char __pyx_k_3[] = "[";
static char __pyx_k_4[] = ", ";
static char __pyx_k_5[] = "]";
static char __pyx_k_6[] = "list index out of range";
static char __pyx_k_9[] = "(";
static char __pyx_k_10[] = ")";
static char __pyx_k_11[] = "{";
  static char __pyx_k_12[] = "'";
  static char __pyx_k_13[] = "': ";
static char __pyx_k_14[] = "}";
static char __pyx_k_16[] = "((";
static char __pyx_k_17[] = "), (";
static char __pyx_k_18[] = "))";
static char __pyx_k_19[] = "{multiple_versions: ";
  static char __pyx_k_20[] = ", bounds: ";
  static char __pyx_k_21[] = "not set";
  static char __pyx_k__chr[] = "chr";
  static char __pyx_k__keys[] = "keys";
  static char __pyx_k__encode[] = "encode";
  static char __pyx_k__defined[] = "defined";
  static char __pyx_k__KeyError[] = "KeyError";
  static char __pyx_k____main__[] = "__main__";
  static char __pyx_k____test__[] = "__test__";
  static char __pyx_k__IndexError[] = "IndexError";
  static PyObject *__pyx_kp_u_1;
  static PyObject *__pyx_kp_s_10;
  static PyObject *__pyx_kp_s_11;
  static PyObject *__pyx_kp_s_12;
  static PyObject *__pyx_kp_s_13;
  static PyObject *__pyx_kp_s_14;
  static PyObject *__pyx_kp_s_16;
  static PyObject *__pyx_kp_s_17;
  static PyObject *__pyx_kp_s_18;
  static PyObject *__pyx_kp_s_19;
  static PyObject *__pyx_kp_s_2;
  static PyObject *__pyx_kp_s_20;
  static PyObject *__pyx_kp_s_21;
  static PyObject *__pyx_kp_s_3;
  static PyObject *__pyx_kp_s_4;
  static PyObject *__pyx_kp_s_5;
  static PyObject *__pyx_kp_s_6;
  static PyObject *__pyx_kp_s_9;
  static PyObject *__pyx_n_s__IndexError;
  static PyObject *__pyx_n_s__KeyError;
  static PyObject *__pyx_n_s____main__;
  static PyObject *__pyx_n_s____test__;
  static PyObject *__pyx_n_s__chr;
  static PyObject *__pyx_n_s__defined;
  static PyObject *__pyx_n_s__encode;
  static PyObject *__pyx_n_s__keys;
  static PyObject *__pyx_k_tuple_7;
  static PyObject *__pyx_k_tuple_8;
  static PyObject *__pyx_k_tuple_15;

/* "osmium/osm.pyx":15
 * 
 * 
 * cdef inline ObjectCPtr _getOsmObject(ConstObjectPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get object pointer from smart pointer and ensure it is not null
 *     """
 */

static CYTHON_INLINE Osmium::OSM::Object const* __pyx_f_6osmium_3osm__getOsmObject(const shared_ptr<const Osmium::OSM::Object> *__pyx_v_ptr) {
  Osmium::OSM::Object const* __pyx_v_retval;
  Osmium::OSM::Object const* __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmObject");

  /* "osmium/osm.pyx":18
 *     """Get object pointer from smart pointer and ensure it is not null
 *     """
 *     cdef ObjectCPtr retval = ptr.get()             # <<<<<<<<<<<<<<
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval
 */
  __pyx_v_retval = __pyx_v_ptr->get();

  /* "osmium/osm.pyx":19
 *     """
 *     cdef ObjectCPtr retval = ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return retval
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_retval != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":20
 *     cdef ObjectCPtr retval = ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval             # <<<<<<<<<<<<<<
 * 
 * cdef inline c_TagList* _getOsmTagList(ConstObjectPtr *ptr) except NULL:
 */
  __pyx_r = __pyx_v_retval;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmObject", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":22
 *     return retval
 * 
 * cdef inline c_TagList* _getOsmTagList(ConstObjectPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get TagList from object pointer
 *     """
 */

static CYTHON_INLINE Osmium::OSM::TagList *__pyx_f_6osmium_3osm__getOsmTagList(const shared_ptr<const Osmium::OSM::Object> *__pyx_v_ptr) {
  Osmium::OSM::Object const* __pyx_v_obj;
  Osmium::OSM::TagList *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmTagList");

  /* "osmium/osm.pyx":25
 *     """Get TagList from object pointer
 *     """
 *     cdef ObjectCPtr obj = ptr.get()             # <<<<<<<<<<<<<<
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_TagList*>(&obj.tags())
 */
  __pyx_v_obj = __pyx_v_ptr->get();

  /* "osmium/osm.pyx":26
 *     """
 *     cdef ObjectCPtr obj = ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return <c_TagList*>(&obj.tags())
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_obj != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":27
 *     cdef ObjectCPtr obj = ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_TagList*>(&obj.tags())             # <<<<<<<<<<<<<<
 * 
 * cdef inline NodeCPtr _getOsmNode(ConstObjectPtr *ptr) except NULL:
 */
  __pyx_r = ((Osmium::OSM::TagList *)(&__pyx_v_obj->tags()));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmTagList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":29
 *     return <c_TagList*>(&obj.tags())
 * 
 * cdef inline NodeCPtr _getOsmNode(ConstObjectPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get object pointer from smart pointer and cast to node pointer
 *     """
 */

static CYTHON_INLINE Osmium::OSM::Node const* __pyx_f_6osmium_3osm__getOsmNode(const shared_ptr<const Osmium::OSM::Object> *__pyx_v_ptr) {
  Osmium::OSM::Node const* __pyx_v_retval;
  Osmium::OSM::Node const* __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmNode");

  /* "osmium/osm.pyx":32
 *     """Get object pointer from smart pointer and cast to node pointer
 *     """
 *     cdef NodeCPtr retval = <NodeCPtr>ptr.get()             # <<<<<<<<<<<<<<
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval
 */
  __pyx_v_retval = ((Osmium::OSM::Node const*)__pyx_v_ptr->get());

  /* "osmium/osm.pyx":33
 *     """
 *     cdef NodeCPtr retval = <NodeCPtr>ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return retval
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_retval != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":34
 *     cdef NodeCPtr retval = <NodeCPtr>ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval             # <<<<<<<<<<<<<<
 * 
 * cdef inline WayCPtr _getOsmWay(ConstObjectPtr *ptr) except NULL:
 */
  __pyx_r = __pyx_v_retval;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmNode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":36
 *     return retval
 * 
 * cdef inline WayCPtr _getOsmWay(ConstObjectPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get object pointer from smart pointer and cast to way pointer
 *     """
 */

static CYTHON_INLINE Osmium::OSM::Way const* __pyx_f_6osmium_3osm__getOsmWay(const shared_ptr<const Osmium::OSM::Object> *__pyx_v_ptr) {
  Osmium::OSM::Way const* __pyx_v_retval;
  Osmium::OSM::Way const* __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmWay");

  /* "osmium/osm.pyx":39
 *     """Get object pointer from smart pointer and cast to way pointer
 *     """
 *     cdef WayCPtr retval = <WayCPtr>ptr.get()             # <<<<<<<<<<<<<<
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval
 */
  __pyx_v_retval = ((Osmium::OSM::Way const*)__pyx_v_ptr->get());

  /* "osmium/osm.pyx":40
 *     """
 *     cdef WayCPtr retval = <WayCPtr>ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return retval
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_retval != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":41
 *     cdef WayCPtr retval = <WayCPtr>ptr.get()
 *     assert retval is not NULL, u"invalid ObjectPtr"
 *     return retval             # <<<<<<<<<<<<<<
 * 
 * cdef inline c_WayNodeList* _getOsmWayNodeList(WayPtr *ptr) except NULL:
 */
  __pyx_r = __pyx_v_retval;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmWay", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":43
 *     return retval
 * 
 * cdef inline c_WayNodeList* _getOsmWayNodeList(WayPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get TagList from object pointer
 *     """
 */

static CYTHON_INLINE Osmium::OSM::WayNodeList *__pyx_f_6osmium_3osm__getOsmWayNodeList(shared_ptr<const Osmium::OSM::Way> *__pyx_v_ptr) {
  Osmium::OSM::Way const* __pyx_v_obj;
  Osmium::OSM::WayNodeList *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmWayNodeList");

  /* "osmium/osm.pyx":46
 *     """Get TagList from object pointer
 *     """
 *     cdef WayCPtr obj = <WayCPtr>ptr.get()             # <<<<<<<<<<<<<<
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_WayNodeList*>(&obj.nodes())
 */
  __pyx_v_obj = ((Osmium::OSM::Way const*)__pyx_v_ptr->get());

  /* "osmium/osm.pyx":47
 *     """
 *     cdef WayCPtr obj = <WayCPtr>ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return <c_WayNodeList*>(&obj.nodes())
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_obj != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":48
 *     cdef WayCPtr obj = <WayCPtr>ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_WayNodeList*>(&obj.nodes())             # <<<<<<<<<<<<<<
 * 
 * cdef inline c_RelationMemberList* _getOsmRelMemList(ConstRelationPtr *ptr) except NULL:
 */
  __pyx_r = ((Osmium::OSM::WayNodeList *)(&__pyx_v_obj->nodes()));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmWayNodeList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":50
 *     return <c_WayNodeList*>(&obj.nodes())
 * 
 * cdef inline c_RelationMemberList* _getOsmRelMemList(ConstRelationPtr *ptr) except NULL:             # <<<<<<<<<<<<<<
 *     """Get object pointer from smart pointer and cast to relation pointer
 *     """
 */

static CYTHON_INLINE Osmium::OSM::RelationMemberList *__pyx_f_6osmium_3osm__getOsmRelMemList(const shared_ptr<const Osmium::OSM::Relation> *__pyx_v_ptr) {
  Osmium::OSM::Relation const* __pyx_v_obj;
  Osmium::OSM::RelationMemberList *__pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_getOsmRelMemList");

  /* "osmium/osm.pyx":53
 *     """Get object pointer from smart pointer and cast to relation pointer
 *     """
 *     cdef RelCPtr obj = <RelCPtr>ptr.get()             # <<<<<<<<<<<<<<
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_RelationMemberList*>(&obj.members())
 */
  __pyx_v_obj = ((Osmium::OSM::Relation const*)__pyx_v_ptr->get());

  /* "osmium/osm.pyx":54
 *     """
 *     cdef RelCPtr obj = <RelCPtr>ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"             # <<<<<<<<<<<<<<
 *     return <c_RelationMemberList*>(&obj.members())
 * 
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!(__pyx_v_obj != NULL))) {
    PyErr_SetObject(PyExc_AssertionError, ((PyObject *)__pyx_kp_u_1));
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "osmium/osm.pyx":55
 *     cdef RelCPtr obj = <RelCPtr>ptr.get()
 *     assert obj is not NULL, u"invalid ObjectPtr"
 *     return <c_RelationMemberList*>(&obj.members())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((Osmium::OSM::RelationMemberList *)(&__pyx_v_obj->members()));
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm._getOsmRelMemList", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":63
 *     Represents a OSM::Object
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_object = new ObjectPtr()
 * 
 */

static int __pyx_pf_6osmium_3osm_6Object___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_6Object___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;

  /* "osmium/osm.pyx":64
 *     """
 *     def __cinit__(self):
 *         self.c_object = new ObjectPtr()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object = new shared_ptr<const Osmium::OSM::Object>();

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

/* "osmium/osm.pyx":66
 *         self.c_object = new ObjectPtr()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_object
 * 
 */

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

  /* "osmium/osm.pyx":67
 * 
 *     def __dealloc__(self):
 *         del self.c_object             # <<<<<<<<<<<<<<
 * 
 *     property o_id:
 */
  delete ((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":70
 * 
 *     property o_id:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).o_id()
 *     property version:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_4o_id___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_4o_id___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":71
 *     property o_id:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).o_id()             # <<<<<<<<<<<<<<
 *     property version:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_osm_object_id_t(__pyx_t_1->id()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.o_id.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":73
 *             return _getOsmObject(self.c_object).o_id()
 *     property version:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).version()
 *     property changeset:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_7version___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_7version___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":74
 *     property version:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).version()             # <<<<<<<<<<<<<<
 *     property changeset:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_osm_version_t(__pyx_t_1->version()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":76
 *             return _getOsmObject(self.c_object).version()
 *     property changeset:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).changeset()
 *     property uid:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_9changeset___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_9changeset___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":77
 *     property changeset:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).changeset()             # <<<<<<<<<<<<<<
 *     property uid:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_osm_changeset_id_t(__pyx_t_1->changeset()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.changeset.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":79
 *             return _getOsmObject(self.c_object).changeset()
 *     property uid:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).uid()
 *     property timestamp:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_3uid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_3uid___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":80
 *     property uid:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).uid()             # <<<<<<<<<<<<<<
 *     property timestamp:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_osm_user_id_t(__pyx_t_1->uid()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.uid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":82
 *             return _getOsmObject(self.c_object).uid()
 *     property timestamp:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).timestamp()
 *     property endtime:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_9timestamp___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_9timestamp___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":83
 *     property timestamp:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).timestamp()             # <<<<<<<<<<<<<<
 *     property endtime:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_time_t(__pyx_t_1->timestamp()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.timestamp.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":85
 *             return _getOsmObject(self.c_object).timestamp()
 *     property endtime:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).endtime()
 *     property user:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_7endtime___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_7endtime___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":86
 *     property endtime:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).endtime()             # <<<<<<<<<<<<<<
 *     property user:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_to_py_time_t(__pyx_t_1->endtime()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.endtime.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":88
 *             return _getOsmObject(self.c_object).endtime()
 *     property user:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return (<char*>_getOsmObject(self.c_object).user()).decode('utf-8')
 *     property visible:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_4user___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_4user___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  char *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":89
 *     property user:
 *         def __get__(self):
 *             return (<char*>_getOsmObject(self.c_object).user()).decode('utf-8')             # <<<<<<<<<<<<<<
 *     property visible:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((char *)__pyx_t_1->user());
  __pyx_t_3 = ((PyObject *)PyUnicode_Decode(__pyx_t_2, strlen(__pyx_t_2), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)__pyx_t_3));
  __pyx_r = ((PyObject *)__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.osm.Object.user.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":91
 *             return (<char*>_getOsmObject(self.c_object).user()).decode('utf-8')
 *     property visible:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmObject(self.c_object).visible()
 *     property tags:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_7visible___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_7visible___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Object const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":92
 *     property visible:
 *         def __get__(self):
 *             return _getOsmObject(self.c_object).visible()             # <<<<<<<<<<<<<<
 *     property tags:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmObject(((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1->visible()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.visible.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":94
 *             return _getOsmObject(self.c_object).visible()
 *     property tags:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             global _cache_taglist
 *             if (<PyObject*>_cache_taglist).ob_refcnt > 1:
 */

static PyObject *__pyx_pf_6osmium_3osm_6Object_4tags___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Object_4tags___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":96
 *         def __get__(self):
 *             global _cache_taglist
 *             if (<PyObject*>_cache_taglist).ob_refcnt > 1:             # <<<<<<<<<<<<<<
 *                 _cache_taglist = TagList()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_6osmium_3osm__cache_taglist)->ob_refcnt > 1);
  if (__pyx_t_1) {

    /* "osmium/osm.pyx":97
 *             global _cache_taglist
 *             if (<PyObject*>_cache_taglist).ob_refcnt > 1:
 *                 _cache_taglist = TagList()             # <<<<<<<<<<<<<<
 * 
 *             _cache_taglist.c_object[0] = self.c_object[0]
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_TagList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_taglist));
    __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_taglist));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_v_6osmium_3osm__cache_taglist = ((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":99
 *                 _cache_taglist = TagList()
 * 
 *             _cache_taglist.c_object[0] = self.c_object[0]             # <<<<<<<<<<<<<<
 *             return _cache_taglist
 * 
 */
  (__pyx_v_6osmium_3osm__cache_taglist->c_object[0]) = (((struct __pyx_obj_6osmium_3osm_Object *)__pyx_v_self)->c_object[0]);

  /* "osmium/osm.pyx":100
 * 
 *             _cache_taglist.c_object[0] = self.c_object[0]
 *             return _cache_taglist             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_6osmium_3osm__cache_taglist));
  __pyx_r = ((PyObject *)__pyx_v_6osmium_3osm__cache_taglist);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Object.tags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":110
 * 
 *     property lon:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmNode(self.c_object).get_lon()
 *     property lat:
 */

static PyObject *__pyx_pf_6osmium_3osm_4Node_3lon___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_4Node_3lon___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Node const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":111
 *     property lon:
 *         def __get__(self):
 *             return _getOsmNode(self.c_object).get_lon()             # <<<<<<<<<<<<<<
 *     property lat:
 *         def __get__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmNode(((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_self)->__pyx_base.c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1->get_lon()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Node.lon.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":113
 *             return _getOsmNode(self.c_object).get_lon()
 *     property lat:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _getOsmNode(self.c_object).get_lat()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_4Node_3lat___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_4Node_3lat___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::Node const* __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":114
 *     property lat:
 *         def __get__(self):
 *             return _getOsmNode(self.c_object).get_lat()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmNode(((struct __pyx_obj_6osmium_3osm_Node *)__pyx_v_self)->__pyx_base.c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1->get_lat()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Node.lat.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":120
 *     """List interface to the NodeList property
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_way = new WayPtr()
 *     def __dealloc__(self):
 */

static int __pyx_pf_6osmium_3osm_11WayNodeList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_11WayNodeList___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;

  /* "osmium/osm.pyx":121
 *     """
 *     def __cinit__(self):
 *         self.c_way = new WayPtr()             # <<<<<<<<<<<<<<
 *     def __dealloc__(self):
 *         del self.c_way
 */
  ((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_v_self)->c_way = new shared_ptr<const Osmium::OSM::Way>();

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

/* "osmium/osm.pyx":122
 *     def __cinit__(self):
 *         self.c_way = new WayPtr()
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_way
 * 
 */

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

  /* "osmium/osm.pyx":123
 *         self.c_way = new WayPtr()
 *     def __dealloc__(self):
 *         del self.c_way             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  delete ((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_v_self)->c_way;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":125
 *         del self.c_way
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return _getOsmWayNodeList(self.c_way).size()
 * 
 */

static Py_ssize_t __pyx_pf_6osmium_3osm_11WayNodeList_2__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6osmium_3osm_11WayNodeList_2__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::WayNodeList *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__");

  /* "osmium/osm.pyx":126
 * 
 *     def __len__(self):
 *         return _getOsmWayNodeList(self.c_way).size()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmWayNodeList(((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_v_self)->c_way); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1->size();
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm.WayNodeList.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":128
 *         return _getOsmWayNodeList(self.c_way).size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeListIterator it
 *         cdef bint first = True
 */

static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_3__str__(PyObject *__pyx_v_self) {
  Osmium::OSM::WayNodeList::iterator __pyx_v_it;
  int __pyx_v_first;
  Osmium::OSM::WayNodeList *__pyx_v_c_waynodelist;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::WayNodeList *__pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__");

  /* "osmium/osm.pyx":130
 *     def __str__(self):
 *         cdef c_WayNodeListIterator it
 *         cdef bint first = True             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 * 
 */
  __pyx_v_first = 1;

  /* "osmium/osm.pyx":131
 *         cdef c_WayNodeListIterator it
 *         cdef bint first = True
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)             # <<<<<<<<<<<<<<
 * 
 *         res = "["
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmWayNodeList(((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_v_self)->c_way); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_waynodelist = __pyx_t_1;

  /* "osmium/osm.pyx":133
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 * 
 *         res = "["             # <<<<<<<<<<<<<<
 *         it = c_waynodelist.begin()
 *         while it != c_waynodelist.end():
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
  __pyx_v_res = ((PyObject *)__pyx_kp_s_3);

  /* "osmium/osm.pyx":134
 * 
 *         res = "["
 *         it = c_waynodelist.begin()             # <<<<<<<<<<<<<<
 *         while it != c_waynodelist.end():
 *             if first:
 */
  __pyx_v_it = __pyx_v_c_waynodelist->begin();

  /* "osmium/osm.pyx":135
 *         res = "["
 *         it = c_waynodelist.begin()
 *         while it != c_waynodelist.end():             # <<<<<<<<<<<<<<
 *             if first:
 *                 first = False
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_it != __pyx_v_c_waynodelist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":136
 *         it = c_waynodelist.begin()
 *         while it != c_waynodelist.end():
 *             if first:             # <<<<<<<<<<<<<<
 *                 first = False
 *             else:
 */
    if (__pyx_v_first) {

      /* "osmium/osm.pyx":137
 *         while it != c_waynodelist.end():
 *             if first:
 *                 first = False             # <<<<<<<<<<<<<<
 *             else:
 *                 res += ', '
 */
      __pyx_v_first = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "osmium/osm.pyx":139
 *                 first = False
 *             else:
 *                 res += ', '             # <<<<<<<<<<<<<<
 * 
 *             res += str(it.deref().ref())
 */
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_res);
      __pyx_v_res = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L7:;

    /* "osmium/osm.pyx":141
 *                 res += ', '
 * 
 *             res += str(it.deref().ref())             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(__pyx_v_it.operator*().ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "osmium/osm.pyx":142
 * 
 *             res += str(it.deref().ref())
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 *         res += ']'
 */
    __pyx_v_it.operator++();
  }

  /* "osmium/osm.pyx":144
 *             it.inc()
 * 
 *         res += ']'             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "osmium/osm.pyx":145
 * 
 *         res += ']'
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, unsigned int num):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("osmium.osm.WayNodeList.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":147
 *         return res
 * 
 *     def __getitem__(self, unsigned int num):             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeList* tmp = _getOsmWayNodeList(self.c_way)
 *         if num >= tmp.size():
 */

static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_num); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_num) {
  unsigned int __pyx_v_num;
  Osmium::OSM::WayNodeList *__pyx_v_tmp;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::WayNodeList *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__");
  assert(__pyx_arg_num); {
    __pyx_v_num = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_num); if (unlikely((__pyx_v_num == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.osm.WayNodeList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "osmium/osm.pyx":148
 * 
 *     def __getitem__(self, unsigned int num):
 *         cdef c_WayNodeList* tmp = _getOsmWayNodeList(self.c_way)             # <<<<<<<<<<<<<<
 *         if num >= tmp.size():
 *             raise IndexError('list index out of range')
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmWayNodeList(((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_v_self)->c_way); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_tmp = __pyx_t_1;

  /* "osmium/osm.pyx":149
 *     def __getitem__(self, unsigned int num):
 *         cdef c_WayNodeList* tmp = _getOsmWayNodeList(self.c_way)
 *         if num >= tmp.size():             # <<<<<<<<<<<<<<
 *             raise IndexError('list index out of range')
 * 
 */
  __pyx_t_2 = (__pyx_v_num >= __pyx_v_tmp->size());
  if (__pyx_t_2) {

    /* "osmium/osm.pyx":150
 *         cdef c_WayNodeList* tmp = _getOsmWayNodeList(self.c_way)
 *         if num >= tmp.size():
 *             raise IndexError('list index out of range')             # <<<<<<<<<<<<<<
 * 
 *         return tmp[0][num].ref()
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":152
 *             raise IndexError('list index out of range')
 * 
 *         return tmp[0][num].ref()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(((__pyx_v_tmp[0])[__pyx_v_num]).ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("osmium.osm.WayNodeList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6osmium_3osm_11WayNodeList_6generator(struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */

/* "osmium/osm.pyx":154
 *         return tmp[0][num].ref()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeListIterator* it = new c_WayNodeListIterator()
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 */

static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_11WayNodeList_5__iter__(PyObject *__pyx_v_self) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__");
  __pyx_cur_scope = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *)__pyx_ptype_6osmium_3osm___pyx_scope_struct____iter__->tp_new(__pyx_ptype_6osmium_3osm___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_base.resume_label = 0;
  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_6osmium_3osm_11WayNodeList_6generator;
  __Pyx_GIVEREF(__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return (PyObject *) __pyx_cur_scope;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6osmium_3osm_11WayNodeList_6generator(struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  Osmium::OSM::WayNodeList *__pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None");
  switch (__pyx_cur_scope->__pyx_base.resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "osmium/osm.pyx":155
 * 
 *     def __iter__(self):
 *         cdef c_WayNodeListIterator* it = new c_WayNodeListIterator()             # <<<<<<<<<<<<<<
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 * 
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::WayNodeList::iterator();

  /* "osmium/osm.pyx":156
 *     def __iter__(self):
 *         cdef c_WayNodeListIterator* it = new c_WayNodeListIterator()
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)             # <<<<<<<<<<<<<<
 * 
 *         it[0] = c_waynodelist.begin()
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmWayNodeList(((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_cur_scope->__pyx_v_self)->c_way); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_c_waynodelist = __pyx_t_1;

  /* "osmium/osm.pyx":158
 *         cdef c_WayNodeList* c_waynodelist = _getOsmWayNodeList(self.c_way)
 * 
 *         it[0] = c_waynodelist.begin()             # <<<<<<<<<<<<<<
 *         while it[0] != c_waynodelist.end():
 *             yield it.deref().ref()
 */
  (__pyx_cur_scope->__pyx_v_it[0]) = __pyx_cur_scope->__pyx_v_c_waynodelist->begin();

  /* "osmium/osm.pyx":159
 * 
 *         it[0] = c_waynodelist.begin()
 *         while it[0] != c_waynodelist.end():             # <<<<<<<<<<<<<<
 *             yield it.deref().ref()
 *             it.inc()
 */
  while (1) {
    __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_it[0]) != __pyx_cur_scope->__pyx_v_c_waynodelist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":160
 *         it[0] = c_waynodelist.begin()
 *         while it[0] != c_waynodelist.end():
 *             yield it.deref().ref()             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(__pyx_cur_scope->__pyx_v_it->operator*().ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_cur_scope->__pyx_base.resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "osmium/osm.pyx":161
 *         while it[0] != c_waynodelist.end():
 *             yield it.deref().ref()
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_cur_scope->__pyx_v_it->operator++();
  }
  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_cur_scope->__pyx_base.resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "osmium/osm.pyx":169
 * 
 *     property nodes:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             global _cache_waynodelist
 *             if (<PyObject*>_cache_waynodelist).ob_refcnt > 1:
 */

static PyObject *__pyx_pf_6osmium_3osm_3Way_5nodes___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_3Way_5nodes___get__(PyObject *__pyx_v_self) {
  struct __pyx_obj_6osmium_3osm_WayNodeList *__pyx_v__cache_taglist = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":171
 *         def __get__(self):
 *             global _cache_waynodelist
 *             if (<PyObject*>_cache_waynodelist).ob_refcnt > 1:             # <<<<<<<<<<<<<<
 *                 _cache_taglist = WayNodeList()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist)->ob_refcnt > 1);
  if (__pyx_t_1) {

    /* "osmium/osm.pyx":172
 *             global _cache_waynodelist
 *             if (<PyObject*>_cache_waynodelist).ob_refcnt > 1:
 *                 _cache_taglist = WayNodeList()             # <<<<<<<<<<<<<<
 * 
 *             _cache_waynodelist.c_way[0] = castWayPtr(self.c_object[0])
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_WayNodeList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v__cache_taglist = ((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":174
 *                 _cache_taglist = WayNodeList()
 * 
 *             _cache_waynodelist.c_way[0] = castWayPtr(self.c_object[0])             # <<<<<<<<<<<<<<
 *             return _cache_waynodelist
 * 
 */
  (__pyx_v_6osmium_3osm__cache_waynodelist->c_way[0]) = boost::static_pointer_cast<const Osmium::OSM::Way>((((struct __pyx_obj_6osmium_3osm_Way *)__pyx_v_self)->__pyx_base.c_object[0]));

  /* "osmium/osm.pyx":175
 * 
 *             _cache_waynodelist.c_way[0] = castWayPtr(self.c_object[0])
 *             return _cache_waynodelist             # <<<<<<<<<<<<<<
 * 
 * cdef class RelationMemberList:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist));
  __pyx_r = ((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Way.nodes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__cache_taglist);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":180
 *     """List interface to the relation members
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_relation = new RelationPtr()
 * 
 */

static int __pyx_pf_6osmium_3osm_18RelationMemberList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_18RelationMemberList___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;

  /* "osmium/osm.pyx":181
 *     """
 *     def __cinit__(self):
 *         self.c_relation = new RelationPtr()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_v_self)->c_relation = new shared_ptr<const Osmium::OSM::Relation>();

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

/* "osmium/osm.pyx":183
 *         self.c_relation = new RelationPtr()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_relation
 * 
 */

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

  /* "osmium/osm.pyx":184
 * 
 *     def __dealloc__(self):
 *         del self.c_relation             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  delete ((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_v_self)->c_relation;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":186
 *         del self.c_relation
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return _getOsmRelMemList(self.c_relation).size()
 * 
 */

static Py_ssize_t __pyx_pf_6osmium_3osm_18RelationMemberList_2__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6osmium_3osm_18RelationMemberList_2__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::RelationMemberList *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__");

  /* "osmium/osm.pyx":187
 * 
 *     def __len__(self):
 *         return _getOsmRelMemList(self.c_relation).size()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, unsigned int num):
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmRelMemList(((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_v_self)->c_relation); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1->size();
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm.RelationMemberList.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":189
 *         return _getOsmRelMemList(self.c_relation).size()
 * 
 *     def __getitem__(self, unsigned int num):             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 *         if num > c_ml.size():
 */

static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_num); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_num) {
  unsigned int __pyx_v_num;
  Osmium::OSM::RelationMemberList *__pyx_v_c_ml;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::RelationMemberList *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__");
  assert(__pyx_arg_num); {
    __pyx_v_num = __Pyx_PyInt_AsUnsignedInt(__pyx_arg_num); if (unlikely((__pyx_v_num == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("osmium.osm.RelationMemberList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "osmium/osm.pyx":190
 * 
 *     def __getitem__(self, unsigned int num):
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)             # <<<<<<<<<<<<<<
 *         if num > c_ml.size():
 *             raise IndexError('list index out of range')
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmRelMemList(((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_v_self)->c_relation); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_ml = __pyx_t_1;

  /* "osmium/osm.pyx":191
 *     def __getitem__(self, unsigned int num):
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 *         if num > c_ml.size():             # <<<<<<<<<<<<<<
 *             raise IndexError('list index out of range')
 *         return (c_ml[0][num].ref(), chr(c_ml[0][num].typ()), (<char*>c_ml[0][num].role()).decode('utf-8'))
 */
  __pyx_t_2 = (__pyx_v_num > __pyx_v_c_ml->size());
  if (__pyx_t_2) {

    /* "osmium/osm.pyx":192
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 *         if num > c_ml.size():
 *             raise IndexError('list index out of range')             # <<<<<<<<<<<<<<
 *         return (c_ml[0][num].ref(), chr(c_ml[0][num].typ()), (<char*>c_ml[0][num].role()).decode('utf-8'))
 * 
 */
    __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":193
 *         if num > c_ml.size():
 *             raise IndexError('list index out of range')
 *         return (c_ml[0][num].ref(), chr(c_ml[0][num].typ()), (<char*>c_ml[0][num].role()).decode('utf-8'))             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(((__pyx_v_c_ml[0])[__pyx_v_num]).ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyInt_FromLong(((__pyx_v_c_ml[0])[__pyx_v_num]).type()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_6 = ((char *)((__pyx_v_c_ml[0])[__pyx_v_num]).role());
  __pyx_t_5 = ((PyObject *)PyUnicode_Decode(__pyx_t_6, strlen(__pyx_t_6), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_INCREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = ((PyObject *)__pyx_t_7);
  __pyx_t_7 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("osmium.osm.RelationMemberList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":195
 *         return (c_ml[0][num].ref(), chr(c_ml[0][num].typ()), (<char*>c_ml[0][num].role()).decode('utf-8'))
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberListIterator it
 *         cdef bint first = True
 */

static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_4__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_4__str__(PyObject *__pyx_v_self) {
  Osmium::OSM::RelationMemberList::iterator __pyx_v_it;
  int __pyx_v_first;
  Osmium::OSM::RelationMemberList *__pyx_v_c_ml;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::RelationMemberList *__pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  char *__pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__");

  /* "osmium/osm.pyx":197
 *     def __str__(self):
 *         cdef c_RelationMemberListIterator it
 *         cdef bint first = True             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 * 
 */
  __pyx_v_first = 1;

  /* "osmium/osm.pyx":198
 *         cdef c_RelationMemberListIterator it
 *         cdef bint first = True
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)             # <<<<<<<<<<<<<<
 * 
 *         res = "["
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmRelMemList(((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_v_self)->c_relation); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_ml = __pyx_t_1;

  /* "osmium/osm.pyx":200
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 * 
 *         res = "["             # <<<<<<<<<<<<<<
 *         it = c_ml.begin()
 *         while it != c_ml.end():
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
  __pyx_v_res = ((PyObject *)__pyx_kp_s_3);

  /* "osmium/osm.pyx":201
 * 
 *         res = "["
 *         it = c_ml.begin()             # <<<<<<<<<<<<<<
 *         while it != c_ml.end():
 *             if first:
 */
  __pyx_v_it = __pyx_v_c_ml->begin();

  /* "osmium/osm.pyx":202
 *         res = "["
 *         it = c_ml.begin()
 *         while it != c_ml.end():             # <<<<<<<<<<<<<<
 *             if first:
 *                 first = False
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_it != __pyx_v_c_ml->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":203
 *         it = c_ml.begin()
 *         while it != c_ml.end():
 *             if first:             # <<<<<<<<<<<<<<
 *                 first = False
 *             else:
 */
    if (__pyx_v_first) {

      /* "osmium/osm.pyx":204
 *         while it != c_ml.end():
 *             if first:
 *                 first = False             # <<<<<<<<<<<<<<
 *             else:
 *                 res += ', '
 */
      __pyx_v_first = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "osmium/osm.pyx":206
 *                 first = False
 *             else:
 *                 res += ', '             # <<<<<<<<<<<<<<
 * 
 *             res += '('+str(it.deref().ref()) + ', '
 */
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_res);
      __pyx_v_res = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L7:;

    /* "osmium/osm.pyx":208
 *                 res += ', '
 * 
 *             res += '('+str(it.deref().ref()) + ', '             # <<<<<<<<<<<<<<
 *             res += str(chr(it.deref().typ()))+', '
 *             res += repr((<char*>it.deref().role()).decode('utf-8'))+')'
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(__pyx_v_it.operator*().ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_kp_s_9), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "osmium/osm.pyx":209
 * 
 *             res += '('+str(it.deref().ref()) + ', '
 *             res += str(chr(it.deref().typ()))+', '             # <<<<<<<<<<<<<<
 *             res += repr((<char*>it.deref().role()).decode('utf-8'))+')'
 *             it.inc()
 */
    __pyx_t_4 = PyInt_FromLong(__pyx_v_it.operator*().type()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_4, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "osmium/osm.pyx":210
 *             res += '('+str(it.deref().ref()) + ', '
 *             res += str(chr(it.deref().typ()))+', '
 *             res += repr((<char*>it.deref().role()).decode('utf-8'))+')'             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_5 = ((char *)__pyx_v_it.operator*().role());
    __pyx_t_4 = ((PyObject *)PyUnicode_Decode(__pyx_t_5, strlen(__pyx_t_5), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __pyx_t_3 = PyObject_Repr(((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_10)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "osmium/osm.pyx":211
 *             res += str(chr(it.deref().typ()))+', '
 *             res += repr((<char*>it.deref().role()).decode('utf-8'))+')'
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 *         res += ']'
 */
    __pyx_v_it.operator++();
  }

  /* "osmium/osm.pyx":213
 *             it.inc()
 * 
 *         res += ']'             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "osmium/osm.pyx":214
 * 
 *         res += ']'
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("osmium.osm.RelationMemberList.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6osmium_3osm_18RelationMemberList_6generator1(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */

/* "osmium/osm.pyx":216
 *         return res
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberListIterator *it = new c_RelationMemberListIterator()
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 */

static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_18RelationMemberList_5__iter__(PyObject *__pyx_v_self) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__");
  __pyx_cur_scope = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *)__pyx_ptype_6osmium_3osm___pyx_scope_struct_1___iter__->tp_new(__pyx_ptype_6osmium_3osm___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_base.resume_label = 0;
  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_6osmium_3osm_18RelationMemberList_6generator1;
  __Pyx_GIVEREF(__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return (PyObject *) __pyx_cur_scope;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6osmium_3osm_18RelationMemberList_6generator1(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  Osmium::OSM::RelationMemberList *__pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  char *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None");
  switch (__pyx_cur_scope->__pyx_base.resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "osmium/osm.pyx":217
 * 
 *     def __iter__(self):
 *         cdef c_RelationMemberListIterator *it = new c_RelationMemberListIterator()             # <<<<<<<<<<<<<<
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 * 
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::RelationMemberList::iterator();

  /* "osmium/osm.pyx":218
 *     def __iter__(self):
 *         cdef c_RelationMemberListIterator *it = new c_RelationMemberListIterator()
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)             # <<<<<<<<<<<<<<
 * 
 *         it[0] = c_ml.begin()
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmRelMemList(((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_cur_scope->__pyx_v_self)->c_relation); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_c_ml = __pyx_t_1;

  /* "osmium/osm.pyx":220
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 * 
 *         it[0] = c_ml.begin()             # <<<<<<<<<<<<<<
 *         while it[0] != c_ml.end():
 *             yield (it.deref().ref(), chr(it.deref().typ()), (<char*>it.deref().role()).decode('utf-8'))
 */
  (__pyx_cur_scope->__pyx_v_it[0]) = __pyx_cur_scope->__pyx_v_c_ml->begin();

  /* "osmium/osm.pyx":221
 * 
 *         it[0] = c_ml.begin()
 *         while it[0] != c_ml.end():             # <<<<<<<<<<<<<<
 *             yield (it.deref().ref(), chr(it.deref().typ()), (<char*>it.deref().role()).decode('utf-8'))
 *             it.inc()
 */
  while (1) {
    __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_it[0]) != __pyx_cur_scope->__pyx_v_c_ml->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":222
 *         it[0] = c_ml.begin()
 *         while it[0] != c_ml.end():
 *             yield (it.deref().ref(), chr(it.deref().typ()), (<char*>it.deref().role()).decode('utf-8'))             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_to_py_osm_object_id_t(__pyx_cur_scope->__pyx_v_it->operator*().ref()); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromLong(__pyx_cur_scope->__pyx_v_it->operator*().type()); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_6 = ((char *)__pyx_cur_scope->__pyx_v_it->operator*().role());
    __pyx_t_5 = ((PyObject *)PyUnicode_Decode(__pyx_t_6, strlen(__pyx_t_6), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_7));
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_7, 2, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = ((PyObject *)__pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_cur_scope->__pyx_base.resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "osmium/osm.pyx":223
 *         while it[0] != c_ml.end():
 *             yield (it.deref().ref(), chr(it.deref().typ()), (<char*>it.deref().role()).decode('utf-8'))
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_cur_scope->__pyx_v_it->operator++();
  }
  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_cur_scope->__pyx_base.resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "osmium/osm.pyx":230
 *     """
 *     property members:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             global _cache_relationmemberlist
 *             if (<PyObject*>_cache_relationmemberlist).ob_refcnt > 1:
 */

static PyObject *__pyx_pf_6osmium_3osm_8Relation_7members___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_8Relation_7members___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__");

  /* "osmium/osm.pyx":232
 *         def __get__(self):
 *             global _cache_relationmemberlist
 *             if (<PyObject*>_cache_relationmemberlist).ob_refcnt > 1:             # <<<<<<<<<<<<<<
 *                 _cache_relationmemberlist = RelationMemberList()
 * 
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist)->ob_refcnt > 1);
  if (__pyx_t_1) {

    /* "osmium/osm.pyx":233
 *             global _cache_relationmemberlist
 *             if (<PyObject*>_cache_relationmemberlist).ob_refcnt > 1:
 *                 _cache_relationmemberlist = RelationMemberList()             # <<<<<<<<<<<<<<
 * 
 *             _cache_relationmemberlist.c_relation[0] = castRelationPtr(self.c_object[0])
 */
    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_RelationMemberList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist));
    __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_v_6osmium_3osm__cache_relationmemberlist = ((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":235
 *                 _cache_relationmemberlist = RelationMemberList()
 * 
 *             _cache_relationmemberlist.c_relation[0] = castRelationPtr(self.c_object[0])             # <<<<<<<<<<<<<<
 *             return _cache_relationmemberlist
 * 
 */
  (__pyx_v_6osmium_3osm__cache_relationmemberlist->c_relation[0]) = boost::static_pointer_cast<const Osmium::OSM::Relation>((((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_v_self)->__pyx_base.c_object[0]));

  /* "osmium/osm.pyx":236
 * 
 *             _cache_relationmemberlist.c_relation[0] = castRelationPtr(self.c_object[0])
 *             return _cache_relationmemberlist             # <<<<<<<<<<<<<<
 * 
 * cdef class TagList:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist));
  __pyx_r = ((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.Relation.members.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":241
 *     """List interface to the TagList property
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_object = new ObjectPtr()
 * 
 */

static int __pyx_pf_6osmium_3osm_7TagList___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_7TagList___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;

  /* "osmium/osm.pyx":242
 *     """
 *     def __cinit__(self):
 *         self.c_object = new ObjectPtr()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_v_self)->c_object = new shared_ptr<const Osmium::OSM::Object>();

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

/* "osmium/osm.pyx":244
 *         self.c_object = new ObjectPtr()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_object
 * 
 */

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

  /* "osmium/osm.pyx":245
 * 
 *     def __dealloc__(self):
 *         del self.c_object             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  delete ((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_v_self)->c_object;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":247
 *         del self.c_object
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return _getOsmTagList(self.c_object).size()
 * 
 */

static Py_ssize_t __pyx_pf_6osmium_3osm_7TagList_2__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6osmium_3osm_7TagList_2__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::TagList *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__len__");

  /* "osmium/osm.pyx":248
 * 
 *     def __len__(self):
 *         return _getOsmTagList(self.c_object).size()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1->size();
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("osmium.osm.TagList.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":250
 *         return _getOsmTagList(self.c_object).size()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagListIterator it
 *         cdef bint first=True
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_3__str__(PyObject *__pyx_v_self) {
  Osmium::OSM::TagList::iterator __pyx_v_it;
  int __pyx_v_first;
  Osmium::OSM::TagList *__pyx_v_c_taglist;
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Osmium::OSM::TagList *__pyx_t_1;
  bool __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  char *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__");

  /* "osmium/osm.pyx":252
 *     def __str__(self):
 *         cdef c_TagListIterator it
 *         cdef bint first=True             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 * 
 */
  __pyx_v_first = 1;

  /* "osmium/osm.pyx":253
 *         cdef c_TagListIterator it
 *         cdef bint first=True
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)             # <<<<<<<<<<<<<<
 * 
 *         res = "{"
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_c_taglist = __pyx_t_1;

  /* "osmium/osm.pyx":255
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 * 
 *         res = "{"             # <<<<<<<<<<<<<<
 *         it = c_taglist.begin()
 *         while it!=c_taglist.end():
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_11));
  __pyx_v_res = ((PyObject *)__pyx_kp_s_11);

  /* "osmium/osm.pyx":256
 * 
 *         res = "{"
 *         it = c_taglist.begin()             # <<<<<<<<<<<<<<
 *         while it!=c_taglist.end():
 *             if first:
 */
  __pyx_v_it = __pyx_v_c_taglist->begin();

  /* "osmium/osm.pyx":257
 *         res = "{"
 *         it = c_taglist.begin()
 *         while it!=c_taglist.end():             # <<<<<<<<<<<<<<
 *             if first:
 *                 first = False
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_it != __pyx_v_c_taglist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":258
 *         it = c_taglist.begin()
 *         while it!=c_taglist.end():
 *             if first:             # <<<<<<<<<<<<<<
 *                 first = False
 *             else:
 */
    if (__pyx_v_first) {

      /* "osmium/osm.pyx":259
 *         while it!=c_taglist.end():
 *             if first:
 *                 first = False             # <<<<<<<<<<<<<<
 *             else:
 *                 res += ', '
 */
      __pyx_v_first = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "osmium/osm.pyx":261
 *                 first = False
 *             else:
 *                 res += ', '             # <<<<<<<<<<<<<<
 * 
 *             res += "'"+(<char*>it.deref().key()).decode('utf-8')+"': "
 */
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_res);
      __pyx_v_res = __pyx_t_3;
      __pyx_t_3 = 0;
    }
    __pyx_L7:;

    /* "osmium/osm.pyx":263
 *                 res += ', '
 * 
 *             res += "'"+(<char*>it.deref().key()).decode('utf-8')+"': "             # <<<<<<<<<<<<<<
 *             res += "'"+(<char*>it.deref().value()).decode('utf-8')+"'"
 *             it.inc()
 */
    __pyx_t_4 = ((char *)__pyx_v_it.operator*().key());
    __pyx_t_3 = ((PyObject *)PyUnicode_Decode(__pyx_t_4, strlen(__pyx_t_4), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __pyx_t_5 = PyNumber_Add(((PyObject *)__pyx_kp_s_12), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_kp_s_13)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "osmium/osm.pyx":264
 * 
 *             res += "'"+(<char*>it.deref().key()).decode('utf-8')+"': "
 *             res += "'"+(<char*>it.deref().value()).decode('utf-8')+"'"             # <<<<<<<<<<<<<<
 *             it.inc()
 *         res += '}'
 */
    __pyx_t_4 = ((char *)__pyx_v_it.operator*().value());
    __pyx_t_5 = ((PyObject *)PyUnicode_Decode(__pyx_t_4, strlen(__pyx_t_4), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_3 = PyNumber_Add(((PyObject *)__pyx_kp_s_12), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_t_3, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "osmium/osm.pyx":265
 *             res += "'"+(<char*>it.deref().key()).decode('utf-8')+"': "
 *             res += "'"+(<char*>it.deref().value()).decode('utf-8')+"'"
 *             it.inc()             # <<<<<<<<<<<<<<
 *         res += '}'
 *         return res
 */
    __pyx_v_it.operator++();
  }

  /* "osmium/osm.pyx":266
 *             res += "'"+(<char*>it.deref().value()).decode('utf-8')+"'"
 *             it.inc()
 *         res += '}'             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_14)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "osmium/osm.pyx":267
 *             it.inc()
 *         res += '}'
 *         return res             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("osmium.osm.TagList.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":269
 *         return res
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         cdef bytes key_b = key.encode('utf-8')
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_4__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_key_b = 0;
  char *__pyx_v_res;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Osmium::OSM::TagList *__pyx_t_3;
  char *__pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__");

  /* "osmium/osm.pyx":270
 * 
 *     def __getitem__(self, key):
 *         cdef bytes key_b = key.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)
 *         if res is NULL:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_key, __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_k_tuple_15), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_2)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_key_b = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":271
 *     def __getitem__(self, key):
 *         cdef bytes key_b = key.encode('utf-8')
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)             # <<<<<<<<<<<<<<
 *         if res is NULL:
 *             raise KeyError(key)
 */
  __pyx_t_3 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_v_self)->c_object); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_4 = PyBytes_AsString(((PyObject *)__pyx_v_key_b)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_res = ((char *)__pyx_t_3->get_tag_by_key(__pyx_t_4));

  /* "osmium/osm.pyx":272
 *         cdef bytes key_b = key.encode('utf-8')
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)
 *         if res is NULL:             # <<<<<<<<<<<<<<
 *             raise KeyError(key)
 * 
 */
  __pyx_t_5 = (__pyx_v_res == NULL);
  if (__pyx_t_5) {

    /* "osmium/osm.pyx":273
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)
 *         if res is NULL:
 *             raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *         return res.decode('utf-8')
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    __pyx_t_1 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":275
 *             raise KeyError(key)
 * 
 *         return res.decode('utf-8')             # <<<<<<<<<<<<<<
 * 
 *     def keys(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)PyUnicode_Decode(__pyx_v_res, strlen(__pyx_v_res), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("osmium.osm.TagList.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key_b);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6osmium_3osm_7TagList_6generator2(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */

/* "osmium/osm.pyx":277
 *         return res.decode('utf-8')
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_5keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keys");
  __pyx_cur_scope = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *)__pyx_ptype_6osmium_3osm___pyx_scope_struct_2_keys->tp_new(__pyx_ptype_6osmium_3osm___pyx_scope_struct_2_keys, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_base.resume_label = 0;
  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_6osmium_3osm_7TagList_6generator2;
  __Pyx_GIVEREF(__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return (PyObject *) __pyx_cur_scope;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6osmium_3osm_7TagList_6generator2(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  Osmium::OSM::TagList *__pyx_t_1;
  bool __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None");
  switch (__pyx_cur_scope->__pyx_base.resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "osmium/osm.pyx":278
 * 
 *     def keys(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)             # <<<<<<<<<<<<<<
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_cur_scope->__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_c_taglist = __pyx_t_1;

  /* "osmium/osm.pyx":279
 *     def keys(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()             # <<<<<<<<<<<<<<
 * 
 *         it = new c_TagListIterator()
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::TagList::iterator();

  /* "osmium/osm.pyx":281
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 *         it = new c_TagListIterator()             # <<<<<<<<<<<<<<
 *         it[0] = c_taglist.begin()
 *         while it[0] != c_taglist.end():
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::TagList::iterator();

  /* "osmium/osm.pyx":282
 * 
 *         it = new c_TagListIterator()
 *         it[0] = c_taglist.begin()             # <<<<<<<<<<<<<<
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().key()).decode('utf-8')
 */
  (__pyx_cur_scope->__pyx_v_it[0]) = __pyx_cur_scope->__pyx_v_c_taglist->begin();

  /* "osmium/osm.pyx":283
 *         it = new c_TagListIterator()
 *         it[0] = c_taglist.begin()
 *         while it[0] != c_taglist.end():             # <<<<<<<<<<<<<<
 *             yield (<char*>it.deref().key()).decode('utf-8')
 *             it.inc()
 */
  while (1) {
    __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_it[0]) != __pyx_cur_scope->__pyx_v_c_taglist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":284
 *         it[0] = c_taglist.begin()
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().key()).decode('utf-8')             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_3 = ((char *)__pyx_cur_scope->__pyx_v_it->operator*().key());
    __pyx_t_4 = ((PyObject *)PyUnicode_Decode(__pyx_t_3, strlen(__pyx_t_3), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
    __pyx_r = ((PyObject *)__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_cur_scope->__pyx_base.resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "osmium/osm.pyx":285
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().key()).decode('utf-8')
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
    __pyx_cur_scope->__pyx_v_it->operator++();
  }
  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_cur_scope->__pyx_base.resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "osmium/osm.pyx":287
 *             it.inc()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self.keys()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_7__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_7__iter__(PyObject *__pyx_v_self) {
  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("__iter__");

  /* "osmium/osm.pyx":288
 * 
 *     def __iter__(self):
 *         return self.keys()             # <<<<<<<<<<<<<<
 * 
 *     def values(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__keys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __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 = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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.osm.TagList.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_6osmium_3osm_7TagList_9generator3(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */

/* "osmium/osm.pyx":290
 *         return self.keys()
 * 
 *     def values(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_8values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_8values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values");
  __pyx_cur_scope = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *)__pyx_ptype_6osmium_3osm___pyx_scope_struct_3_values->tp_new(__pyx_ptype_6osmium_3osm___pyx_scope_struct_3_values, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_base.resume_label = 0;
  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_6osmium_3osm_7TagList_9generator3;
  __Pyx_GIVEREF(__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return (PyObject *) __pyx_cur_scope;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6osmium_3osm_7TagList_9generator3(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  Osmium::OSM::TagList *__pyx_t_1;
  bool __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None");
  switch (__pyx_cur_scope->__pyx_base.resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "osmium/osm.pyx":291
 * 
 *     def values(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)             # <<<<<<<<<<<<<<
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_cur_scope->__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_c_taglist = __pyx_t_1;

  /* "osmium/osm.pyx":292
 *     def values(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()             # <<<<<<<<<<<<<<
 * 
 *         it[0] = c_taglist.begin()
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::TagList::iterator();

  /* "osmium/osm.pyx":294
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 *         it[0] = c_taglist.begin()             # <<<<<<<<<<<<<<
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().value()).decode('utf-8')
 */
  (__pyx_cur_scope->__pyx_v_it[0]) = __pyx_cur_scope->__pyx_v_c_taglist->begin();

  /* "osmium/osm.pyx":295
 * 
 *         it[0] = c_taglist.begin()
 *         while it[0] != c_taglist.end():             # <<<<<<<<<<<<<<
 *             yield (<char*>it.deref().value()).decode('utf-8')
 *             it.inc()
 */
  while (1) {
    __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_it[0]) != __pyx_cur_scope->__pyx_v_c_taglist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":296
 *         it[0] = c_taglist.begin()
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().value()).decode('utf-8')             # <<<<<<<<<<<<<<
 *             it.inc()
 * 
 */
    __pyx_t_3 = ((char *)__pyx_cur_scope->__pyx_v_it->operator*().value());
    __pyx_t_4 = ((PyObject *)PyUnicode_Decode(__pyx_t_3, strlen(__pyx_t_3), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
    __pyx_r = ((PyObject *)__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_cur_scope->__pyx_base.resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "osmium/osm.pyx":297
 *         while it[0] != c_taglist.end():
 *             yield (<char*>it.deref().value()).decode('utf-8')
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 *     def items(self):
 */
    __pyx_cur_scope->__pyx_v_it->operator++();
  }
  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_cur_scope->__pyx_base.resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}
static PyObject *__pyx_gb_6osmium_3osm_7TagList_11generator4(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *__pyx_cur_scope, PyObject *__pyx_sent_value); /* proto */

/* "osmium/osm.pyx":299
 *             it.inc()
 * 
 *     def items(self):             # <<<<<<<<<<<<<<
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 */

static PyObject *__pyx_pf_6osmium_3osm_7TagList_10items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_7TagList_10items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items");
  __pyx_cur_scope = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *)__pyx_ptype_6osmium_3osm___pyx_scope_struct_4_items->tp_new(__pyx_ptype_6osmium_3osm___pyx_scope_struct_4_items, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_base.resume_label = 0;
  __pyx_cur_scope->__pyx_base.body = (__pyx_generator_body_t) __pyx_gb_6osmium_3osm_7TagList_11generator4;
  __Pyx_GIVEREF(__pyx_cur_scope);
  __Pyx_RefNannyFinishContext();
  return (PyObject *) __pyx_cur_scope;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6osmium_3osm_7TagList_11generator4(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *__pyx_cur_scope, PyObject *__pyx_sent_value) /* generator body */
{
  PyObject *__pyx_r = NULL;
  Osmium::OSM::TagList *__pyx_t_1;
  bool __pyx_t_2;
  char *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None");
  switch (__pyx_cur_scope->__pyx_base.resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "osmium/osm.pyx":300
 * 
 *     def items(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)             # <<<<<<<<<<<<<<
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 */
  __pyx_t_1 = __pyx_f_6osmium_3osm__getOsmTagList(((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_cur_scope->__pyx_v_self)->c_object); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_cur_scope->__pyx_v_c_taglist = __pyx_t_1;

  /* "osmium/osm.pyx":301
 *     def items(self):
 *         cdef c_TagList* c_taglist = _getOsmTagList(self.c_object)
 *         cdef c_TagListIterator *it = new c_TagListIterator()             # <<<<<<<<<<<<<<
 * 
 *         it[0] = c_taglist.begin()
 */
  __pyx_cur_scope->__pyx_v_it = new Osmium::OSM::TagList::iterator();

  /* "osmium/osm.pyx":303
 *         cdef c_TagListIterator *it = new c_TagListIterator()
 * 
 *         it[0] = c_taglist.begin()             # <<<<<<<<<<<<<<
 *         while it[0]!=c_taglist.end():
 *             yield (
 */
  (__pyx_cur_scope->__pyx_v_it[0]) = __pyx_cur_scope->__pyx_v_c_taglist->begin();

  /* "osmium/osm.pyx":304
 * 
 *         it[0] = c_taglist.begin()
 *         while it[0]!=c_taglist.end():             # <<<<<<<<<<<<<<
 *             yield (
 *                     (<char*>it.deref().key()).decode('utf-8'),
 */
  while (1) {
    __pyx_t_2 = ((__pyx_cur_scope->__pyx_v_it[0]) != __pyx_cur_scope->__pyx_v_c_taglist->end());
    if (!__pyx_t_2) break;

    /* "osmium/osm.pyx":306
 *         while it[0]!=c_taglist.end():
 *             yield (
 *                     (<char*>it.deref().key()).decode('utf-8'),             # <<<<<<<<<<<<<<
 *                     (<char*>it.deref().value()).decode('utf-8')
 *                 )
 */
    __pyx_t_3 = ((char *)__pyx_cur_scope->__pyx_v_it->operator*().key());
    __pyx_t_4 = ((PyObject *)PyUnicode_Decode(__pyx_t_3, strlen(__pyx_t_3), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));

    /* "osmium/osm.pyx":307
 *             yield (
 *                     (<char*>it.deref().key()).decode('utf-8'),
 *                     (<char*>it.deref().value()).decode('utf-8')             # <<<<<<<<<<<<<<
 *                 )
 *             it.inc()
 */
    __pyx_t_3 = ((char *)__pyx_cur_scope->__pyx_v_it->operator*().value());
    __pyx_t_5 = ((PyObject *)PyUnicode_Decode(__pyx_t_3, strlen(__pyx_t_3), __pyx_k_2, NULL)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(((PyObject *)__pyx_t_5));
    PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __pyx_r = ((PyObject *)__pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_cur_scope->__pyx_base.resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "osmium/osm.pyx":309
 *                     (<char*>it.deref().value()).decode('utf-8')
 *                 )
 *             it.inc()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_cur_scope->__pyx_v_it->operator++();
  }
  PyErr_SetNone(PyExc_StopIteration); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_cur_scope->__pyx_base.resume_label = -1;
  __Pyx_RefNannyFinishContext();
  return NULL;
}

/* "osmium/osm.pyx":315
 *     """Bounding box information from the header of an OSM file.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_bounds = new c_Bounds()
 * 
 */

static int __pyx_pf_6osmium_3osm_6Bounds___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_6Bounds___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;

  /* "osmium/osm.pyx":316
 *     """
 *     def __cinit__(self):
 *         self.c_bounds = new c_Bounds()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds = new Osmium::OSM::Bounds();

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

/* "osmium/osm.pyx":318
 *         self.c_bounds = new c_Bounds()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_bounds
 * 
 */

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

  /* "osmium/osm.pyx":319
 * 
 *     def __dealloc__(self):
 *         del self.c_bounds             # <<<<<<<<<<<<<<
 * 
 *     property defined:
 */
  delete ((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":322
 * 
 *     property defined:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_bounds.defined()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_7defined___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_7defined___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":323
 *     property defined:
 *         def __get__(self):
 *             return self.c_bounds.defined()             # <<<<<<<<<<<<<<
 * 
 *     property bottom:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->defined()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __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.osm.Bounds.defined.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":326
 * 
 *     property bottom:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_bounds.bl().lat()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_6bottom___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_6bottom___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":327
 *     property bottom:
 *         def __get__(self):
 *             return self.c_bounds.bl().lat()             # <<<<<<<<<<<<<<
 * 
 *     property left:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->bl().lat()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __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.osm.Bounds.bottom.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":330
 * 
 *     property left:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_bounds.bl().lon()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_4left___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_4left___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":331
 *     property left:
 *         def __get__(self):
 *             return self.c_bounds.bl().lon()             # <<<<<<<<<<<<<<
 * 
 *     property top:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->bl().lon()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __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.osm.Bounds.left.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":334
 * 
 *     property top:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_bounds.tr().lat()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_3top___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_3top___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":335
 *     property top:
 *         def __get__(self):
 *             return self.c_bounds.tr().lat()             # <<<<<<<<<<<<<<
 * 
 *     property right:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->tr().lat()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __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.osm.Bounds.top.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":338
 * 
 *     property right:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_bounds.tr().lon()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_5right___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_5right___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":339
 *     property right:
 *         def __get__(self):
 *             return self.c_bounds.tr().lon()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->tr().lon()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __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.osm.Bounds.right.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":341
 *             return self.c_bounds.tr().lon()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         res = "(("
 *         res += str(self.c_bounds.bl().lon())
 */

static PyObject *__pyx_pf_6osmium_3osm_6Bounds_2__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_6Bounds_2__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  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("__str__");

  /* "osmium/osm.pyx":342
 * 
 *     def __str__(self):
 *         res = "(("             # <<<<<<<<<<<<<<
 *         res += str(self.c_bounds.bl().lon())
 *         res += ", "
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_16));
  __pyx_v_res = ((PyObject *)__pyx_kp_s_16);

  /* "osmium/osm.pyx":343
 *     def __str__(self):
 *         res = "(("
 *         res += str(self.c_bounds.bl().lon())             # <<<<<<<<<<<<<<
 *         res += ", "
 *         res += str(self.c_bounds.bl().lat())
 */
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->bl().lon()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":344
 *         res = "(("
 *         res += str(self.c_bounds.bl().lon())
 *         res += ", "             # <<<<<<<<<<<<<<
 *         res += str(self.c_bounds.bl().lat())
 *         res += "), ("
 */
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":345
 *         res += str(self.c_bounds.bl().lon())
 *         res += ", "
 *         res += str(self.c_bounds.bl().lat())             # <<<<<<<<<<<<<<
 *         res += "), ("
 *         res += str(self.c_bounds.tr().lon())
 */
  __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->bl().lat()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":346
 *         res += ", "
 *         res += str(self.c_bounds.bl().lat())
 *         res += "), ("             # <<<<<<<<<<<<<<
 *         res += str(self.c_bounds.tr().lon())
 *         res += ", "
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_17)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":347
 *         res += str(self.c_bounds.bl().lat())
 *         res += "), ("
 *         res += str(self.c_bounds.tr().lon())             # <<<<<<<<<<<<<<
 *         res += ", "
 *         res += str(self.c_bounds.tr().lat())
 */
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->tr().lon()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":348
 *         res += "), ("
 *         res += str(self.c_bounds.tr().lon())
 *         res += ", "             # <<<<<<<<<<<<<<
 *         res += str(self.c_bounds.tr().lat())
 *         res += "))"
 */
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_4)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":349
 *         res += str(self.c_bounds.tr().lon())
 *         res += ", "
 *         res += str(self.c_bounds.tr().lat())             # <<<<<<<<<<<<<<
 *         res += "))"
 *         return res
 */
  __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_v_self)->c_bounds->tr().lat()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":350
 *         res += ", "
 *         res += str(self.c_bounds.tr().lat())
 *         res += "))"             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_18)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":351
 *         res += str(self.c_bounds.tr().lat())
 *         res += "))"
 *         return res             # <<<<<<<<<<<<<<
 * 
 * cdef class Meta:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __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.osm.Bounds.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":356
 *     """Meta information from the header of an OSM file.
 *     """
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self.c_meta = new c_Meta()
 * 
 */

static int __pyx_pf_6osmium_3osm_4Meta___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_4Meta___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;

  /* "osmium/osm.pyx":357
 *     """
 *     def __cinit__(self):
 *         self.c_meta = new c_Meta()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */
  ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->c_meta = new Osmium::OSM::Meta();

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

/* "osmium/osm.pyx":359
 *         self.c_meta = new c_Meta()
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.bounds = Bounds()
 * 
 */

static int __pyx_pf_6osmium_3osm_4Meta_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6osmium_3osm_4Meta_1__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/osm.pyx":360
 * 
 *     def __init__(self):
 *         self.bounds = Bounds()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Bounds)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds));
  ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds = ((struct __pyx_obj_6osmium_3osm_Bounds *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* "osmium/osm.pyx":362
 *         self.bounds = Bounds()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         del self.c_meta
 * 
 */

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

  /* "osmium/osm.pyx":363
 * 
 *     def __dealloc__(self):
 *         del self.c_meta             # <<<<<<<<<<<<<<
 * 
 *     cdef set_from_c(self, c_Meta &newval):
 */
  delete ((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->c_meta;

  __Pyx_RefNannyFinishContext();
}

/* "osmium/osm.pyx":365
 *         del self.c_meta
 * 
 *     cdef set_from_c(self, c_Meta &newval):             # <<<<<<<<<<<<<<
 *         self.c_meta[0] = newval
 *         self.bounds.c_bounds[0] = self.c_meta.bounds()
 */

static PyObject *__pyx_f_6osmium_3osm_4Meta_set_from_c(struct __pyx_obj_6osmium_3osm_Meta *__pyx_v_self, Osmium::OSM::Meta &__pyx_v_newval) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_from_c");

  /* "osmium/osm.pyx":366
 * 
 *     cdef set_from_c(self, c_Meta &newval):
 *         self.c_meta[0] = newval             # <<<<<<<<<<<<<<
 *         self.bounds.c_bounds[0] = self.c_meta.bounds()
 * 
 */
  (__pyx_v_self->c_meta[0]) = __pyx_v_newval;

  /* "osmium/osm.pyx":367
 *     cdef set_from_c(self, c_Meta &newval):
 *         self.c_meta[0] = newval
 *         self.bounds.c_bounds[0] = self.c_meta.bounds()             # <<<<<<<<<<<<<<
 * 
 *     property has_multiple_object_versions:
 */
  (__pyx_v_self->bounds->c_bounds[0]) = __pyx_v_self->c_meta->bounds();

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

/* "osmium/osm.pyx":370
 * 
 *     property has_multiple_object_versions:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.c_meta.has_multiple_object_versions()
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_4Meta_28has_multiple_object_versions___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_4Meta_28has_multiple_object_versions___get__(PyObject *__pyx_v_self) {
  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("__get__");

  /* "osmium/osm.pyx":371
 *     property has_multiple_object_versions:
 *         def __get__(self):
 *             return self.c_meta.has_multiple_object_versions()             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->c_meta->has_multiple_object_versions()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __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.osm.Meta.has_multiple_object_versions.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pyx":373
 *             return self.c_meta.has_multiple_object_versions()
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         res = "{multiple_versions: "
 *         res += str(self.c_meta.has_multiple_object_versions())
 */

static PyObject *__pyx_pf_6osmium_3osm_4Meta_3__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_4Meta_3__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_res = NULL;
  PyObject *__pyx_r = NULL;
  __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("__str__");

  /* "osmium/osm.pyx":374
 * 
 *     def __str__(self):
 *         res = "{multiple_versions: "             # <<<<<<<<<<<<<<
 *         res += str(self.c_meta.has_multiple_object_versions())
 *         res += ", bounds: "
 */
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_19));
  __pyx_v_res = ((PyObject *)__pyx_kp_s_19);

  /* "osmium/osm.pyx":375
 *     def __str__(self):
 *         res = "{multiple_versions: "
 *         res += str(self.c_meta.has_multiple_object_versions())             # <<<<<<<<<<<<<<
 *         res += ", bounds: "
 *         if self.bounds.defined:
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong(((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->c_meta->has_multiple_object_versions()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":376
 *         res = "{multiple_versions: "
 *         res += str(self.c_meta.has_multiple_object_versions())
 *         res += ", bounds: "             # <<<<<<<<<<<<<<
 *         if self.bounds.defined:
 *             res += str(self.bounds)
 */
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":377
 *         res += str(self.c_meta.has_multiple_object_versions())
 *         res += ", bounds: "
 *         if self.bounds.defined:             # <<<<<<<<<<<<<<
 *             res += str(self.bounds)
 *         else:
 */
  __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds), __pyx_n_s__defined); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "osmium/osm.pyx":378
 *         res += ", bounds: "
 *         if self.bounds.defined:
 *             res += str(self.bounds)             # <<<<<<<<<<<<<<
 *         else:
 *             res += 'not set'
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds));
    __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds));
    __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "osmium/osm.pyx":380
 *             res += str(self.bounds)
 *         else:
 *             res += 'not set'             # <<<<<<<<<<<<<<
 *         res += "}"
 *         return res
 */
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_21)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_v_res);
    __pyx_v_res = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L5:;

  /* "osmium/osm.pyx":381
 *         else:
 *             res += 'not set'
 *         res += "}"             # <<<<<<<<<<<<<<
 *         return res
 * 
 */
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_res, ((PyObject *)__pyx_kp_s_14)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "osmium/osm.pyx":382
 *             res += 'not set'
 *         res += "}"
 *         return res             # <<<<<<<<<<<<<<
 * 
 * _cache_node = Node()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_res);
  __pyx_r = __pyx_v_res;
  goto __pyx_L0;

  __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.osm.Meta.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_res);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "osmium/osm.pxd":44
 *     """
 *     cdef c_Meta* c_meta
 *     cdef readonly Bounds bounds             # <<<<<<<<<<<<<<
 *     cdef set_from_c(self, c_Meta &newval)
 * 
 */

static PyObject *__pyx_pf_6osmium_3osm_4Meta_6bounds___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6osmium_3osm_4Meta_6bounds___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_3osm_Meta *)__pyx_v_self)->bounds));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6osmium_3osm_Meta *)__pyx_v_self)->bounds);
  goto __pyx_L0;

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

static PyObject *__pyx_tp_new_6osmium_3osm_TagList(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6osmium_3osm_7TagList___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_TagList(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_7TagList_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_6osmium_3osm_TagList(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyMethodDef __pyx_methods_6osmium_3osm_TagList[] = {
  {__Pyx_NAMESTR("keys"), (PyCFunction)__pyx_pf_6osmium_3osm_7TagList_5keys, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("values"), (PyCFunction)__pyx_pf_6osmium_3osm_7TagList_8values, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("items"), (PyCFunction)__pyx_pf_6osmium_3osm_7TagList_10items, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_TagList = {
  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_TagList = {
  __pyx_pf_6osmium_3osm_7TagList_2__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6osmium_3osm_TagList, /*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_TagList = {
  __pyx_pf_6osmium_3osm_7TagList_2__len__, /*mp_length*/
  __pyx_pf_6osmium_3osm_7TagList_4__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_TagList = {
  #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_3osm_TagList = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.TagList"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_TagList), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_TagList, /*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_TagList, /*tp_as_number*/
  &__pyx_tp_as_sequence_TagList, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_TagList, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_6osmium_3osm_7TagList_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_TagList, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("List interface to the TagList property\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6osmium_3osm_7TagList_7__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_TagList, /*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_3osm_TagList, /*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 PyObject *__pyx_tp_new_6osmium_3osm_WayNodeList(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6osmium_3osm_11WayNodeList___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_WayNodeList(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_11WayNodeList_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_6osmium_3osm_WayNodeList(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

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

static PyNumberMethods __pyx_tp_as_number_WayNodeList = {
  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_WayNodeList = {
  __pyx_pf_6osmium_3osm_11WayNodeList_2__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6osmium_3osm_WayNodeList, /*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_WayNodeList = {
  __pyx_pf_6osmium_3osm_11WayNodeList_2__len__, /*mp_length*/
  __pyx_pf_6osmium_3osm_11WayNodeList_4__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_WayNodeList = {
  #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_3osm_WayNodeList = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.WayNodeList"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_WayNodeList), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_WayNodeList, /*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_WayNodeList, /*tp_as_number*/
  &__pyx_tp_as_sequence_WayNodeList, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_WayNodeList, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_6osmium_3osm_11WayNodeList_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_WayNodeList, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("List interface to the NodeList property\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6osmium_3osm_11WayNodeList_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_WayNodeList, /*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_3osm_WayNodeList, /*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 PyObject *__pyx_tp_new_6osmium_3osm_RelationMemberList(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6osmium_3osm_18RelationMemberList___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_RelationMemberList(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_18RelationMemberList_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}
static PyObject *__pyx_sq_item_6osmium_3osm_RelationMemberList(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

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

static PyNumberMethods __pyx_tp_as_number_RelationMemberList = {
  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_RelationMemberList = {
  __pyx_pf_6osmium_3osm_18RelationMemberList_2__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_6osmium_3osm_RelationMemberList, /*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_RelationMemberList = {
  __pyx_pf_6osmium_3osm_18RelationMemberList_2__len__, /*mp_length*/
  __pyx_pf_6osmium_3osm_18RelationMemberList_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_RelationMemberList = {
  #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_3osm_RelationMemberList = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.RelationMemberList"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_RelationMemberList), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_RelationMemberList, /*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_RelationMemberList, /*tp_as_number*/
  &__pyx_tp_as_sequence_RelationMemberList, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_RelationMemberList, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_6osmium_3osm_18RelationMemberList_4__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_RelationMemberList, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("List interface to the relation members\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6osmium_3osm_18RelationMemberList_5__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_RelationMemberList, /*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_3osm_RelationMemberList, /*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 PyObject *__pyx_tp_new_6osmium_3osm_Object(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6osmium_3osm_6Object___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_Object(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_6Object_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_o_id(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_4o_id___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_version(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_7version___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_changeset(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_9changeset___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_uid(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_3uid___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_timestamp(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_9timestamp___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_endtime(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_7endtime___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_user(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_4user___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_visible(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_7visible___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Object_tags(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Object_4tags___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Object[] = {
  {(char *)"o_id", __pyx_getprop_6osmium_3osm_6Object_o_id, 0, 0, 0},
  {(char *)"version", __pyx_getprop_6osmium_3osm_6Object_version, 0, 0, 0},
  {(char *)"changeset", __pyx_getprop_6osmium_3osm_6Object_changeset, 0, 0, 0},
  {(char *)"uid", __pyx_getprop_6osmium_3osm_6Object_uid, 0, 0, 0},
  {(char *)"timestamp", __pyx_getprop_6osmium_3osm_6Object_timestamp, 0, 0, 0},
  {(char *)"endtime", __pyx_getprop_6osmium_3osm_6Object_endtime, 0, 0, 0},
  {(char *)"user", __pyx_getprop_6osmium_3osm_6Object_user, 0, 0, 0},
  {(char *)"visible", __pyx_getprop_6osmium_3osm_6Object_visible, 0, 0, 0},
  {(char *)"tags", __pyx_getprop_6osmium_3osm_6Object_tags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Object = {
  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_Object = {
  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_Object = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Object = {
  #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_3osm_Object = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Object"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Object), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Object, /*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_Object, /*tp_as_number*/
  &__pyx_tp_as_sequence_Object, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Object, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Object, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("Base class for OSM objects\n    \n    Represents a OSM::Object\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_Object, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Object, /*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_3osm_Object, /*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 PyObject *__pyx_tp_new_6osmium_3osm_Node(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_6osmium_3osm_Object(t, a, k);
  if (!o) return 0;
  return o;
}

static PyObject *__pyx_getprop_6osmium_3osm_4Node_lon(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_4Node_3lon___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_4Node_lat(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_4Node_3lat___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Node[] = {
  {(char *)"lon", __pyx_getprop_6osmium_3osm_4Node_lon, 0, 0, 0},
  {(char *)"lat", __pyx_getprop_6osmium_3osm_4Node_lat, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Node = {
  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_Node = {
  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_Node = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Node = {
  #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_3osm_Node = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Node"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Node), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Object, /*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_Node, /*tp_as_number*/
  &__pyx_tp_as_sequence_Node, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Node, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Node, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("OSM Node object\n\n    Python access to a node.\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_Node, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Node, /*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_3osm_Node, /*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 PyObject *__pyx_tp_new_6osmium_3osm_Way(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_6osmium_3osm_Object(t, a, k);
  if (!o) return 0;
  return o;
}

static PyObject *__pyx_getprop_6osmium_3osm_3Way_nodes(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_3Way_5nodes___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Way[] = {
  {(char *)"nodes", __pyx_getprop_6osmium_3osm_3Way_nodes, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Way = {
  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_Way = {
  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_Way = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Way = {
  #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_3osm_Way = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Way"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Way), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Object, /*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_Way, /*tp_as_number*/
  &__pyx_tp_as_sequence_Way, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Way, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Way, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("OSM Way object\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_Way, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Way, /*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_3osm_Way, /*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 PyObject *__pyx_tp_new_6osmium_3osm_Relation(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = __pyx_tp_new_6osmium_3osm_Object(t, a, k);
  if (!o) return 0;
  return o;
}

static PyObject *__pyx_getprop_6osmium_3osm_8Relation_members(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_8Relation_7members___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Relation[] = {
  {(char *)"members", __pyx_getprop_6osmium_3osm_8Relation_members, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Relation = {
  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_Relation = {
  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_Relation = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Relation = {
  #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_3osm_Relation = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Relation"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Relation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Object, /*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_Relation, /*tp_as_number*/
  &__pyx_tp_as_sequence_Relation, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Relation, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Relation, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("OSM Relation object\n    "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_Relation, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Relation, /*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_3osm_Relation, /*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 PyObject *__pyx_tp_new_6osmium_3osm_Bounds(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6osmium_3osm_6Bounds___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_Bounds(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_6Bounds_1__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Bounds_defined(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Bounds_7defined___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Bounds_bottom(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Bounds_6bottom___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Bounds_left(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Bounds_4left___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Bounds_top(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Bounds_3top___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_6Bounds_right(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_6Bounds_5right___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Bounds[] = {
  {(char *)"defined", __pyx_getprop_6osmium_3osm_6Bounds_defined, 0, 0, 0},
  {(char *)"bottom", __pyx_getprop_6osmium_3osm_6Bounds_bottom, 0, 0, 0},
  {(char *)"left", __pyx_getprop_6osmium_3osm_6Bounds_left, 0, 0, 0},
  {(char *)"top", __pyx_getprop_6osmium_3osm_6Bounds_top, 0, 0, 0},
  {(char *)"right", __pyx_getprop_6osmium_3osm_6Bounds_right, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Bounds = {
  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_Bounds = {
  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_Bounds = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Bounds = {
  #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_3osm_Bounds = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Bounds"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Bounds), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Bounds, /*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_Bounds, /*tp_as_number*/
  &__pyx_tp_as_sequence_Bounds, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Bounds, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_6osmium_3osm_6Bounds_2__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Bounds, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  __Pyx_DOCSTR("Bounding box information from the header of an OSM 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_3osm_Bounds, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Bounds, /*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_3osm_Bounds, /*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_3osm_Meta __pyx_vtable_6osmium_3osm_Meta;

static PyObject *__pyx_tp_new_6osmium_3osm_Meta(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm_Meta *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm_Meta *)o);
  p->__pyx_vtab = __pyx_vtabptr_6osmium_3osm_Meta;
  p->bounds = ((struct __pyx_obj_6osmium_3osm_Bounds *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_6osmium_3osm_4Meta___cinit__(o, __pyx_empty_tuple, NULL) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm_Meta(PyObject *o) {
  struct __pyx_obj_6osmium_3osm_Meta *p = (struct __pyx_obj_6osmium_3osm_Meta *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6osmium_3osm_4Meta_2__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->bounds));
  (*Py_TYPE(o)->tp_free)(o);
}

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

static int __pyx_tp_clear_6osmium_3osm_Meta(PyObject *o) {
  struct __pyx_obj_6osmium_3osm_Meta *p = (struct __pyx_obj_6osmium_3osm_Meta *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->bounds);
  p->bounds = ((struct __pyx_obj_6osmium_3osm_Bounds *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6osmium_3osm_4Meta_has_multiple_object_versions(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_4Meta_28has_multiple_object_versions___get__(o);
}

static PyObject *__pyx_getprop_6osmium_3osm_4Meta_bounds(PyObject *o, void *x) {
  return __pyx_pf_6osmium_3osm_4Meta_6bounds___get__(o);
}

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

static struct PyGetSetDef __pyx_getsets_6osmium_3osm_Meta[] = {
  {(char *)"has_multiple_object_versions", __pyx_getprop_6osmium_3osm_4Meta_has_multiple_object_versions, 0, 0, 0},
  {(char *)"bounds", __pyx_getprop_6osmium_3osm_4Meta_bounds, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Meta = {
  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_Meta = {
  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_Meta = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Meta = {
  #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_3osm_Meta = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.Meta"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm_Meta), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm_Meta, /*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_Meta, /*tp_as_number*/
  &__pyx_tp_as_sequence_Meta, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Meta, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pf_6osmium_3osm_4Meta_3__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Meta, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Meta information from the header of an OSM file.\n    "), /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm_Meta, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm_Meta, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm_Meta, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6osmium_3osm_Meta, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6osmium_3osm_4Meta_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6osmium_3osm_Meta, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_Generator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_Generator_object *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_Generator_object *)o);
  p->exc_type = 0;
  p->exc_value = 0;
  p->exc_traceback = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(PyObject *o) {
  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
  Py_XDECREF(p->exc_type);
  Py_XDECREF(p->exc_value);
  Py_XDECREF(p->exc_traceback);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_Generator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
  if (p->exc_type) {
    e = (*v)(p->exc_type, a); if (e) return e;
  }
  if (p->exc_value) {
    e = (*v)(p->exc_value, a); if (e) return e;
  }
  if (p->exc_traceback) {
    e = (*v)(p->exc_traceback, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_Generator(PyObject *o) {
  struct __pyx_Generator_object *p = (struct __pyx_Generator_object *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->exc_type);
  p->exc_type = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->exc_value);
  p->exc_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->exc_traceback);
  p->exc_traceback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6osmium_3osm___pyx_Generator[] = {
  {__Pyx_NAMESTR("send"), (PyCFunction)__Pyx_Generator_Send, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("close"), (PyCFunction)__Pyx_Generator_Close, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("throw"), (PyCFunction)__Pyx_Generator_Throw, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___pyx_Generator = {
  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___pyx_Generator = {
  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___pyx_Generator = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_Generator = {
  #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_Generator_type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_Generator"), /*tp_name*/
  sizeof(struct __pyx_Generator_object), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator, /*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___pyx_Generator, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_Generator, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_Generator, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_Generator, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_Generator, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_Generator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  PyObject_SelfIter, /*tp_iter*/
  __Pyx_Generator_Next, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_Generator, /*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_3osm___pyx_Generator, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *p;
  PyObject *o = __pyx_tp_new_6osmium_3osm___pyx_Generator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *)o);
  p->__pyx_v_self = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_self));
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *)o;
  e = __pyx_tp_traverse_6osmium_3osm___pyx_Generator(o, v, a); if (e) return e;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_scope_struct____iter__(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__ *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_3osm___pyx_Generator(o);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct____iter__ = {
  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___pyx_scope_struct____iter__ = {
  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___pyx_scope_struct____iter__ = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct____iter__ = {
  #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_3osm___pyx_scope_struct____iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_scope_struct____iter__"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm___pyx_scope_struct____iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct____iter__, /*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___pyx_scope_struct____iter__, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct____iter__, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct____iter__, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct____iter__, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct____iter__, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_scope_struct____iter__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_scope_struct____iter__, /*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_3osm___pyx_scope_struct____iter__, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *p;
  PyObject *o = __pyx_tp_new_6osmium_3osm___pyx_Generator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *)o);
  p->__pyx_v_self = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_self));
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *)o;
  e = __pyx_tp_traverse_6osmium_3osm___pyx_Generator(o, v, a); if (e) return e;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__ *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_3osm___pyx_Generator(o);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_1___iter__ = {
  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___pyx_scope_struct_1___iter__ = {
  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___pyx_scope_struct_1___iter__ = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_1___iter__ = {
  #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_3osm___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_scope_struct_1___iter__"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_1___iter__, /*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___pyx_scope_struct_1___iter__, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_1___iter__, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_1___iter__, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_1___iter__, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_1___iter__, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_1___iter__, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_scope_struct_1___iter__, /*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_3osm___pyx_scope_struct_1___iter__, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_scope_struct_2_keys(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *p;
  PyObject *o = __pyx_tp_new_6osmium_3osm___pyx_Generator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *)o);
  p->__pyx_v_self = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_2_keys(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_self));
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_2_keys(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *)o;
  e = __pyx_tp_traverse_6osmium_3osm___pyx_Generator(o, v, a); if (e) return e;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_2_keys(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_3osm___pyx_Generator(o);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_2_keys = {
  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___pyx_scope_struct_2_keys = {
  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___pyx_scope_struct_2_keys = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_2_keys = {
  #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_3osm___pyx_scope_struct_2_keys = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_scope_struct_2_keys"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_2_keys), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_2_keys, /*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___pyx_scope_struct_2_keys, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_2_keys, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_2_keys, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_2_keys, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_2_keys, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_2_keys, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_scope_struct_2_keys, /*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_3osm___pyx_scope_struct_2_keys, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_scope_struct_3_values(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *p;
  PyObject *o = __pyx_tp_new_6osmium_3osm___pyx_Generator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *)o);
  p->__pyx_v_self = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_3_values(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_self));
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_3_values(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *)o;
  e = __pyx_tp_traverse_6osmium_3osm___pyx_Generator(o, v, a); if (e) return e;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_3_values(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_3osm___pyx_Generator(o);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_3_values = {
  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___pyx_scope_struct_3_values = {
  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___pyx_scope_struct_3_values = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_3_values = {
  #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_3osm___pyx_scope_struct_3_values = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_scope_struct_3_values"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_3_values), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_3_values, /*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___pyx_scope_struct_3_values, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_3_values, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_3_values, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_3_values, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_3_values, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_3_values, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_scope_struct_3_values, /*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_3osm___pyx_scope_struct_3_values, /*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 PyObject *__pyx_tp_new_6osmium_3osm___pyx_scope_struct_4_items(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *p;
  PyObject *o = __pyx_tp_new_6osmium_3osm___pyx_Generator(t, a, k);
  if (!o) return 0;
  p = ((struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *)o);
  p->__pyx_v_self = 0;
  return o;
}

static void __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_4_items(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *)o;
  Py_XDECREF(((PyObject *)p->__pyx_v_self));
  __pyx_tp_dealloc_6osmium_3osm___pyx_Generator(o);
}

static int __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_4_items(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *)o;
  e = __pyx_tp_traverse_6osmium_3osm___pyx_Generator(o, v, a); if (e) return e;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_4_items(PyObject *o) {
  struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *p = (struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items *)o;
  PyObject* tmp;
  __pyx_tp_clear_6osmium_3osm___pyx_Generator(o);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyNumberMethods __pyx_tp_as_number___pyx_scope_struct_4_items = {
  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___pyx_scope_struct_4_items = {
  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___pyx_scope_struct_4_items = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___pyx_scope_struct_4_items = {
  #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_3osm___pyx_scope_struct_4_items = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("osmium.osm.__pyx_scope_struct_4_items"), /*tp_name*/
  sizeof(struct __pyx_obj_6osmium_3osm___pyx_scope_struct_4_items), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6osmium_3osm___pyx_scope_struct_4_items, /*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___pyx_scope_struct_4_items, /*tp_as_number*/
  &__pyx_tp_as_sequence___pyx_scope_struct_4_items, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___pyx_scope_struct_4_items, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer___pyx_scope_struct_4_items, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6osmium_3osm___pyx_scope_struct_4_items, /*tp_traverse*/
  __pyx_tp_clear_6osmium_3osm___pyx_scope_struct_4_items, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6osmium_3osm___pyx_scope_struct_4_items, /*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_3osm___pyx_scope_struct_4_items, /*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("osm"),
    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_kp_u_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 1, 0, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_kp_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 0},
  {&__pyx_kp_s_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 0, 1, 0},
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
  {&__pyx_kp_s_17, __pyx_k_17, sizeof(__pyx_k_17), 0, 0, 1, 0},
  {&__pyx_kp_s_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 0, 1, 0},
  {&__pyx_kp_s_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 0, 1, 0},
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
  {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
  {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
  {&__pyx_n_s__KeyError, __pyx_k__KeyError, sizeof(__pyx_k__KeyError), 0, 0, 1, 1},
  {&__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__chr, __pyx_k__chr, sizeof(__pyx_k__chr), 0, 0, 1, 1},
  {&__pyx_n_s__defined, __pyx_k__defined, sizeof(__pyx_k__defined), 0, 0, 1, 1},
  {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
  {&__pyx_n_s__keys, __pyx_k__keys, sizeof(__pyx_k__keys), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_chr = __Pyx_GetName(__pyx_b, __pyx_n_s__chr); if (!__pyx_builtin_chr) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_s__KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants");

  /* "osmium/osm.pyx":150
 *         cdef c_WayNodeList* tmp = _getOsmWayNodeList(self.c_way)
 *         if num >= tmp.size():
 *             raise IndexError('list index out of range')             # <<<<<<<<<<<<<<
 * 
 *         return tmp[0][num].ref()
 */
  __pyx_k_tuple_7 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_7));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_k_tuple_7, 0, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));

  /* "osmium/osm.pyx":192
 *         cdef c_RelationMemberList* c_ml = _getOsmRelMemList(self.c_relation)
 *         if num > c_ml.size():
 *             raise IndexError('list index out of range')             # <<<<<<<<<<<<<<
 *         return (c_ml[0][num].ref(), chr(c_ml[0][num].typ()), (<char*>c_ml[0][num].role()).decode('utf-8'))
 * 
 */
  __pyx_k_tuple_8 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_8));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
  PyTuple_SET_ITEM(__pyx_k_tuple_8, 0, ((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));

  /* "osmium/osm.pyx":270
 * 
 *     def __getitem__(self, key):
 *         cdef bytes key_b = key.encode('utf-8')             # <<<<<<<<<<<<<<
 *         cdef char * res = <char*>_getOsmTagList(self.c_object).get_tag_by_key(key_b)
 *         if res is NULL:
 */
  __pyx_k_tuple_15 = PyTuple_New(1); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_k_tuple_15));
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_2));
  PyTuple_SET_ITEM(__pyx_k_tuple_15, 0, ((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_15));
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

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

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initosm(void); /*proto*/
PyMODINIT_FUNC initosm(void)
#else
PyMODINIT_FUNC PyInit_osm(void); /*proto*/
PyMODINIT_FUNC PyInit_osm(void)
#endif
{
  PyObject *__pyx_t_1 = 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_osm(void)");
  if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __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 = 2; __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 = 2; __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 = 2; __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("osm"), __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 = 2; __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 = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_module_is_main_osmium__osm) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_6osmium_3osm__cache_node = ((struct __pyx_obj_6osmium_3osm_Node *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6osmium_3osm__cache_way = ((struct __pyx_obj_6osmium_3osm_Way *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6osmium_3osm__cache_relation = ((struct __pyx_obj_6osmium_3osm_Relation *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6osmium_3osm__cache_taglist = ((struct __pyx_obj_6osmium_3osm_TagList *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6osmium_3osm__cache_waynodelist = ((struct __pyx_obj_6osmium_3osm_WayNodeList *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6osmium_3osm__cache_relationmemberlist = ((struct __pyx_obj_6osmium_3osm_RelationMemberList *)Py_None); Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  if (__Pyx_ExportVoidPtr("_cache_node", (void *)&__pyx_v_6osmium_3osm__cache_node, "struct __pyx_obj_6osmium_3osm_Node *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportVoidPtr("_cache_way", (void *)&__pyx_v_6osmium_3osm__cache_way, "struct __pyx_obj_6osmium_3osm_Way *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportVoidPtr("_cache_relation", (void *)&__pyx_v_6osmium_3osm__cache_relation, "struct __pyx_obj_6osmium_3osm_Relation *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportVoidPtr("_cache_taglist", (void *)&__pyx_v_6osmium_3osm__cache_taglist, "struct __pyx_obj_6osmium_3osm_TagList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportVoidPtr("_cache_waynodelist", (void *)&__pyx_v_6osmium_3osm__cache_waynodelist, "struct __pyx_obj_6osmium_3osm_WayNodeList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_ExportVoidPtr("_cache_relationmemberlist", (void *)&__pyx_v_6osmium_3osm__cache_relationmemberlist, "struct __pyx_obj_6osmium_3osm_RelationMemberList *") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6osmium_3osm_TagList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "TagList", (PyObject *)&__pyx_type_6osmium_3osm_TagList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_TagList = &__pyx_type_6osmium_3osm_TagList;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_WayNodeList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "WayNodeList", (PyObject *)&__pyx_type_6osmium_3osm_WayNodeList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_WayNodeList = &__pyx_type_6osmium_3osm_WayNodeList;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_RelationMemberList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "RelationMemberList", (PyObject *)&__pyx_type_6osmium_3osm_RelationMemberList) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_RelationMemberList = &__pyx_type_6osmium_3osm_RelationMemberList;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Object", (PyObject *)&__pyx_type_6osmium_3osm_Object) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Object = &__pyx_type_6osmium_3osm_Object;
  __pyx_type_6osmium_3osm_Node.tp_base = __pyx_ptype_6osmium_3osm_Object;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Node) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Node", (PyObject *)&__pyx_type_6osmium_3osm_Node) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Node = &__pyx_type_6osmium_3osm_Node;
  __pyx_type_6osmium_3osm_Way.tp_base = __pyx_ptype_6osmium_3osm_Object;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Way) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Way", (PyObject *)&__pyx_type_6osmium_3osm_Way) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Way = &__pyx_type_6osmium_3osm_Way;
  __pyx_type_6osmium_3osm_Relation.tp_base = __pyx_ptype_6osmium_3osm_Object;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Relation) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Relation", (PyObject *)&__pyx_type_6osmium_3osm_Relation) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Relation = &__pyx_type_6osmium_3osm_Relation;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Bounds) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Bounds", (PyObject *)&__pyx_type_6osmium_3osm_Bounds) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Bounds = &__pyx_type_6osmium_3osm_Bounds;
  __pyx_vtabptr_6osmium_3osm_Meta = &__pyx_vtable_6osmium_3osm_Meta;
  __pyx_vtable_6osmium_3osm_Meta.set_from_c = (PyObject *(*)(struct __pyx_obj_6osmium_3osm_Meta *, Osmium::OSM::Meta &))__pyx_f_6osmium_3osm_4Meta_set_from_c;
  if (PyType_Ready(&__pyx_type_6osmium_3osm_Meta) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6osmium_3osm_Meta.tp_dict, __pyx_vtabptr_6osmium_3osm_Meta) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Meta", (PyObject *)&__pyx_type_6osmium_3osm_Meta) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm_Meta = &__pyx_type_6osmium_3osm_Meta;
  if (PyType_Ready(&__pyx_Generator_type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_Generator = &__pyx_Generator_type;
  __pyx_type_6osmium_3osm___pyx_scope_struct____iter__.tp_base = __pyx_ptype_6osmium_3osm___pyx_Generator;
  if (PyType_Ready(&__pyx_type_6osmium_3osm___pyx_scope_struct____iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_scope_struct____iter__ = &__pyx_type_6osmium_3osm___pyx_scope_struct____iter__;
  __pyx_type_6osmium_3osm___pyx_scope_struct_1___iter__.tp_base = __pyx_ptype_6osmium_3osm___pyx_Generator;
  if (PyType_Ready(&__pyx_type_6osmium_3osm___pyx_scope_struct_1___iter__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_scope_struct_1___iter__ = &__pyx_type_6osmium_3osm___pyx_scope_struct_1___iter__;
  __pyx_type_6osmium_3osm___pyx_scope_struct_2_keys.tp_base = __pyx_ptype_6osmium_3osm___pyx_Generator;
  if (PyType_Ready(&__pyx_type_6osmium_3osm___pyx_scope_struct_2_keys) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_scope_struct_2_keys = &__pyx_type_6osmium_3osm___pyx_scope_struct_2_keys;
  __pyx_type_6osmium_3osm___pyx_scope_struct_3_values.tp_base = __pyx_ptype_6osmium_3osm___pyx_Generator;
  if (PyType_Ready(&__pyx_type_6osmium_3osm___pyx_scope_struct_3_values) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_scope_struct_3_values = &__pyx_type_6osmium_3osm___pyx_scope_struct_3_values;
  __pyx_type_6osmium_3osm___pyx_scope_struct_4_items.tp_base = __pyx_ptype_6osmium_3osm___pyx_Generator;
  if (PyType_Ready(&__pyx_type_6osmium_3osm___pyx_scope_struct_4_items) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6osmium_3osm___pyx_scope_struct_4_items = &__pyx_type_6osmium_3osm___pyx_scope_struct_4_items;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "osmium/osm.pyx":384
 *         return res
 * 
 * _cache_node = Node()             # <<<<<<<<<<<<<<
 * _cache_way = Way()
 * _cache_taglist = TagList()
 */
  __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 = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_node));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_node));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_node = ((struct __pyx_obj_6osmium_3osm_Node *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":385
 * 
 * _cache_node = Node()
 * _cache_way = Way()             # <<<<<<<<<<<<<<
 * _cache_taglist = TagList()
 * _cache_waynodelist = WayNodeList()
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Way)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_way));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_way));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_way = ((struct __pyx_obj_6osmium_3osm_Way *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":386
 * _cache_node = Node()
 * _cache_way = Way()
 * _cache_taglist = TagList()             # <<<<<<<<<<<<<<
 * _cache_waynodelist = WayNodeList()
 * _cache_relation = Relation()
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_TagList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_taglist));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_taglist));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_taglist = ((struct __pyx_obj_6osmium_3osm_TagList *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":387
 * _cache_way = Way()
 * _cache_taglist = TagList()
 * _cache_waynodelist = WayNodeList()             # <<<<<<<<<<<<<<
 * _cache_relation = Relation()
 * _cache_relationmemberlist = RelationMemberList()
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_WayNodeList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_waynodelist));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_waynodelist = ((struct __pyx_obj_6osmium_3osm_WayNodeList *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":388
 * _cache_taglist = TagList()
 * _cache_waynodelist = WayNodeList()
 * _cache_relation = Relation()             # <<<<<<<<<<<<<<
 * _cache_relationmemberlist = RelationMemberList()
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_Relation)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relation));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relation));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_relation = ((struct __pyx_obj_6osmium_3osm_Relation *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":389
 * _cache_waynodelist = WayNodeList()
 * _cache_relation = Relation()
 * _cache_relationmemberlist = RelationMemberList()             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6osmium_3osm_RelationMemberList)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist));
  __Pyx_DECREF(((PyObject *)__pyx_v_6osmium_3osm__cache_relationmemberlist));
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_v_6osmium_3osm__cache_relationmemberlist = ((struct __pyx_obj_6osmium_3osm_RelationMemberList *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "osmium/osm.pyx":2
 * 
 * from c_osmium.osm cimport ConstObjectPtr, ConstRelationPtr, Object as c_Object, Node as c_Node, TagList as c_TagList, TagListIterator as c_TagListIterator, Way as c_Way, Relation as c_Relation, WayNodeList as c_WayNodeList, WayNodeListIterator as c_WayNodeListIterator, RelationMemberList as c_RelationMemberList, RelationMemberListIterator as c_RelationMemberListIterator, castWayPtr, castRelationPtr             # <<<<<<<<<<<<<<
 * from cpython.ref cimport PyObject
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  if (__pyx_m) {
    __Pyx_AddTraceback("init osmium.osm", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init osmium.osm");
  }
  __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 PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result) {
        if (dict != __pyx_b) {
            PyErr_Clear();
            result = PyObject_GetAttr(__pyx_b, name);
        }
        if (!result) {
            PyErr_SetObject(PyExc_NameError, name);
        }
    }
    return result;
}

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 CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    /* cause is unused */
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }

    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

#else /* Python 3+ */

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;

    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (!PyExceptionClass_Check(type)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }

    if (cause) {
        PyObject *fixed_cause;
        if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        }
        else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        }
        else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        if (!value) {
            value = PyObject_CallObject(type, NULL);
        }
        PyException_SetCause(value, fixed_cause);
    }

    PyErr_SetObject(type, value);

    if (tb) {
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
    }

bad:
    return;
}
#endif

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_object_id_t(osm_object_id_t val) {
    const osm_object_id_t neg_one = (osm_object_id_t)-1, const_zero = (osm_object_id_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(osm_object_id_t) == sizeof(char))  ||
        (sizeof(osm_object_id_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(osm_object_id_t) == sizeof(int)) ||
               (sizeof(osm_object_id_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(osm_object_id_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(osm_object_id_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_version_t(osm_version_t val) {
    const osm_version_t neg_one = (osm_version_t)-1, const_zero = (osm_version_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(osm_version_t) == sizeof(char))  ||
        (sizeof(osm_version_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(osm_version_t) == sizeof(int)) ||
               (sizeof(osm_version_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(osm_version_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(osm_version_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_changeset_id_t(osm_changeset_id_t val) {
    const osm_changeset_id_t neg_one = (osm_changeset_id_t)-1, const_zero = (osm_changeset_id_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(osm_changeset_id_t) == sizeof(char))  ||
        (sizeof(osm_changeset_id_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(osm_changeset_id_t) == sizeof(int)) ||
               (sizeof(osm_changeset_id_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(osm_changeset_id_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(osm_changeset_id_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_osm_user_id_t(osm_user_id_t val) {
    const osm_user_id_t neg_one = (osm_user_id_t)-1, const_zero = (osm_user_id_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(osm_user_id_t) == sizeof(char))  ||
        (sizeof(osm_user_id_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(osm_user_id_t) == sizeof(int)) ||
               (sizeof(osm_user_id_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(osm_user_id_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(osm_user_id_t),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_time_t(time_t val) {
    const time_t neg_one = (time_t)-1, const_zero = (time_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(time_t) == sizeof(char))  ||
        (sizeof(time_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(time_t) == sizeof(int)) ||
               (sizeof(time_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(time_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        return _PyLong_FromByteArray(bytes, sizeof(time_t),
                                     little, !is_unsigned);
    }
}

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 CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;

    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;

    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}

static CYTHON_INLINE void __Pyx_Generator_ExceptionClear(struct __pyx_Generator_object *self)
{
    Py_XDECREF(self->exc_type);
    Py_XDECREF(self->exc_value);
    Py_XDECREF(self->exc_traceback);

    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
}

static CYTHON_INLINE PyObject *__Pyx_Generator_SendEx(struct __pyx_Generator_object *self, PyObject *value)
{
    PyObject *retval;

    if (self->is_running) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return NULL;
    }

    if (self->resume_label == 0) {
        if (value && value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }

    if (self->resume_label == -1) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }


    if (value)
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
    else
        __Pyx_Generator_ExceptionClear(self);

    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;

    if (retval)
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value, &self->exc_traceback);
    else
        __Pyx_Generator_ExceptionClear(self);

    return retval;
}

static PyObject *__Pyx_Generator_Next(PyObject *self)
{
    return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, Py_None);
}

static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value)
{
    return __Pyx_Generator_SendEx((struct __pyx_Generator_object *) self, value);
}

static PyObject *__Pyx_Generator_Close(PyObject *self)
{
    struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
    PyObject *retval;
#if PY_VERSION_HEX < 0x02050000
    PyErr_SetNone(PyExc_StopIteration);
#else
    PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_SendEx(generator, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
#if PY_VERSION_HEX < 0x02050000
    if (PyErr_ExceptionMatches(PyExc_StopIteration))
#else
    if (PyErr_ExceptionMatches(PyExc_StopIteration)
        || PyErr_ExceptionMatches(PyExc_GeneratorExit))
#endif
    {
        PyErr_Clear();          /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}

static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args, CYTHON_UNUSED PyObject *kwds)
{
    struct __pyx_Generator_object *generator = (struct __pyx_Generator_object *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;

    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(generator, NULL);
}

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;
}

static int __Pyx_ExportVoidPtr(const char *name, void *p, const char *sig) {
    PyObject *d = 0;
    PyObject *cobj = 0;

    d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
            goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    cobj = PyCapsule_New(p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItemString(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

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;
}

#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 */
