def to_string(self, gml_doc, pretty_print=True, xml_declaration=True, encoding='utf-8'): return etree.tostring(gml_doc, pretty_print=pretty_print, xml_declaration=xml_declaration, encoding=encoding)
def to_string(self, args=dict): if self.data is None: return '' # TODO: jumptable if self.format == FORMAT.etree_doc: s = etree.tostring(self.data, pretty_print=True, xml_declaration=True, encoding='utf-8') elif self.format == FORMAT.struct or self.format == FORMAT.geojson_collection or self.format == FORMAT.geojson_feature: s = json.dumps(self.data, sort_keys=False, indent=4, separators=(',', ': ')) elif self.format == FORMAT.ogr_feature: s = self.data.ExportToJson() else: s = str(self.data) return s