Skip to content

Commit

Permalink
Merge pull request #751 from eskerda/velov-bbox
Browse files Browse the repository at this point in the history
bound velov to a bbox
  • Loading branch information
eskerda authored Sep 13, 2024
2 parents c4b4cf9 + 7780beb commit 9de530c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pybikes/cyclocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import json

from pybikes import BikeShareSystem, BikeShareStation, PyBikesScraper
from pybikes.utils import Bounded


api_root = "https://api.jcdecaux.com/vls/v3/"
Expand All @@ -16,7 +17,7 @@
}


class Cyclocity(BikeShareSystem):
class Cyclocity(Bounded, BikeShareSystem):

sync = True

Expand All @@ -32,8 +33,8 @@ class Cyclocity(BikeShareSystem):
'source': 'https://developer.jcdecaux.com'
}

def __init__(self, tag, meta, contract, key):
super(Cyclocity, self).__init__(tag, meta)
def __init__(self, tag, meta, contract, key, bbox=None):
super(Cyclocity, self).__init__(tag, meta, bounds=bbox)
self.contract = contract
self.api_key = key
self.stations_url = api_root + endpoints['stations'].format(
Expand Down
3 changes: 2 additions & 1 deletion pybikes/data/cyclocity.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@
"longitude": 4.835659,
"city": "Lyon"
},
"contract": "Lyon"
"contract": "Lyon",
"bbox": [[45.6235, 4.6715], [45.8900, 5.0098]]
},
{
"tag": "bicikelj",
Expand Down

0 comments on commit 9de530c

Please sign in to comment.