diff --git a/overpass/__init__.py b/overpass/__init__.py index 267865a7b4d..9ddfcd7477d 100644 --- a/overpass/__init__.py +++ b/overpass/__init__.py @@ -11,3 +11,4 @@ from .errors import ( OverpassError, OverpassSyntaxError, TimeoutError, MultipleRequestsError, ServerLoadError, UnknownOverpassError ) +from .utils import * \ No newline at end of file diff --git a/overpass/utils.py b/overpass/utils.py new file mode 100644 index 00000000000..9cf3f1236a3 --- /dev/null +++ b/overpass/utils.py @@ -0,0 +1,9 @@ +class Utils(object): + + @classmethod + def to_overpass_id(self, osmid, area=False): + AREA_BASE = 2400000000 + RELATION_BASE = 3600000000 + if area: + return int(osmid) + AREA_BASE + return int(osmid) + RELATION_BASE \ No newline at end of file