matsim-org / GTFS2MATSim

A GTFS to MATSim converter, maintained by the Berlin team.
http://matsim.org/extension/gtfs2matsim
Other
12 stars 20 forks source link

RunGTFS2MATSimExample transform method error #5

Closed mr-illington closed 5 years ago

mr-illington commented 5 years ago

When trying to run the above script with the included "test/input/test-feed.zip" file, the program appears to run and parse trips routes and stops, but then throws an exception when trying to call org.matsim.core.utils.geometry.transformations.GeotoolsTransformation.transform(GeotoolsTransformation.java:70)

Does this have to do with the having the wrong coordinate system (tried with the stock example EPSG:25833) in the transformation or the method itself?

Full log:

error.txt

nkuehnel commented 5 years ago

Is this fixed?

mr-illington commented 5 years ago

No issue is ongoing.

nkuehnel commented 5 years ago

It looks like some kind of dependency issue. It works on my machine. Can you try doing a maven clean install? Do you have multipe projects setup in the same workspace (in Intellij: multiple modules in the same project)?

mr-illington commented 5 years ago

hmm yep dependency issue. Mavin clean install does not help and yes only this project in workspace (I only cloned GTFS2MATSim-master, then imported as new project with mavin whose pom calls for 4 modules in this dependency tree).

Seems that mavin is handling the conflicting instances of "org/geotools:gt-epsg-gsql" with the "nearest wins" strategy, but this is messing up the program which is calling a method from a previous version of geotools?

image

Not sure how to specify the specific version of a module, or what other issues this might create given that's the idea of dependency management. Other ideas?

nkuehnel commented 5 years ago

You can exclude transitive dependencies from libraries. I will have another look at that later, in the meantime you can do it yourself: https://www.google.com/amp/s/www.viralpatel.net/maven-ignore-transitive-dependency/amp/

You just need to find out which dependencies have the same transitive dependency and then probably exclude the older version

mr-illington commented 5 years ago

Interestingly the regular RunGTFS2MATSim.java with command line program arguments is running fine. At any rate, this is not high priority for me, I was primarily trying to test/compare the outputs of the pseudo network to the conversion results using the alternative pt2matsim. Issue could be deleted.

mr-illington commented 5 years ago

You can exclude transitive dependencies from libraries. I will have another look at that later, in the meantime you can do it yourself: https://www.google.com/amp/s/www.viralpatel.net/maven-ignore-transitive-dependency/amp/

You just need to find out which dependencies have the same transitive dependency and then probably exclude the older version

Ok will give it a shot. Thanks

dhixsingh commented 4 years ago

Dropping the MATSim version to 10.0.0 in the pom.xml seems to fix it for now.

dhixsingh commented 4 years ago

Interestingly the regular RunGTFS2MATSim.java with command line program arguments is running fine. At any rate, this is not high priority for me, I was primarily trying to test/compare the outputs of the pseudo network to the conversion results using the alternative pt2matsim. Issue could be deleted.

Btw above is working only because it actually doesn't require a transformation it seems.

Compare 4th param here (requires transformation): https://github.com/matsim-org/GTFS2MATSim/blob/8aa04d1598406accd7dc31ebfaf50f9c31bf3c09/src/main/java/org/matsim/contrib/gtfs/RunGTFS2MATSimExample.java#L63

To 4th param here (does not require transformation I think): https://github.com/matsim-org/GTFS2MATSim/blob/8aa04d1598406accd7dc31ebfaf50f9c31bf3c09/src/main/java/org/matsim/contrib/gtfs/RunGTFS2MATSim.java#L60

dhixsingh commented 4 years ago

Finally, I think this issue is possibly related to MATSim builds moving to JDK11 (whereas MATSim 10 was using JDK8 I believe though I haven't confirmed this). If so, the solution is likely just to update this project's POM in line with the MATSim 11+ pom (w.r.t geotools), but I didn't get time to try that.

jalal1 commented 4 years ago

Hello,

When I try to run RunGTFS2MATSimExample.java, I get the error below.

I tried the previous solutions with no success.

2020-05-07 21:50:48,461 WARN MGC:174 Assuming that coordinates are in longitude first notation, i.e. (longitude, latitude). 2020-05-07 21:50:48,772 INFO Logger:? dataFileCache open start 2020-05-07 21:50:48,861 WARN MGC:174 Assuming that coordinates are in longitude first notation, i.e. (longitude, latitude). 978 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table feed_info from feed_info.txt 988 [main] INFO com.conveyal.gtfs.GTFSFeed - Feed ID is undefined, pester maintainers to include a feed ID. Using file name Latest_BJCTA_GTFS_042220. 988 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table agency from agency.txt 990 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table calendar_dates from calendar_dates.txt 1005 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table fare_attributes from fare_attributes.txt 1006 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Table fare_rules was missing but it is not required. 1006 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table routes from routes.txt 1007 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table shapes from shapes.txt 1816 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table stops from stops.txt 1829 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table transfers from transfers.txt 1829 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table trips from trips.txt 1844 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table frequencies from frequencies.txt 1845 [main] INFO com.conveyal.gtfs.model.Entity$Loader - Loading GTFS table stop_times from stop_times.txt 2557 [main] INFO com.conveyal.gtfs.GTFSFeed - 4 errors Feed start date: 2020-05-04 Feed end date: 2030-02-01 2557 [main] INFO com.conveyal.gtfs.GTFSFeed - GTFSError: calendar line 0: This table is required by the GTFS specification but is missing. 2557 [main] INFO com.conveyal.gtfs.GTFSFeed - GTFSError: fare_attributes line 0: Table is present in zip file, but it has no entries. 2557 [main] INFO com.conveyal.gtfs.GTFSFeed - GTFSError: frequencies line 0: Table is present in zip file, but it has no entries. 2557 [main] INFO com.conveyal.gtfs.GTFSFeed - GTFSError: transfers line 0: Table is present in zip file, but it has no entries. Parsed trips: 3678 Parsed routes: 22 Parsed stops: 1363 2020-05-07 21:50:51,638 INFO Config:572 setting context to [file:/C:/Users/Jalal/eclipse-workspace/tranist/GTFS2MATSim-master/] Exception in thread "main" java.lang.NoSuchMethodError: org.geotools.geometry.jts.JTS.transform(Lorg/locationtech/jts/geom/Geometry;Lorg/opengis/referencing/operation/MathTransform;)Lorg/locationtech/jts/geom/Geometry; at org.matsim.core.utils.geometry.transformations.GeotoolsTransformation.transform(GeotoolsTransformation.java:70) at org.matsim.contrib.gtfs.GtfsConverter.convertStops(GtfsConverter.java:125) at org.matsim.contrib.gtfs.GtfsConverter.convert(GtfsConverter.java:55) at org.matsim.contrib.gtfs.RunGTFS2MATSim.convertGtfs(RunGTFS2MATSim.java:45) at org.matsim.contrib.gtfs.RunGTFS2MATSimExample.main(RunGTFS2MATSimExample.java:63)