git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@771 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-09-10 10:11:05 +00:00
parent 959fff56db
commit df12d363da
4 changed files with 301 additions and 1 deletions

View file

@ -940,6 +940,96 @@ public abstract class AbstractEfaProvider implements NetworkProvider
return 'R' + name;
if ("RegionalExpress".equals(noTrainName)) // Liechtenstein
return 'R' + name;
if ("Ostdeutsche".equals(type)) // Bayern
return 'R' + type;
if ("Südwestdeutsche".equals(type)) // Bayern
return 'R' + type;
if ("Mitteldeutsche".equals(type)) // Bayern
return 'R' + type;
if ("Norddeutsche".equals(type)) // Bayern
return 'R' + type;
if ("Hellertalbahn".equals(type)) // Bayern
return 'R' + type;
if ("Veolia".equals(type)) // Bayern
return 'R' + type;
if ("vectus".equals(type)) // Bayern
return 'R' + type;
if ("Hessische".equals(type)) // Bayern
return 'R' + type;
if ("Niederbarnimer".equals(type)) // Bayern
return 'R' + type;
if ("Rurtalbahn".equals(type)) // Bayern
return 'R' + type;
if ("Rhenus".equals(type)) // Bayern
return 'R' + type;
if ("Mittelrheinbahn".equals(type)) // Bayern
return 'R' + type;
if ("Hohenzollerische".equals(type)) // Bayern
return 'R' + type;
if ("Städtebahn".equals(type)) // Bayern
return 'R' + type;
if ("Ortenau-S-Bahn".equals(type)) // Bayern
return 'R' + type;
if ("Daadetalbahn".equals(type)) // Bayern
return 'R' + type;
if ("Mainschleifenbahn".equals(type)) // Bayern
return 'R' + type;
if ("Nordbahn".equals(type)) // Bayern
return 'R' + type;
if ("Harzer".equals(type)) // Bayern
return 'R' + type;
if ("cantus".equals(type)) // Bayern
return 'R' + type;
if ("DPF".equals(type)) // Bayern, Vogtland-Express
return 'R' + type;
if ("Freiberger".equals(type)) // Bayern
return 'R' + type;
if ("metronom".equals(type)) // Bayern
return 'R' + type;
if ("Prignitzer".equals(type)) // Bayern
return 'R' + type;
if ("Sächsisch-Oberlausitzer".equals(type)) // Bayern
return 'R' + type;
if ("Ostseeland".equals(type)) // Bayern
return 'R' + type;
if ("NordOstseeBahn".equals(type)) // Bayern
return 'R' + type;
if ("ELBE-WESER".equals(type)) // Bayern
return 'R' + type;
if ("TRILEX".equals(type)) // Bayern
return 'R' + type;
if ("Schleswig-Holstein-Bahn".equals(type)) // Bayern
return 'R' + type;
if ("Vetter".equals(type)) // Bayern
return 'R' + type;
if ("Dessau-Wörlitzer".equals(type)) // Bayern
return 'R' + type;
if ("NATURPARK-EXPRESS".equals(type)) // Bayern
return 'R' + type;
if ("Usedomer".equals(type)) // Bayern
return 'R' + type;
if ("Märkische".equals(type)) // Bayern
return 'R' + type;
if ("Vulkan-Eifel-Bahn".equals(type)) // Bayern
return 'R' + type;
if ("Kandertalbahn".equals(type)) // Bayern
return 'R' + type;
if ("RAD-WANDER-SHUTTLE".equals(type)) // Bayern, Hohenzollerische Landesbahn
return 'R' + type;
if ("RADEXPRESS".equals(type)) // Bayern, RADEXPRESS EYACHTÄLER
return 'R' + type;
if ("Dampfzug".equals(type)) // Bayern
return 'R' + type;
if ("Wutachtalbahn".equals(type)) // Bayern
return 'R' + type;
if ("Grensland-Express".equals(type)) // Bayern
return 'R' + type;
if ("Mecklenburgische".equals(type)) // Bayern
return 'R' + type;
if ("Bentheimer".equals(type)) // Bayern
return 'R' + type;
if ("Pressnitztalbahn".equals(type)) // Bayern
return 'R' + type;
if (type.equals("BSB")) // Breisgau-S-Bahn
return 'S' + str;
@ -952,6 +1042,8 @@ public abstract class AbstractEfaProvider implements NetworkProvider
final Matcher m = P_LINE_S.matcher(name);
if (m.find())
return 'S' + m.group(1);
if ("Breisgau-S-Bahn".equals(type)) // Bayern
return 'S' + type;
if (P_LINE_U.matcher(type).matches())
return 'U' + str;

View file

@ -0,0 +1,68 @@
/*
* Copyright 2010, 2011 the original author or authors.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.schildbach.pte;
import java.io.IOException;
import java.util.List;
import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType;
/**
* @author Andreas Schildbach
*/
public class BayernProvider extends AbstractEfaProvider
{
public static final NetworkId NETWORK_ID = NetworkId.BAYERN;
private final static String API_BASE = "http://bayern-fahrplan.defas-fgi.de:50200/standard/";
public BayernProvider()
{
super(API_BASE, null);
}
public NetworkId id()
{
return NETWORK_ID;
}
public boolean hasCapabilities(Capability... capabilities)
{
for (final Capability capability : capabilities)
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.CONNECTIONS)
return true;
return false;
}
private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST"
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
@Override
protected String nearbyStationUri(final int stationId)
{
return String.format(NEARBY_STATION_URI, stationId);
}
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
}
}

View file

@ -26,7 +26,7 @@ public enum NetworkId
RT,
// Germany
DB, BVG, VBB, RMV, NVV, VRT, MVV, INVG, AVV, VMV, HVV, SH, GVH, BSVAG, BSAG, VBN, NASA, VVO, VMS, VGS, VRR, VRS, MVG, NPH, VRN, VVS, NALDO, DING, KVV, VVM, VAGFR, NVBW,
DB, BVG, VBB, RMV, NVV, VRT, BAYERN, MVV, INVG, AVV, VMV, HVV, SH, GVH, BSVAG, BSAG, VBN, NASA, VVO, VMS, VGS, VRR, VRS, MVG, NPH, VRN, VVS, NALDO, DING, KVV, VVM, VAGFR, NVBW,
// Austria
OEBB, VOR, LINZ, SVV, VMOBIL, IVB, STV,