Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a new end point that determines a road type according to lon and lat #1583

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

LLnaki
Copy link

@LLnaki LLnaki commented Nov 10, 2020

No description provided.

@codecov
Copy link

codecov bot commented Nov 10, 2020

Codecov Report

Merging #1583 (c2a8d02) into dev (db4f803) will decrease coverage by 1.61%.
The diff coverage is 81.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #1583      +/-   ##
==========================================
- Coverage   52.71%   51.09%   -1.62%     
==========================================
  Files          62       62              
  Lines        6031     6012      -19     
==========================================
- Hits         3179     3072     -107     
- Misses       2852     2940      +88     
Flag Coverage Δ
unittests 51.09% <81.39%> (-1.62%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
anyway/views/news_flash/api.py 25.71% <57.14%> (+3.49%) ⬆️
anyway/models.py 90.94% <85.71%> (-0.13%) ⬇️
anyway/flask_app.py 40.77% <100.00%> (+0.08%) ⬆️
anyway/parsers/location_extraction.py 26.58% <0.00%> (-42.20%) ⬇️
anyway/parsers/news_flash_db_adapter.py 60.86% <0.00%> (-8.70%) ⬇️
tests/test_news_flash.py 92.52% <0.00%> (-4.68%) ⬇️
anyway/infographics_utils.py 86.30% <0.00%> (-0.92%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db4f803...c2a8d02. Read the comment docs.

Copy link
Collaborator

@atalyaalon atalyaalon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great Work!
I added some comments for you to address - what do you think?

@@ -791,6 +792,68 @@ def is_anonymous(self):
def get_id(self):
return self.id

class WazeAllerts(Base):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waze alerts table exists (See class WazeAlert in this file)
What there's a need in another one?

from sys import maxsize
@user_optional
def get_road_type(lat: float, lon: float):
offset = 0.00001
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you decide on the offset size (0.00001)?
In general - I suggest using geographical query instead of the query below -see geom.intersects here

In this case - I think that using both the geographical query and the road_number / street name together can be very powerful - just using one of them is not enought.
However - we can start with geographical query and improve it.

@atalyaalon atalyaalon marked this pull request as draft March 31, 2022 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants