owslib/feature/schema.py
def get_schema(url, typename, version='1.0.0', timeout=30, username=None, password=None):
    """Parses DescribeFeatureType response and creates schema compatible
    with :class:`fiona`

    :param str url: url of the service
    :param str version: version of the service
    :param str typename: name of the layer
    :param int timeout: request timeout
    """

    url = _get_describefeaturetype_url(url, version, typename)
    res = openURL(url, timeout=timeout, username=username, password=password)
    root = etree.fromstring(res.read())

    if ':' in typename:
        typename = typename.split(':')[1]
    type_element = findall(root, '{%s}element' % XS_NAMESPACE,
                           attribute_name='name', attribute_value=typename)[0]
    complex_type = type_element.attrib['type'].split(":")[1]
    elements = _get_elements(complex_type, root)
    nsmap = None
    if hasattr(root, 'nsmap'):
        nsmap = root.nsmap
    return _construct_schema(elements, nsmap)
def get_schema(url, typename, version='1.0.0', timeout=30, username=None, password=None):
    """Parses DescribeFeatureType response and creates schema compatible
    with :class:`fiona`

    :param str url: url of the service
    :param str version: version of the service
    :param str typename: name of the layer
    :param int timeout: request timeout
    """

    url = _get_describefeaturetype_url(url, version, typename)
    res = openURL(url, timeout=timeout, username=username, password=password)
    root = etree.fromstring(res.read())

    if ':' in typename:
        typename = typename.split(':')[1]
    type_element = findall(root, '{%s}element' % XS_NAMESPACE,
                           attribute_name='name', attribute_value=typename)[0]
    complex_type = type_element.attrib['type'].split(":")[1]
    elements = _get_elements(complex_type, root)
    nsmap = None
    if hasattr(root, 'nsmap'):
        nsmap = root.nsmap
    return _construct_schema(elements, nsmap)
def get_schema ( url , typename , version = '1.0.0' , timeout = 30 , username = None , password = None ) : url = _get_describefeaturetype_url ( url , version , typename ) res = openURL ( url , timeout = timeout , username = username , password = password ) root = etree . fromstring ( res . read ( ) ) if ':' in typename : typename = typename . split ( ':' ) [ 1 ] type_element = findall ( root , '{%s}element' % XS_NAMESPACE , attribute_name = 'name' , attribute_value = typename ) [ 0 ] complex_type = type_element . attrib [ 'type' ] . split ( ":" ) [ 1 ] elements = _get_elements ( complex_type , root ) nsmap = None if hasattr ( root , 'nsmap' ) : nsmap = root . nsmap return _construct_schema ( elements , nsmap )
Parses DescribeFeatureType response and creates schema compatible
    with :class:`fiona`

    :param str url: url of the service
    :param str version: version of the service
    :param str typename: name of the layer
    :param int timeout: request timeout
Parses DescribeFeatureType response and creates schema compatible with : class : fiona