# Path: muninn/enum.py
# class MetaEnum(type):
#     def __new__(meta, name, bases, dct):
#     def count(cls):
#     def valid(cls, value):
#     def items(cls):
#     def to_string(cls, value):
#     def from_string(cls, value):
# 
# Path: muninn/visitor.py
# class Visitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type_ in inspect.getmro(type(visitable)):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type_.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


import sys
import struct
from muninn.enum import Enum
from muninn.exceptions import *
from muninn.geometry import *
from muninn.visitor import Visitor
            wkb += self.visit(visitable.point(0), False)
        return self._encode_tag(GeometryType.LINESTRING) + wkb if tagged else wkb

    def visit_Polygon(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.visit(ring, False) for ring in visitable])
        return self._encode_tag(GeometryType.POLYGON) + wkb if tagged else wkb

    def visit_MultiPoint(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(point, True) for point in visitable])
        return self._encode_tag(GeometryType.MULTIPOINT) + wkb if tagged else wkb

    def visit_MultiLineString(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(line_string, True) for line_string in visitable])
        return self._encode_tag(GeometryType.MULTILINESTRING) + wkb if tagged else wkb

    def visit_MultiPolygon(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(polygon, True) for polygon in visitable])
        return self._encode_tag(GeometryType.MULTIPOLYGON) + wkb if tagged else wkb

    def default(self, visitable, tagged):
        raise Error("unsupported type: %s" % type(visitable).__name__)

    def _encode_tag(self, wkb_type):
        return self._encode("I", wkb_type)

    def _encode(self, format, *args):

# Path: muninn/enum.py
# class MetaEnum(type):
#     def __new__(meta, name, bases, dct):
#     def count(cls):
#     def valid(cls, value):
#     def items(cls):
#     def to_string(cls, value):
#     def from_string(cls, value):
# 
# Path: muninn/visitor.py
# class Visitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type_ in inspect.getmro(type(visitable)):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type_.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


# Path: muninn/database/blobgeometry.py
import sys
import struct
from muninn.enum import Enum
from muninn.exceptions import *
from muninn.geometry import *
from muninn.visitor import Visitor

            wkb += self.visit(visitable.point(0), False)
        return self._encode_tag(GeometryType.LINESTRING) + wkb if tagged else wkb

    def visit_Polygon(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.visit(ring, False) for ring in visitable])
        return self._encode_tag(GeometryType.POLYGON) + wkb if tagged else wkb

    def visit_MultiPoint(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(point, True) for point in visitable])
        return self._encode_tag(GeometryType.MULTIPOINT) + wkb if tagged else wkb

    def visit_MultiLineString(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(line_string, True) for line_string in visitable])
        return self._encode_tag(GeometryType.MULTILINESTRING) + wkb if tagged else wkb

    def visit_MultiPolygon(self, visitable, tagged):
        wkb = self._encode("I", len(visitable))
        wkb += b"".join([self.entity + self.visit(polygon, True) for polygon in visitable])
        return self._encode_tag(GeometryType.MULTIPOLYGON) + wkb if tagged else wkb

    def default(self, visitable, tagged):
        raise Error("unsupported type: %s" % type(visitable).__name__)

    def _encode_tag(self, wkb_type):
        return self._encode("I", wkb_type)

    def _encode(self, format, *args):

        try: