示例#1
0
文件: dovutil.py 项目: meisty/pydov
def get_xsd_schema(url):
    """Request the XSD schema from DOV webservices and return it.

    Parameters
    ----------
    url : str
        URL of the XSD schema to download.

    Returns
    -------
    xml : bytes
        The raw XML data of this XSD schema as bytes.

    """
    response = HookRunner.execute_inject_meta_response(url)

    if response is None:
        response = get_remote_url(url)

    HookRunner.execute_meta_received(url, response)

    return response
示例#2
0
    def _init_wfs(self):
        """Initialise the WFS service. If the WFS service is not
        instantiated yet, do so and save it in a static variable available
        to all subclasses and instances.
        """
        if AbstractSearch.__wfs is None:

            capabilities = HookRunner.execute_inject_meta_response(
                build_dov_url('geoserver/wfs') + '?version=1.1.0')

            if capabilities is None:
                AbstractSearch.__wfs = WebFeatureService(
                    url=build_dov_url('geoserver/wfs'), version="1.1.0")
            else:
                AbstractSearch.__wfs = WebFeatureService(
                    url=build_dov_url('geoserver/wfs'),
                    version="1.1.0",
                    xml=capabilities)

            HookRunner.execute_meta_received(
                build_dov_url('geoserver/wfs') + '?version=1.1.0',
                etree.tostring(AbstractSearch.__wfs._capabilities,
                               encoding='utf8'))