def describe_xml(self): doc = E.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)) for m in self.metadata: doc.append(OWS.Metadata(dict(m))) bbox_data_doc = E.BoundingBoxOutput() doc.append(bbox_data_doc) default_doc = E.Default() default_doc.append(E.CRS(self.crss[0])) supported_doc = E.Supported() for c in self.crss: supported_doc.append(E.CRS(c)) bbox_data_doc.append(default_doc) bbox_data_doc.append(supported_doc) return doc
def describe_xml(self): """Generate DescribeProcess element """ default_format_el = self.supported_formats[0].describe_xml() supported_format_elements = [f.describe_xml() for f in self.supported_formats] doc = E.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)) for m in self.metadata: doc.append(OWS.Metadata(dict(m))) doc.append( E.ComplexOutput( E.Default(default_format_el), E.Supported(*supported_format_elements) ) ) return doc
def describe_xml(self): doc = E.Output(OWS.Identifier(self.identifier), OWS.Title(self.title)) if self.abstract: doc.append(OWS.Abstract(self.abstract)) for m in self.metadata: doc.append(OWS.Metadata(m)) literal_data_doc = E.LiteralOutput() if self.data_type: data_type = OWS.DataType(self.data_type) data_type.attrib['{%s}reference' % NAMESPACES['ows']] = OGCTYPE[self.data_type] literal_data_doc.append(data_type) if self.uoms: default_uom_element = self.uom.describe_xml() supported_uom_elements = [u.describe_xml() for u in self.uoms] literal_data_doc.append( E.UOMs(E.Default(default_uom_element), E.Supported(*supported_uom_elements))) doc.append(literal_data_doc) return doc
def execute_xml(self): doc = E.Output(OWS.Identifier(self.identifier), OWS.Title(self.title)) if self.abstract: doc.append(OWS.Abstract(self.abstract)) 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))) doc.append(bbox_data_doc) return doc