# Path: lib/exception.py
# class DataException(Exception):
# 
#     def __init__(self, message):
#         # Call the base class constructor with the parameters it needs
#         super(DataException, self).__init__(message)
#         self.returncode = 2
#         logg = Logger('DataException')
#         logg.error(message)
# 
# Path: lib/metrics.py
# class CHaMPMetric(object):
# 
#     # This is the dictionary representation of the object
#     # in its null state.
#     TEMPLATE = {}
# 
#     def __init__(self, *args, **kwargs):
#         # First initialize our logger and our empty metrics
#         self.log = Logger(self.__module__)
#         self.metrics = deepcopy(self.TEMPLATE)
# 
#         # Now try a calculation
#         try:
#             self.calc(*args, **kwargs)
#         except (DataException, MissingException), e:
#             self.log.warning("Could not complete metric calculation")
#             self.metrics = deepcopy(self.TEMPLATE)
# 
#     def calc(self, *args, **kwargs):
#         """
#         Needs to be overloaded in the children
#         :return:
#         """
#         raise Exception("YOU MUST IMPLEMENT THIS")


import sys
    import argparse
    import logging
from os import path
from lib.shapefileloader import *
from lib.exception import DataException
from lib.metrics import CHaMPMetric
from copy import copy
sys.path.append(path.abspath(path.join(path.dirname(__file__), "../../..")))

class CenterlineMetrics(CHaMPMetric):

    TEMPLATE = {
        'ChannelCount': None,
        'MainstemCount': None,
        'MainstemLength': None,
        'MainstemSinuosity': None,
        'SideChannelCount': None,
        'SideChannelLength': None,
        'TotalChannelLength': None,
        'AverageSideChannelLength': None,

# Path: lib/exception.py
# class DataException(Exception):
# 
#     def __init__(self, message):
#         # Call the base class constructor with the parameters it needs
#         super(DataException, self).__init__(message)
#         self.returncode = 2
#         logg = Logger('DataException')
#         logg.error(message)
# 
# Path: lib/metrics.py
# class CHaMPMetric(object):
# 
#     # This is the dictionary representation of the object
#     # in its null state.
#     TEMPLATE = {}
# 
#     def __init__(self, *args, **kwargs):
#         # First initialize our logger and our empty metrics
#         self.log = Logger(self.__module__)
#         self.metrics = deepcopy(self.TEMPLATE)
# 
#         # Now try a calculation
#         try:
#             self.calc(*args, **kwargs)
#         except (DataException, MissingException), e:
#             self.log.warning("Could not complete metric calculation")
#             self.metrics = deepcopy(self.TEMPLATE)
# 
#     def calc(self, *args, **kwargs):
#         """
#         Needs to be overloaded in the children
#         :return:
#         """
#         raise Exception("YOU MUST IMPLEMENT THIS")


# Path: tools/topometrics/methods/centerline.py
import sys
    import argparse
    import logging
from os import path
from lib.shapefileloader import *
from lib.exception import DataException
from lib.metrics import CHaMPMetric
from copy import copy

sys.path.append(path.abspath(path.join(path.dirname(__file__), "../../..")))

class CenterlineMetrics(CHaMPMetric):

    TEMPLATE = {
        'ChannelCount': None,
        'MainstemCount': None,
        'MainstemLength': None,
        'MainstemSinuosity': None,
        'SideChannelCount': None,
        'SideChannelLength': None,
        'TotalChannelLength': None,
        'AverageSideChannelLength': None,

        'Braidedness': None,