Beispiel #1
0
    def execute_xml(self):
        doc = WPS.Output(
            OWS.Identifier(self.identifier),
            OWS.Title(self.title)
        )

        if self.abstract:
            doc.append(OWS.Abstract(self.abstract))

        if self.keywords:
            kws = map(OWS.Keyword, self.keywords)
            doc.append(OWS.Keywords(*kws))

        data_doc = WPS.Data()
        bbox_data_doc = OWS.BoundingBox()

        bbox_data_doc.attrib['crs'] = self.crs
        bbox_data_doc.attrib['dimensions'] = str(self.dimensions)

        bbox_data_doc.append(OWS.LowerCorner('{0[0]} {0[1]}'.format(self.data)))
        bbox_data_doc.append(OWS.UpperCorner('{0[2]} {0[3]}'.format(self.data)))

        data_doc.append(bbox_data_doc)
        doc.append(data_doc)
        return doc
Beispiel #2
0
    def execute_xml_lineage(self):
        doc = WPS.Output(OWS.Identifier(self.identifier),
                         OWS.Title(self.title))

        if self.abstract:
            doc.append(OWS.Abstract(self.abstract))

        return doc
Beispiel #3
0
    def execute_xml_lineage(self):
        doc = WPS.Output(
            OWS.Identifier(self.identifier),
            OWS.Title(self.title)
        )

        if self.abstract:
            doc.append(OWS.Abstract(self.abstract))

        if self.keywords:
            kws = map(OWS.Keyword, self.keywords)
            doc.append(OWS.Keywords(*kws))

        return doc
Beispiel #4
0
 def test_wcs(self):
     try:
         sys.path.append("/usr/lib/grass64/etc/python/")
         import grass.script as grass
     except:
         self.skipTest('GRASS lib not found')
     client = client_for(Service(processes=[create_sum_one()]))
     request_doc = WPS.Execute(
         OWS.Identifier('sum_one'),
         WPS.DataInputs(
             WPS.Input(
                 OWS.Identifier('input'),
                 WPS.Reference(href=wcsResource, mimeType='image/tiff'))),
         WPS.ProcessOutputs(WPS.Output(OWS.Identifier('output'))),
         version='1.0.0')
     resp = client.post_xml(doc=request_doc)
     assert_response_success(resp)
Beispiel #5
0
    def test_wfs(self):
        client = client_for(Service(processes=[create_feature()]))
        request_doc = WPS.Execute(
            OWS.Identifier('feature'),
            WPS.DataInputs(
                WPS.Input(
                    OWS.Identifier('input'),
                    WPS.Reference(
                        {'{http://www.w3.org/1999/xlink}href': wfsResource},
                        mimeType=FORMATS.GML.mime_type,
                        encoding='',
                        schema=''))),
            WPS.ProcessOutputs(WPS.Output(OWS.Identifier('output'))),
            version='1.0.0')
        resp = client.post_xml(doc=request_doc)

        assert_response_success(resp)
Beispiel #6
0
    def execute_xml(self):
        doc = WPS.Output(OWS.Identifier(self.identifier),
                         OWS.Title(self.title))

        if self.abstract:
            doc.append(OWS.Abstract(self.abstract))

        data_doc = WPS.Data()

        literal_data_doc = WPS.LiteralData(text_type(self.data))
        literal_data_doc.attrib['dataType'] = OGCTYPE[self.data_type]
        if self.uom:
            literal_data_doc.attrib['uom'] = self.uom.execute_attribute()
        data_doc.append(literal_data_doc)

        doc.append(data_doc)

        return doc
Beispiel #7
0
    def execute_xml(self):
        """Render Execute response XML node

        :return: node
        :rtype: ElementMaker
        """

        self.identifier

        node = None
        if self.as_reference:
            node = self._execute_xml_reference()
        else:
            node = self._execute_xml_data()

        doc = WPS.Output(OWS.Identifier(self.identifier),
                         OWS.Title(self.title))
        if self.abstract:
            doc.append(OWS.Abstract(self.abstract))
        doc.append(node)

        return doc