diff --git a/owslib/sos.py b/owslib/sos.py index c3e15d1e7..15a496d68 100644 --- a/owslib/sos.py +++ b/owslib/sos.py @@ -16,10 +16,25 @@ from .swe.observation import sos100, sos200 -def SensorObservationService(url, version='1.0.0', xml=None): - """sos factory function, returns a version specific SensorObservationService object""" - if version in ['1.0', '1.0.0']: - return sos100.SensorObservationService_1_0_0.__new__(sos100.SensorObservationService_1_0_0, url, version, xml) +def SensorObservationService(url, + version='1.0.0', + xml=None, + username=None, + password=None,): + """ + SOS factory function + :param url: url of capabilities document + :param version: SOS version 1.0.0 or 2.0.0 + :param xml: elementtree object + :param username: username allowed to handle with SOS + :param password: password for the username + :return: a version specific SensorObservationService object + """ + if version in ['1.0', '1.0.0']: + return sos100.SensorObservationService_1_0_0.__new__( + sos100.SensorObservationService_1_0_0, url, version, + xml, username, password) elif version in ['2.0', '2.0.0']: - return sos200.SensorObservationService_2_0_0.__new__(sos200.SensorObservationService_2_0_0, url, version, xml) - + return sos200.SensorObservationService_2_0_0.__new__( + sos200.SensorObservationService_2_0_0, url, version, + xml, username, password) diff --git a/owslib/swe/observation/sos100.py b/owslib/swe/observation/sos100.py index 792058236..9bf9f0e0c 100644 --- a/owslib/swe/observation/sos100.py +++ b/owslib/swe/observation/sos100.py @@ -27,7 +27,7 @@ class SensorObservationService_1_0_0(object): Implements ISensorObservationService. """ - def __new__(self,url, version, xml=None, username=None, password=None): + def __new__(self, url, version, xml=None, username=None, password=None): """overridden __new__ method""" obj=object.__new__(self) obj.__init__(url, version, xml, username, password)