Skip to content

Commit

Permalink
adding utility class
Browse files Browse the repository at this point in the history
  • Loading branch information
mvexel committed Dec 21, 2016
1 parent bbc97b3 commit bb83207
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions overpass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
from .errors import (
OverpassError, OverpassSyntaxError, TimeoutError, MultipleRequestsError, ServerLoadError, UnknownOverpassError
)
from .utils import *
9 changes: 9 additions & 0 deletions overpass/utils.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bb83207

Please sign in to comment.