How should GTFS transform strategies interact with extensions?
kurtraschke opened this issue · comments
Summary:
onebusaway-gtfs
provides an extension mechanism (via onebusaway-csv-entities
) which can be used when reading and writing GTFS feeds (in order to read or write fields which are not declared in the model class). However, there is no mechanism for transform strategies in onebusaway-gtfs-transformer
to register their intention to use a particular extension, so when GtfsTransformer
reads or writes GTFS, transforms are unable to register their extensions with the EntitySchemaFactory
, and thus extensions are neither read nor written.
Note that there are some code fragments (specifically, the SchemaUpdateStrategy
class, and GtfsTransformer.writeGtfs()
) that suggest a prior effort to address this?
Somewhat (tangentially) related to #102, particularly as it pertains to modularizing/extracting agency-specific transforms (if they depend on extension fields).
Steps to reproduce:
- Implement
GtfsTransformStrategy
. - Call
.putExtension()
or.getExtension()
on an instance of a GTFS model class.
Expected behavior:
GTFS transform strategies should be able to declare the extensions they will use when reading or writing feeds.
Observed behavior:
GTFS transform strategies are not able to declare the extensions they will use, so they are not able to use the extension mechanism to read or write columns other than those declared in the model classes.