-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Querying by ID is coming to GeoDesk for Python, but it would also be useful to support this in the GOL Tool via GOQL queries.
We would need to decide on a query syntax:
-
n#1234
would be the most intuitive from (used by CSS), however it leads to ambiguity asw
only selects lineal ways, anda
may return two features, since a way and a relation can have identical IDs -
Alternatively,
w
andr
if coupled with an ID could be interpreted as including areas -- but this would be less performant in the case where user intends to constrain the query (useful if ID indexing is not used) -
We could introduce
W
(all ways, including areas) andR
(all relations, including areas) -- this is less intuitive if we intend to mimic CSS, which treats selectors as case-insensitive (i.e.r
andR
are treated as the same; alsow
andW
may be hard to differentiate in certain fonts) -
Pseudo-classes (another CSS concept):
:node
,:way
and:relation
(More verbose and less intuitive, but would also enable queries that select only area relations:a:relation
) -
An alternative form that does not follow CSS syntax:
w1234
, which would disallow tag clauses and always include areas (a1234
would be rejected) -
ID in parentheses (Overpass syntax):
w(1234)
-- could be interpreted the same as # 5 -
Type and ID as pseudo-tags:
w[@id=1234]
,a[@type=relation][@id=1234]
(less intuitive) -
Pseudo-tags, but without the
@
sign:w[id=1234]
,a[osm_type=relation][id=1234]
(assumesid
is never used as a key; usesosm_type
-- same as GeoDesk for Python -- becausetype
is a widely used tag)
We could support multiple forms, but this increases code and documentation complexity.