Retrieving sub-stops of a station in onebusaway-gtfs / GtfsRelationalDao

10 views
Skip to first unread message

Laurent Gregoire

unread,
Sep 16, 2011, 10:46:50 AM9/16/11
to onebusaway...@googlegroups.com
Hi,

There is to my knowledge no methods to easily retrieve all sub-stops
of a given station in GtfsRelationalDao, which could be handy --
unless I did not see an easy to do it w/o scanning all stops. Anybody
interested in a patch?

Thanks,

--Laurent

Brian Ferris

unread,
Sep 17, 2011, 8:58:34 AM9/17/11
to onebusaway...@googlegroups.com
You are correct. I'd be happy to consider a patch.

> --
> You received this message because you are subscribed to the Google Groups "onebusaway-developers" group.
> To post to this group, send email to onebusaway...@googlegroups.com.
> To unsubscribe from this group, send email to onebusaway-devel...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/onebusaway-developers?hl=en.
>
>

Laurent Gregoire

unread,
Sep 17, 2011, 11:03:02 AM9/17/11
to onebusaway...@googlegroups.com
Here is a pre-version of the changes. Please do not commit until the
two issues below are solved:

1) the unit-test only works if I add a station to the BART zip, since
no test sets contains stations. I have a new zip with a "dummy"
station owning two stops, we can add it or create a new test set with
stations.
2) it seems that the GtfsRelationalDaoImpl class does not ensure
integrity of indexes when updating/deleting data via the MutableDao
interface. Did I missed something or is it not supported?

HTH,

--Laurent

OBA-StopsForStation.patch

Brian Ferris

unread,
Sep 19, 2011, 4:02:50 PM9/19/11
to onebusaway...@googlegroups.com
1) It might be easier to a simple unit test that injects Stop objects
created by hand, as opposed to modifying a full GTFS zip.

2) It's true for GtfsRelationalDaoImpl that indices are NOT updated.
We could probably change that if need be.

Brian

Laurent Gregoire

unread,
Sep 21, 2011, 3:46:37 AM9/21/11
to onebusaway...@googlegroups.com
OK, thanks. Attached then is the new version of the patch, with unit
testing based on dynamically added stops and stations.

Given the point 2), I would add a small warning note in the source
and/or the WIKI to warn users on this limitations. It can produce
nasty small bugs if one rely on the GtfsRelationalDaoImpl for
dynamically adding/removing entities.

HTH,

--Laurent

OBA-StopsForStation.patch

Brian Ferris

unread,
Oct 10, 2011, 5:52:43 PM10/10/11
to onebusaway...@googlegroups.com
Hey Laurent,

I realized I never got around to applying this patch. I just checked
it in. Thanks for the addition!

Brian


On Wed, Sep 21, 2011 at 9:46 AM, Laurent Gregoire

Laurent Gregoire

unread,
Oct 11, 2011, 3:34:29 AM10/11/11
to onebusaway...@googlegroups.com

Hi,

No worries, you're welcome!

Laurent Grégoire
laurent....@gmail.com

Reply all
Reply to author
Forward
0 new messages