Class GtfsZoningReader

  • All Implemented Interfaces:
    ConverterEntity, ConverterReader<Zoning>, ZoningReader

    public class GtfsZoningReader
    extends Object
    implements ZoningReader
    Parse GTFS input in supplement or populate a PLANit zoning instance with the parsed/matched GTFS entities. In case an existing zoning instance is provided, the GTFS will supplement the existing public transport infrastructure where possible, while if the zoning is empty it will create new entries for each of the found transfer zones (pt stops etc).
    Author:
    markr
    • Constructor Detail

      • GtfsZoningReader

        protected GtfsZoningReader​(GtfsZoningReaderSettings settings,
                                   Zoning zoningToPopulate)
        Constructor. Requires user to set reference network and networkToZoning data manually afterwards
        Parameters:
        settings - to use
        zoningToPopulate - zoning to populate
      • GtfsZoningReader

        protected GtfsZoningReader​(GtfsZoningReaderSettings settings,
                                   Zoning zoningToPopulate,
                                   ServiceNetwork serviceNetwork,
                                   RoutedServices routedServices)
        Constructor.
        Parameters:
        settings - to use
        zoningToPopulate - zoning to populate
        serviceNetwork - the compatible PLANit service network that is assumed to have been constructed from the same GTFS source files as this zoning reader will use
        routedServices - the compatible PLANit routed services that is assumed to have been constructed from the same GTFS source files as this zoning reader will use
    • Method Detail

      • read

        public Zoning read()
        Parse a GTFS files and convert it into a PLANit Zoning instance, or supplement the transfer zones of an already existing instance given the configuration options that have been set
        Specified by:
        read in interface ConverterReader<Zoning>
        Returns:
        macroscopic zoning that has been parsed or supplemented
      • reset

        public void reset()
        reset the reader to allow for marking unnecessary resources for garbage collection
        Specified by:
        reset in interface ConverterEntity
      • getGtfsStopIdToTransferZoneMapping

        public Function<String,​TransferZone> getGtfsStopIdToTransferZoneMapping()
        Provide mapping between GTFS Stop id and its found/created PLANit transfer zone (if any)
        Returns:
        function that takes a GTFS stop id (String) and produces the PLANit transfer zone that goes with it if any)