Comments (24)
So from a very quick glance, this is not a real backend problem, but a problem with how we query the data.
If you take a look at the requests in the network tab, you'll see that we don't filter well on the dates, which results a duplication of rides, and therefore of stops:
https://open-bus-stride-api.hasadna.org.il/gtfs_routes/list?limit=100&date_from=2023-10-18&date_to=2023-10-19&operator_refs=4&route_short_name=364
-> returns 6 results (2 routes of each line ref). The reason for that is that think the gtfs data is generated per day (in the MOT servers, as well as in the backend, because the planned routes can change)- Therefore 2 rides are queried (1 for the 18.10, one for the 19.10), and this is why we get the stops duplication:
![Screenshot 2023-10-19 at 12 15 12](https://private-user-images.githubusercontent.com/75563038/276555348-3fcf11c7-5822-4c71-90ac-8887c8e03d37.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY4ODc2MDgsIm5iZiI6MTcxNjg4NzMwOCwicGF0aCI6Ii83NTU2MzAzOC8yNzY1NTUzNDgtM2ZjZjExYzctNTgyMi00YzcxLTkwYWMtODg4N2M4ZTAzZDM3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTI4VDA5MDgyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI0ZjIyNmNhNjNlYTQ2YzBiMmNkZWQyYTRlNzZmY2M2YjYxZWZkZGFmNjNhOTIwOWVkMWRiMTFkZjI4ZDE1NmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.me9heStozZiEd3cjt0yZ1syDKYQqSWadVP1TFrb6W2Q)
from open-bus-map-search.
@ArkadiK94 , looks great, I think you can close 🙏 😄
from open-bus-map-search.
filter out results with the same ID sounds like a good idea
from open-bus-map-search.
ok, I re-opened it for now, let's wait the response of @ShayAdler if there is required a change in the back-end as well
from open-bus-map-search.
It happens on many bus lines.
Though each entry presents you with different times and only the name is duplicated, I think it will be a good idea to merge those duplications to just one entry containing all the different times.
I believe it's worth doing on the backend, that will just return the data as we want it.
But if it's not possible you can assign the issue to me and I'll make a helper function to manipulate the data on the front end.
from open-bus-map-search.
totally agree that it better be done at backend...
may be it is worth to open issue there
from open-bus-map-search.
Okay, so let me know if I should work on it on the front or not 😄
Maybe I can take a look on the backend myself and see if I can make this modification there
@NoamGaash what do you think?
from open-bus-map-search.
from open-bus-map-search.
Okay, I'll take a look there and get back to you Sunday/Monday with my thoughts
from open-bus-map-search.
from open-bus-map-search.
AFAIK, there are subtle differences between both variations
@ShayAdler wdyt?
from open-bus-map-search.
So given the new info, what do we want to do about this issue?
from open-bus-map-search.
Awesome, I'll take a look over it ;)
from open-bus-map-search.
@NoamGaash is there a reason not to query only the actual date the user filtered on? This will solve the issue..
This bigger range selection sounds buggy for another reason - what if I searched for the 18.10, and this route does not exsit in this date, but is does exist on the 19.10? Currently, I'll see it in the search results
from open-bus-map-search.
you're right, it will be a better solution
from open-bus-map-search.
Perfect, so I have my task.
I'll go over the code and get to it.
Will update you soon
from open-bus-map-search.
so i took a deeper look on that issue, and it doesn't seem related to the dates.
i logged what i got back from the server and saw this:
they are all the same dates, only difference is the route key(look at the last two characters of the key of each duplications)
i can't really put my finger on why we get those duplications. will you be able to take a quick look?
here is the example of the data i tried to query on the frontend:
waiting on your response <3 @NoamGaash @ShayAdler Thanks!
from open-bus-map-search.
@NoamGaash I close this issue, the discussion about this issue continues in issue #176
from open-bus-map-search.
Hi, @ArkadiK94 you sure this is the same problem? My issue is trying to better handle a by-design case, while this is an actual bug.
from open-bus-map-search.
Yeah, @Pafestivo wrote that the difference between the routes is only the key one with # while the other with number. Which indicates that there are two routes with the same "from destination" and "to destination". Maybe, I am wrong tell me if so , and I will reopen this issue.
from open-bus-map-search.
I am sorry, the issue talks about two different routes where here the bug is about duplicated stops. As a result, I am not sure if it is the same issue so I will reopen it for now. @ShayAdler @AdlerShay
from open-bus-map-search.
@ArkadiK94 yep this is definitly confusing 😅 , but I still think this is not the same issue. The diff is that in #176 , the line_ref
is different (in gtfs, each direction of the line gets a different line_ref
, so for exmaple the same line 37 from Tel Aviv to Yehud does not have the same line ref as from Yehud to Tel Aviv, the same goes for "halufot").
Here are you can see, it is the same (as well as the route_long_name
and route_mkt
, but the dates are different.
I have not deeply investigated the pattern with the "#", but I guess that this line can sometimes have other halufot.
Let me know if it is still unclear :)
![image](https://private-user-images.githubusercontent.com/61648359/284086201-47cfda56-f8ea-4c0c-90ff-bc1eea542a1a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTY4ODc2MDgsIm5iZiI6MTcxNjg4NzMwOCwicGF0aCI6Ii82MTY0ODM1OS8yODQwODYyMDEtNDdjZmRhNTYtZjhlYS00YzBjLTkwZmYtYmMxZWVhNTQyYTFhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA1MjglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNTI4VDA5MDgyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTM0OWVlYmNjZTY3MjY1ZjY0N2IwNDZkZTJkMTMzNjA2ODE3ZjhmYTgyNjA5NjM1MzYwYjAxNWIwZjI1ODc2Y2EmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.8y3wa9E7KuEzdiWqHDRLPA0SkL8vbz-gro9veU2soJ0)
from open-bus-map-search.
@ShayAdler @NoamGaash Do you want this issue to be still open to make the relevant changes in the backend? Or is the filter in frontend is enough?
from open-bus-map-search.
@ArkadiK94
I'm not sure, feel free to re-open
from open-bus-map-search.
Related Issues (20)
- We don't always see the planned route - why? HOT 8
- Wrong line profile information HOT 1
- Dark mode hides map legends HOT 3
- add youtube videos HOT 6
- no scrolling on live map preview HOT 10
- היסטוריית נסיעות לא עובדת HOT 4
- Embed youtube playlist to our about page HOT 3
- Change the title of the "realtime" page HOT 3
- Make the language button visible and visually pleasant HOT 6
- Redesign Proposal HOT 7
- Dashboard data isn't cached
- center map automatically HOT 2
- Create MapContent Component HOT 2
- Make us SEO compatible HOT 9
- עעעע HOT 2
- Translate bearing to geographic terms in BusTooltip HOT 5
- There are two donate buttons at the navbar which show different things HOT 8
- Duplicate donate link (dollar icon ) at the topbar HOT 3
- Proposal: Simplify Domain Name for Better UX HOT 3
- style | public-appeal page touch-ups HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-bus-map-search.