Skip to content

Unable to use area filter in Overpass QL #19

@eoglethorpe

Description

@eoglethorpe

Based on my understanding of QL from this document, we should be able to use node, way, rel and area as filters. However, when i use area it returns an error. Apologies if I'm misunderstanding QL, still a noob.

node, rel, way work ok

r = api.query("""node[name="Foo"]; out meta;""")
r = api.query("""way[name="Foo"]; out meta;""")
r = api.query("""rel[name="Foo"]; out meta;""")

area does not

r = api.query("""area[name="Foo"]; out meta;""")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/overpy-0.3.1-py2.7.egg/overpy/__init__.py", line 98, in query
    return self.parse_xml(response)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/overpy-0.3.1-py2.7.egg/overpy/__init__.py", line 160, in parse_xml
    return Result.from_xml(data, api=self, parser=parser)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/overpy-0.3.1-py2.7.egg/overpy/__init__.py", line 306, in from_xml
    parser.parse(source)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 213, in feed
    self._parser.Parse(data, isFinal)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 317, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/overpy-0.3.1-py2.7.egg/overpy/__init__.py", line 1018, in startElement
    raise KeyError("Unknown element start '%s'" % name)
KeyError: u"Unknown element start 'area'"`

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions