Git Product home page Git Product logo

gtfs-osm-import's People

Contributors

danieldegroot2 avatar dependabot[bot] avatar gabboxl avatar laurentriffard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

gtfs-osm-import's Issues

routing result has problems with roundabouts and some right turns?

Had a look at the output result imported into OsmAnd for a route which is not implemented in OSM - spin-off topic, but it gives an assessment of the proposed routing for public transport from GTFS only:

General view: I encircled 3 strange routing points - resulting in failures on the proposed routing.
Screenshot_2023-06-12-11-51-34-527_netmod osmand
Screenshot_2023-06-12-12-05-57-218_net osmand
Screenshot_2023-06-12-12-13-29-809_net osmand

The routes from the operator are as follows:
image
image

Analysis:
To be expected, as this is a route which is not in OSM, and therefore the specific ways on the problematic points are not adjusted in OSM.

Conclusion: nice experiment but it is not possible to do a nice perfect routing on the map with the data only coming from GTFS. For the public transport routes which are not in OSM the offline map through OsmAnd will do give the stops but the visual routing will be limited. But still impressed what is possible.

add additional roles on the members check in OSMParser.java

Hi,
I think the relation member roles "platform_exit_only" and "platform_entry_only" for buses (but I have seen this also for ferries) and "stop_exit_only" and "stop_entry_only" should be added - ref, PTv2 - I get warning like:

Warning: Relation 5474612 has a member node with an unsupported role "platform_entry_only", node ref/Id = 3729055350
Warning: Relation 5474612 has a member node with an unsupported role "platform_exit_only", node ref/Id = 8255207189
Warning: Relation 5474612 has a member node with an unsupported role "stop_exit_only", node ref/Id = 8255207188
Warning: Relation 5474612 has a member node with an unsupported role "stop_entry_only", node ref/Id = 3150475960
Warning: Relation 5474641 has a member node with an unsupported role "stop_exit_only", node ref/Id = 3729120340
Warning: Relation 5474641 has a member node with an unsupported role "platform_entry_only", node ref/Id = 3729119504
Warning: Relation 5474641 has a member node with an unsupported role "stop_entry_only", node ref/Id = 3729120336
Warning: Relation 5474641 has a member node with an unsupported role "platform_entry_only", node ref/Id = 3729119511
Warning: Relation 5474641 has a member node with an unsupported role "stop_entry_only", node ref/Id = 4322954831
Warning: Relation 5474641 has a member node with an unsupported role "platform_exit_only", node ref/Id = 3729119498

As far as I can see the check is in OSMParser.java on line 431:

