File: wfs.py

package info (click to toggle)
qgis 2.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 374,696 kB
  • ctags: 66,263
  • sloc: cpp: 396,139; ansic: 241,070; python: 130,609; xml: 14,884; perl: 1,290; sh: 1,287; sql: 500; yacc: 268; lex: 242; makefile: 168
file content (34 lines) | stat: -rw-r--r-- 1,374 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding: ISO-8859-15 -*-
# =============================================================================
# Copyright (c) 2004, 2006 Sean C. Gillies
# Copyright (c) 2009 STFC <http://www.stfc.ac.uk>
#
# Authors : 
#          Dominic Lowe <dominic.lowe@stfc.ac.uk>
#
# Contact email: dominic.lowe@stfc.ac.uk
# =============================================================================

"""
Web Feature Server (WFS) methods and metadata. Factory function.
"""

from feature import wfs100, wfs110, wfs200 
def WebFeatureService(url, version='1.0.0', xml=None, parse_remote_metadata=False):
    ''' wfs factory function, returns a version specific WebFeatureService object
    
    @type url: string
    @param url: url of WFS capabilities document
    @type xml: string
    @param xml: elementtree object
    @type parse_remote_metadata: boolean
    @param parse_remote_metadata: whether to fully process MetadataURL elements
    @return: initialized WebFeatureService_2_0_0 object
    '''
    if version in  ['1.0', '1.0.0']:
        return wfs100.WebFeatureService_1_0_0(url, version, xml, parse_remote_metadata)
    elif version in  ['1.1', '1.1.0']:
        return wfs110.WebFeatureService_1_1_0(url, version, xml, parse_remote_metadata)
    elif version in ['2.0', '2.0.0']:
        return wfs200.WebFeatureService_2_0_0(url,  version, xml, parse_remote_metadata)