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

GTFS filter trips in a given date #9

Closed
temospena opened this issue Apr 5, 2024 · 23 comments
Closed

GTFS filter trips in a given date #9

temospena opened this issue Apr 5, 2024 · 23 comments
Assignees

Comments

@temospena
Copy link
Member

The function tidytransit::filter_feed_by_date() retrieves all the services that run in that date but that also sun in other dates.
This is not what we want.

Another option is to identify which service pattern has more days, trips and routes, and filter that service_id.

Here is how:
https://cran.r-project.org/web/packages/tidytransit/vignettes/frequency.html

@valenca13
Copy link
Member

valenca13 commented Apr 9, 2024

braga

Here are the Results for Braga. Braga has a total of 11 service patterns. It is important to mention that the Calendar dates are from: 28/03/2024 - 04/04/2024.

@valenca13
Copy link
Member

lisbon

AML has 188 service patterns. We can choose the ones that operate during more days the year. Calendar dates from AML range from 01/07/2023 to 31/12/2024.

@temospena
Copy link
Member Author

temospena commented Apr 9, 2024 via email

@valenca13
Copy link
Member

Analyze the service patterns of AML. Take a look at the locations.

@valenca13
Copy link
Member

aml

All the bus stops that are present in the AML. Check the locations of the most frequent service patterns. Are they in different locations?

@valenca13
Copy link
Member

service_pattern_1

Bus routes of service pattern "s_d38ffee" (192 days)

@valenca13
Copy link
Member

service_pattern_2

Bus routes of service pattern "s_0973a74" (191 days)

@valenca13
Copy link
Member

service_pattern_3

Bus routes of service patterns "s_70dfe23" (188 days)

@valenca13
Copy link
Member

The most frequent service patterns are actually in different locations in the AML. Should we aggregate the 3? What are the next steps? @temospena

@temospena
Copy link
Member Author

I would expect that. But there should be 4 expressive service patterns, not 3, 1 for each area.
After finding this 4th one, I would suggest to change the calendar dates of the less expressive ones, to be compatible with the most expressive one.
For instance, if service_pattern 3 is running between 01-01-2024 to 31-03-2024 and service_pattern 1 is running between 01-10-2023 to 31-12-2023, recode the calendar dates of this one to be at same date and time than the previous one (looking at the calendar and matching monday with monday)

@valenca13
Copy link
Member

service_pattern_7

This is the service pattern with that operates in 7th most days of the year ("s_a6bf59d (44 days)). The other 3 service patterns are very similar to the ones that I have already got.

@valenca13
Copy link
Member

valenca13 commented Apr 24, 2024

service_pattern_10

Service pattern 10 ("s_ba5dcc4" (39 days)). The routes appear more in the north with 143 routes (ranked 26th in terms of number of routes)

@valenca13
Copy link
Member

valenca13 commented Apr 24, 2024

service_pattern_11
Service pattern 11 seems to be the fourth region ("s_f22b75f" (39 days)). @temospena

@valenca13
Copy link
Member

valenca13 commented Apr 24, 2024

service_pattern_12
Also service pattern 12 (""s_fff1bcb" (39 days)) @temospena

@temospena
Copy link
Member Author

Service pattern 11 seems to be the fourth region ("s_f22b75f" (39 days)). @temospena

There should be a service pattern going south, to Montijo, Alcochete, and so on...

@valenca13
Copy link
Member

Service pattern 11 seems to be the fourth region ("s_f22b75f" (39 days)). @temospena

There should be a service pattern going south, to Montijo, Alcochete, and so on...

service_pattern_18

Service_pattern "s_bc376dc" (37 days)

@valenca13
Copy link
Member

valenca13 commented Apr 26, 2024

Adopted service patterns (ranked by "days in service"):

  1. Service pattern 1: "s_d38ffee" (192 days)
  2. Service pattern 2: "s_0973a74" (191 days)
  3. Service pattern 3: "s_70dfe23" (188 days)
  4. Service pattern 12: "s_fff1bcb" (39 days)
  5. Service pattern 18: "s_bc376dc" (37 days)

@valenca13
Copy link
Member

valenca13 commented Apr 30, 2024

5. "s_bc376dc"

Captura de ecrã 2024-04-30 111946

O service pattern 18 só opera 1 mês. Vou ter que analisar os próximos passos. @temospena

@valenca13
Copy link
Member

  • Filtrar por essa data (e.g., 10 de abril 2024) para cada servicepattern_id.
  • Calcular o numero de frequencias por cada paragem depois juntar todas tabelas em uma só.

@valenca13
Copy link
Member

  • Lisboa está dando erro. Não acha dados.
  • Juntar dados com rbind
  • Fazer o piggyback para colocar os dados (geopackage) no release

@valenca13
Copy link
Member

Critérios:

  • Classificar a frequência por hora nos níveis de serviço (1-4), baseados nos critérios da foto.
  • Calcular o nível de serviço máximo ao decorrer de todas as horas.
  • Critério de inclusão: Nivel de serviço máximo 3 ou 4.

@temospena
Captura de ecrã 2024-05-05 130336

@valenca13
Copy link
Member

@temospena Já fiz o código dos níveis de serviço dentro da célula no código "cellcandidates.R". Por favor verifique se está tudo ok. Obrigado.

temospena added a commit that referenced this issue May 9, 2024
@temospena
Copy link
Member Author

The file was generated for Portugal (great work @valenca13 !) and is available at releases.

The code is not fully reproducible because tidytransit](tidytransit::set_servicepattern() generates random hash numbers for identificators.

Something to consider when rebuilding for other year/region.

@temospena temospena mentioned this issue Jan 28, 2025
4 tasks
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

No branches or pull requests

2 participants