if (tempMemberRole.equals("stop") || tempMemberRole.equals("platform")) {
OSMStop osmStop = stopsWithOSMIndex.get(tempMemberRef);

Use relations generation for offline purposes + reldiff crashes

Hi,
Still on the same gtfs file (Tursib). stops works fine, but reldiff/reldiffx (using the interactivedebug) crashes at the end of the file. The fullrels CLI option closes normally.

reldiff/reldiffx:

Warning: Relation 5481564 has a member node with an unsupported role "stop_entry_only", node ref/Id = 8257724560
Warning: Relation 5481564 has a member node with an unsupported role "platform_entry_only", node ref/Id = 8257724559
Warning: Relation 5483029 has a member (id: 5481563) of an unsupported type "relation"
Warning: Relation 5483029 has a member (id: 5481564) of an unsupported type "relation"
Skipping OSM relation 5483029 as its type tag (S.C.Tursib S.A) is not a route.
Warning: Relation 5515258 has a member (id: 5481563) of an unsupported type "relation"
Warning: Relation 5515258 has a member (id: 5481564) of an unsupported type "relation"
Skipping OSM relation 5515258 as its type tag (null) is not a route.
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 9
at it.osm.gtfs.input.GTFSParser.readRoutes(GTFSParser.java:245)
at it.osm.gtfs.commands.gui.GTFSRouteDiffGui.readData(GTFSRouteDiffGui.java:102)
at it.osm.gtfs.commands.gui.GTFSRouteDiffGui.(GTFSRouteDiffGui.java:50)
at it.osm.gtfs.commands.CmdRelDiffGui.call(CmdRelDiffGui.java:32)
at it.osm.gtfs.commands.CmdRelDiffGui.call(CmdRelDiffGui.java:26)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at picocli.shell.jline3.PicocliCommands.invoke(PicocliCommands.java:283)
at org.jline.console.impl.SystemRegistryImpl.execute(SystemRegistryImpl.java:1228)
at org.jline.console.impl.SystemRegistryImpl.execute(SystemRegistryImpl.java:1273)
at it.osm.gtfs.GTFSOSMImport.interactive(GTFSOSMImport.java:176)
at it.osm.gtfs.GTFSOSMImport.main(GTFSOSMImport.java:202)

The relation 5515258 in this case is the last one in the downloaded relations.osm file (/home/koenvh/gtfs-osm-import/cache).
For the fullrels CLI option closes "normally":

The relations generation will not continue as there are no OSM stops with a GTFS id on OpenStreetMap!
Please run the "stops" command and upload the new stops to OSM first!

Strange because the code in CmdGenerateRoutesFullRelations.java constructs gtfsIdOsmStopMap (osm stops) which shouldn't empty as the stops.osm file is not empty. Still looking for that "This tool generates relations without checking if there are existing ones on OSM at the moment." (which should be based on GTFS only not?) :)

Changes summary GUI after stop matching

Hi,
It would be nice to have to be able to force the stop matching GUI to always on for debugging purposes. Something like the interactivedebug mode or an option inside.
KR
Koen

Crash when parsing GTFS files encoded in utf-8 with BOM

Hi,

I got some GTFS files which appear to be encoded in utf-8 with BOM. This cause gtfs-osm-import.jar to crash early :

$ java -jar ~/Téléchargements/gtfs-osm-import.jar  stops

Loading config properties...
Config properties loaded successfully.

Welcome to GTFS-OSM-Import!

Downloading and extracting GTFS data from file:///home/laurent/Documents/GTFS/CAPI.GTFS.zip ...
java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 6
	at it.osm.gtfs.input.GTFSParser.readStops(GTFSParser.java:92)
	at it.osm.gtfs.commands.CmdUpdateGTFSOSMData.updateBusStops(CmdUpdateGTFSOSMData.java:76)
	at it.osm.gtfs.commands.CmdUpdateGTFSOSMData.call(CmdUpdateGTFSOSMData.java:59)

Beginning of GTFS files looks like this :

$ head -1 gtfsimport/cache/gtfsdata/stops.txt  | od -bc
0000000 357 273 277 163 164 157 160 137 151 144 054 163 164 157 160 137
        357 273 277   s   t   o   p   _   i   d   ,   s   t   o   p   _
0000020 143 157 144 145 054 163 164 157 160 137 156 141 155 145 054 163
          c   o   d   e   ,   s   t   o   p   _   n   a   m   e   ,   s

Thus , the first header field is read as "<feff>stop_id",
it fails string match with "stop_id" in GTFSParser.java#L60 , stopIdKey is left with value -1,
and gtfs-osm-import crash later with out-of-bounds array access error GTFSParser.java#L92.

Workaround: edit all GTFS to remove BOM character : vi -c ":set nobomb" -c ":wq" stops.txt and rebuild GTFS zip file.

Expected fix : sanitize input files from BOM character.

GTFS parsing crashes

Hi,
Trying this out with this GTFS, with the DefaultPlugin selected in the configuration file (gtfs-import.properties), and launching java -Xms512m -Xmx1g -jar gtfs-osm-import.jar stops leads to:

Loading config properties...
Config properties loaded successfully.

Welcome to GTFS-OSM-Import!

Downloading and extracting GTFS data from https://tursib.ro/documents/gtfs/tursib.gtfs_2023-06-v1.zip ...
java.lang.NullPointerException: Cannot invoke "it.osm.gtfs.enums.OSMStopType.equals(Object)" because "stopType" is null
at it.osm.gtfs.input.GTFSParser.readStops(GTFSParser.java:106)
at it.osm.gtfs.commands.CmdUpdateGTFSOSMData.updateBusStops(CmdUpdateGTFSOSMData.java:76)
at it.osm.gtfs.commands.CmdUpdateGTFSOSMData.call(CmdUpdateGTFSOSMData.java:59)
at it.osm.gtfs.commands.CmdGenerateBusStopsImport.call(CmdGenerateBusStopsImport.java:62)
at it.osm.gtfs.commands.CmdGenerateBusStopsImport.call(CmdGenerateBusStopsImport.java:45)
at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
at picocli.CommandLine.access$1500(CommandLine.java:148)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
at picocli.CommandLine.execute(CommandLine.java:2170)
at it.osm.gtfs.GTFSOSMImport.main(GTFSOSMImport.java:211)

A quick comparison of the gtfs data used (Turin) and the ones above shows no strings present in this case. Is a rebuild necessary after changing the configuration file (gtfs-import.properties)? Trying to select the GTFSPlugin in the configuration file leads to:

Loading config properties...
Exception in thread "main" java.lang.IllegalArgumentException: An error occurred while loading config properties: The specified plugin was not found or is not valid
at it.osm.gtfs.utils.GTFSImportSettings.(GTFSImportSettings.java:101)
at it.osm.gtfs.utils.GTFSImportSettings.init(GTFSImportSettings.java:106)
at it.osm.gtfs.GTFSOSMImport.main(GTFSOSMImport.java:196)

OS = Ubuntu22.04
gtfs-osm-import.jar from the latest built

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.