Skip to content

Commit bb83207

Browse files
committed
adding utility class
1 parent bbc97b3 commit bb83207

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

overpass/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
from .errors import (
1212
OverpassError, OverpassSyntaxError, TimeoutError, MultipleRequestsError, ServerLoadError, UnknownOverpassError
1313
)
14+
from .utils import *

overpass/utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Utils(object):
2+
3+
@classmethod
4+
def to_overpass_id(self, osmid, area=False):
5+
AREA_BASE = 2400000000
6+
RELATION_BASE = 3600000000
7+
if area:
8+
return int(osmid) + AREA_BASE
9+
return int(osmid) + RELATION_BASE

0 commit comments

Comments
 (0)