def _gmlv2_to_geojson(el):
tag = el.tag.replace('<STR_LIT>' % NS_GML, '<STR_LIT>')<EOL>if tag == '<STR_LIT>':<EOL><INDENT>coordinates = [float(c) for c in el.findtext('<STR_LIT>' % NS_GML).split('<STR_LIT:U+002C>')]<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>coordinates = [<EOL>[float(x) for x in pair.split('<STR_LIT:U+002C>')]<EOL>for pair in el.findtext('<STR_LIT>' % NS_GML).split('<STR_LIT:U+0020>')<EOL>]<EOL><DEDENT>elif tag == '<STR_LIT>':<EOL><INDENT>coordinates = []<EOL>for ring in el.xpath('<STR_LIT>', namespaces=NSMAP)+ el.xpath('<STR_LIT>', namespaces=NSMAP):<EOL><INDENT>coordinates.append([<EOL>[float(x) for x in pair.split('<STR_LIT:U+002C>')]<EOL>for pair in ring.text.split('<STR_LIT:U+0020>')<EOL>])<EOL><DEDENT><DEDENT>elif tag in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>if tag == '<STR_LIT>':<EOL><INDENT>single_type = '<STR_LIT>'<EOL>member_tag = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>single_type = tag[<NUM_LIT:5>:]<EOL>member_tag = single_type[<NUM_LIT:0>].lower() + single_type[<NUM_LIT:1>:] + '<STR_LIT>'<EOL><DEDENT>coordinates = [<EOL>gml_to_geojson(member)['<STR_LIT>']<EOL>for member in el.xpath('<STR_LIT>' % (member_tag, single_type), namespaces=NSMAP)<EOL>]<EOL><DEDENT>else:<EOL><INDENT>raise NotImplementedError<EOL><DEDENT>return {<EOL>'<STR_LIT:type>': tag,<EOL>'<STR_LIT>': coordinates<EOL>}<EOL>
Translates a deprecated GML 2.0 geometry to GeoJSON