# -*- moding: utf-8 -*-
"""
Module OSMParser

.. currentmodule:: pylayers.gis.osmparser

.. autosummary::

"""
from osmapi import OsmApi
import geocoder as geo
import sys
import urllib

if sys.version_info.major == 2:
    from  urllib2 import urlopen
else:
    from  urllib.request import urlopen

from pylayers.util.project import *
import pylayers.util.pyutil as pyu
import pylayers.util.geomutil as geu
from mpl_toolkits.basemap import Basemap
from matplotlib.collections import PolyCollection
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import xml.etree.ElementTree as xml

import pdb

# classes that handle the OSM data file format.
class Way(object):
    """

    A Way is a polyline or a Polygon (if closed)

    typ : 0 Polygon
          1 LineString

    """
    def __init__(self, refs, tags, coords):
        """ object constructor

        Parameters
        ----------

        refs  :
        tags  :
        coords :
        nodes_sign : int