Open russellhoff opened 8 years ago
Anybody?
Still undergoing that issue.
New attribute eligibilityRestricted is not being ignored.
Hi Russell,
can you attach a sample GTFS that demonstrates the issue, and tell us a bit more about your use case? Are you using the GTFS Transformer CLI?
And sorry for the delay in responding ...
Sheldon
Hi @sheldonabrown,
No worries, I understand the delay. In the latest version of onebusaway-gtfs-modules
, 1.3.48, attribute eligibilityRestricted
isn't only being ignored, but I never set it to any value.
For instance, when it comes to the creation of Routes, I create them that way:
public class GtfsDataBuilderWS extends GTFSDataBuilder {
// ...
private List<Route> routes;
// ...
@Override
public void buildAll(String pCodigoOperador) throws Throwable {
// ...
routesBuilder();
// ...
buildFile();
}
// ...
@Override
protected void routesBuilder() throws Exception {
logHelper.logMessage("\t[4] Construyendo Route...");
LineasDTO lineas = imp.importarLineas(codigoOperador);
routes = new ArrayList<Route>();
shapes = new HashMap<String, ShapePointArray>();
Route aRoute = null;
AgencyAndId theId = null;
for(LineaDTO linea : lineas.getListaLineas()){
aRoute = new Route();
theId = new AgencyAndId(codigoOperador, linea.getCodigoLinea());
aRoute.setAgency(agency);
aRoute.setId(theId);
aRoute.setShortName(linea.getDescripcionCorta());
aRoute.setLongName(linea.getDescripcionLarga());
aRoute.setType(3);
tripsBuilder(linea.getCodigoLinea(), aRoute);
aRoute = maestrosSobrescribir.sobrescribirRoute(codigoOperador, aRoute);
routes.add(aRoute);
}
logHelper.logMessage("\t[4] Route construido.");
}
private void buildFile() throws SecurityException, IOException {
GtfsWriter writer = new GtfsWriter();
PropertiesConfiguration config = GenerarGtfs.getPropConfig();
String path = config.getRoot_export_dir() + File.separator + config.getFolder(codigoOperador);
File outputDir = new File(path);
if(outputDir.exists()){
if(outputDir.isDirectory()){
FileUtils.deleteDirectory(outputDir);
}
}else{
outputDir.mkdirs();
}
writer.setOutputLocation(outputDir);
// ...
// Routes
List<Object> routesObjects = new ArrayList<Object>();
routesObjects.addAll(routes);
writer.excludeOptionalAndMissingFields(Route.class, routesObjects);
routes.forEach((route)->{
writer.handleEntity(route);
});
// ...
writer.close();
// Comprimimos
ZipHelper.compressAgencyGtfsFiles(codigoOperador);
}
Finally, the routes.txt file contains rows with the column eligibilityRestricted
valued -999.
Anything on this issue?
I've been able to ignore extra columns for Agency, for instance, as follows:
` private Agency agency;
`
But, when it comes to ignore optional columns for FareAttributes, there are two columns which aren't ignored when generating TXTs. This is the piece of code regarding Fares:
` private List fares;
// ...
// Fares logHelper.logMessage("\t[11.5] Construyendo fare_attributes.txt y fare_rules.txt...");
Is that a bug or not?