data-for-change / anyway

ANYWAY - Car accidents map
http://www.anyway.co.il
MIT License
77 stars 242 forks source link

Function that extracts location from a news-flash #1074

Closed atalyaalon closed 4 years ago

atalyaalon commented 4 years ago

Create a function in flask_app.py file: def extract_news_flash_location(news_flash_id)

The function receives a news_flash_id, and returns the location of the news_flash. You can use the "resolution" column in the news_flash table. @Mano3 can you elaborate what resolutions exist? From your code I see: 'צומת בינעירוני', 'צומת עירוני', 'כביש בינעירוני', 'רחוב', 'עיר', 'מחוז', 'אחר'

The function will return the resolution data And the location itself as one of the following:

  1. Road: return the resolution and road1
  2. Non-Urban Junction: return the resolution and road1 and road2
  3. Yishuv: return the resolution and yishuv_name
  4. Yishuv and street: return the resolution and yishuv_name and street1
  5. Urban Junction: return the resolution and yishuv_name, street1, and street2
atalyaalon commented 4 years ago

@shaniwein great work!