Skip to content

Commit

Permalink
Merge pull request #46 from KaartGroup/feature/increase-mapillary-cor…
Browse files Browse the repository at this point in the history
…relation

Improve mapillary correlation
  • Loading branch information
Zack LaVergne authored Feb 5, 2020
2 parents c3ba8f4 + 1545d4d commit 9bf8f29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions server/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class EnvironmentConfig:

# Image sources
MAPILLARY_API = {'base': 'https://a.mapillary.com/v3/', 'clientId': os.getenv('MAPILLARY_API_KEY', None)}
MAPILLARY_TIME_CORRELATION = os.getenv('MAPILLARY_TIME_CORRELATION', 60)

# Configuration for sending emails
SMTP_SETTINGS = {
Expand Down
3 changes: 2 additions & 1 deletion server/services/mapillary_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class MapillaryService:
@staticmethod
def getMapillarySequences(parameters: dict):
MAPILLARY_API = current_app.config['MAPILLARY_API']
MAPILLARY_TIME_CORRELATION = current_app.config['MAPILLARY_TIME_CORRELATION']
parameters['client_id'] = MAPILLARY_API['clientId']
if 'bbox' not in parameters:
raise ValueError("parameters must include a bbox")
Expand Down Expand Up @@ -118,7 +119,7 @@ def getMapillarySequences(parameters: dict):
task = []
task.append(feature)

for otherFeature in [f for f in features if (abs((t1 - parser.parse(f['properties']['captured_at'])).total_seconds()) <= 60)]:
for otherFeature in [f for f in features if (abs((t1 - parser.parse(f['properties']['captured_at'])).total_seconds()) <= MAPILLARY_TIME_CORRELATION)]:
if otherFeature['properties']['key'] in graves:
continue
new = otherFeature['properties']
Expand Down

0 comments on commit 9bf8f29

Please sign in to comment.