jamespfennell / transiter

Web service for transit data
https://demo.transiter.dev
MIT License
62 stars 7 forks source link

Installing system failing - code 3 invalid character - in numeric literal #129

Closed brodyFlannigan closed 10 months ago

brodyFlannigan commented 11 months ago

Hi!

I've just installed the latest version of Transiter using Docker-Compose (which was super painless).

However, when I follow the instructions here to install the BART system config, I get the following error message:

{ "code": 3, "message": "invalid character '-' in numeric literal", "details": [] }

I tried with the PATH config file too but got the same result.

Thanks!

cedarbaum commented 11 months ago

Hey @brodyFlannigan,

Are you using the current Go version of Transiter or the older Python version (https://github.com/jamespfennell/transiter-python). If you're using the current Go version, I don't believe the BART system has been validated yet (see: https://github.com/jamespfennell/transiter/issues/87). The documentation is likely out of date in this case. Generally, all the systems that work with the Go version are in https://github.com/jamespfennell/transiter/tree/master/systems. That being said, it would potentially not be too difficult to get BART working at this point (@jamespfennell may know more about this).

As for the PATH system, that should work and I've recently tested it on the latest commit. Below are the commands I ran to do this:

# Process 1
docker-compose up postgres
# Process 2
go run . server
# Process 3
go run . install -f us-ny-path systems/us-ny-path.yaml
go run . list
┌────────────┬────────────────────────────────────┬────────┐
│ ID         │ Name                               │ Status │
├────────────┼────────────────────────────────────┼────────┤
│ us-ny-path │ Port Authority Trans-Hudson (PATH) │ ACTIVE │
└────────────┴────────────────────────────────────┴────────┘

If you're using the Go version and still can't get PATH working, that's potentially a bug and I'd be happy to help debug it. For support with the legacy Python version, I'll defer to @jamespfennell. However, it is probably best to try and get something working on the current Go version IMO.

jamespfennell commented 11 months ago

Hey! First I just want to acknowledge that mine and Sam's answers are probably frustrating. I appreciate you trying the software.

The problem is indeed that the documentation is for an older version of the software that had a different API. I need to update the docs and will use that ticket to track that. Again, I understand this is a frustrating reason for things not working, and sorry for that.

Even with using the right commands (like in Sam's comment), I'm not sure that recent versions of Transiter support the BART system. The "problem" with BART data is that the GTFS realtime feed needs to be merged with the GTFS static data before persisting it. Adding this logic is not too tricky, but it hasn't been done because the NYC transit systems don't require this and Sam and I have been most focused on NYC.

jamespfennell commented 11 months ago

Hmmmm I think I was wrong about the BART. I just submitted a system config for the BART, so in the root of the repo we can run:

go run . install -f us-ca-bart systems/us-ca-bart.yaml

When I navigate through the data I see realtime data in there! Eg at the Embarcadero station:

curl localhost:8080/systems/us-ca-bart/stops/place_EMBR

So maybe it just works. In fact I believe this commit https://github.com/jamespfennell/transiter/commit/23931a5abefb0f6f8257d916c51d1ad7ddb5b749 by @cedarbaum is probably all that was needed - this merges route IDs from the GTFS static feed to the realtime feed.

cedarbaum commented 11 months ago

Awesome that BART is working, thanks for looking into it @jamespfennell! Slightly off topic from this issue, but that commit you referenced reminds me that we still probably need some trip headsign resolution logic for such systems. I started working on this a bit on this branch: https://github.com/cedarbaum/transiter/tree/trip_headsign_from_static_data, but it doesn't yet take into account headsign changes within a trip (e.g., when the trip's global headsign is overridden by headsigns of individual stop times). This was something I meant to get to when looking into getting the NYC ferry system working, which I believe is similar to BART's in structure.

brodyFlannigan commented 11 months ago

I'm so sorry about the delay in responding to this. I was able to fix the problem with your above guidance. Not sure exactly what I did, but it worked.