private Network createMatsimNetwork(String osmFile){
  Scenario sc=ScenarioUtils.createScenario(ConfigUtils.createConfig());
  NetworkSink networkGenerator=createAndInitNetworkSink(sc,TransformationFactory.getCoordinateTransformation(TransformationFactory.WGS84,TransformationFactory.WGS84));
  TagFilter transitRelationsFilter=createTransitRelationsFilter();
  TagFilter transitWaysFilter=createTransitWaysFilter();
  FastXmlReader reader=new FastXmlReader(new File(osmFile),true,CompressionMethod.None);
  reader.setSink(transitRelationsFilter);
  transitRelationsFilter.setSink(transitWaysFilter);
  transitWaysFilter.setSink(networkGenerator);
  networkGenerator.setSink(new NullWriter());
  reader.run();
  NetworkCalcTopoType networkCalcTopoType=new NetworkCalcTopoType();
  networkCalcTopoType.run(sc.getNetwork());
  return sc.getNetwork();
}

private Network createMatsimNetwork ( String osmFile ) { Scenario sc = ScenarioUtils . createScenario ( ConfigUtils . createConfig ( ) ) ; NetworkSink networkGenerator = createAndInitNetworkSink ( sc , TransformationFactory . getCoordinateTransformation ( TransformationFactory . WGS84 , TransformationFactory . WGS84 ) ) ; TagFilter transitRelationsFilter = createTransitRelationsFilter ( ) ; TagFilter transitWaysFilter = createTransitWaysFilter ( ) ; FastXmlReader reader = new FastXmlReader ( new File ( osmFile ) , true , CompressionMethod . None ) ; reader . setSink ( transitRelationsFilter ) ; transitRelationsFilter . setSink ( transitWaysFilter ) ; transitWaysFilter . setSink ( networkGenerator ) ; networkGenerator . setSink ( new NullWriter ( ) ) ; reader . run ( ) ; NetworkCalcTopoType networkCalcTopoType = new NetworkCalcTopoType ( ) ; networkCalcTopoType . run ( sc . getNetwork ( ) ) ; return sc . getNetwork ( ) ; }
creates an matsim network from the osm file
