public Route(GTFSPropertyCollection properties) : base(properties, "route_id")
 {
     if (!properties.ContainsKey("route_short_name") && !properties.ContainsKey("route_long_name"))
     {
         throw new InvalidDataException("Routes must have either a long name or a short name.");
     }
     if (!properties.IsInt("route_type"))
     {
         throw new InvalidDataException("Routes must have a type.");
     }
 }
Beispiel #2
0
        public static double GetDouble(this GTFSPropertyCollection properties, string key, double?def = null)
        {
            string input = properties[key];
            double?ret   = GetNullableDouble(input);

            if (ret.HasValue)
            {
                return(ret.Value);
            }
            if (def.HasValue)
            {
                return(def.Value);
            }
            throw new ArgumentException($"{input} could not be cast to a number.");
        }
Beispiel #3
0
 public GTFSOrderedEntity(GTFSPropertyCollection properties, string idKey, string indexKey) : base(properties, properties[idKey], properties.GetInt(indexKey))
 {
     ID    = FirstKey;
     Index = SecondKey;
 }
 public FareRule(GTFSPropertyCollection properties) : base(properties)
 {
 }
Beispiel #5
0
 public static bool IsColor(this GTFSPropertyCollection properties, string key) => IsColor(properties[key]);
Beispiel #6
0
 public static Color GetColor(this GTFSPropertyCollection properties, string key, Color?def = null) => GetColor(properties[key], def);
Beispiel #7
0
 public static bool?GetNullableBool(this GTFSPropertyCollection properties, string key) => GetNullableBool(properties[key]);
Beispiel #8
0
 public static bool IsNonNegativeDouble(this GTFSPropertyCollection properties, string key) => IsNonNegativeDouble(properties[key]);
Beispiel #9
0
 public static decimal?GetNullableNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDecimal(properties[key]);
 public FeedInfo(GTFSPropertyCollection properties) : base(properties)
 {
 }
Beispiel #11
0
 public Transfer(GTFSPropertyCollection properties) : base(properties, properties["from_stop_id"], properties["to_stop_id"])
 {
 }
Beispiel #12
0
 public Attribution(GTFSPropertyCollection properties) : base(properties)
 {
 }
 public FareAttribute(GTFSPropertyCollection properties) : base(properties, "fare_id")
 {
 }
Beispiel #14
0
 public Trip(GTFSPropertyCollection properties) : base(properties, "trip_id")
 {
 }
Beispiel #15
0
 public Level(GTFSPropertyCollection properties) : base(properties, "level_id")
 {
 }
Beispiel #16
0
 public static int?GetNullableNonNegativeInt(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeInt(properties[key]);
Beispiel #17
0
 public static Color?GetNullableColor(this GTFSPropertyCollection properties, string key) => GetNullableColor(properties[key]);
Beispiel #18
0
 public static LocalDate?GetNullableDate(this GTFSPropertyCollection properties, string key) => GetNullableDate(properties[key]);
Beispiel #19
0
 public static double?GetNullableNonNegativeDouble(this GTFSPropertyCollection properties, string key) => GetNullableNonNegativeDouble(properties[key]);
Beispiel #20
0
 public static LocalDate GetDate(this GTFSPropertyCollection properties, string key, LocalDate?def = null) => GetDate(properties[key], def);
Beispiel #21
0
 public static void AssertNonNegativeDecimal(this GTFSPropertyCollection properties, string key) => AssertDecimal(properties[key], key);
Beispiel #22
0
 public static Duration?GetNullableDuration(this GTFSPropertyCollection properties, string key) => GetNullableDuration(properties[key]);
Beispiel #23
0
 public static void AssertForeignKeyExists <T>(this GTFSPropertyCollection properties, string key, GTFSOrderedEntityCollection <T> collection, string collectionName) where T : GTFSOrderedEntity
 => AssertForeignKeyExists(properties[key], key, collection, collectionName);
Beispiel #24
0
 public static Duration GetDuration(this GTFSPropertyCollection properties, string key, Duration?def = null) => GetDuration(properties[key], def);
Beispiel #25
0
 public static void AssertForeignKeyExists(this GTFSPropertyCollection properties, string key, GTFSCalendarCollection collection, string collectionName)
 => AssertForeignKeyExists(properties[key], key, collection, collectionName);
Beispiel #26
0
 public static bool IsDuration(this GTFSPropertyCollection properties, string key) => IsNonNegativeInt(properties[key]);
Beispiel #27
0
 public static void AssertColor(this GTFSPropertyCollection properties, string key) => AssertColor(properties[key], key);
Beispiel #28
0
 public static DateTimeZone GetTimeZone(this GTFSPropertyCollection properties, string key) => GetTimeZone(properties[key]);
Beispiel #29
0
 public Agency(GTFSPropertyCollection properties) : base(properties, "agency_id")
 {
 }
 public GTFSUnparsedEntity(GTFSPropertyCollection properties, Exception ex) : base(properties)
 {
     Exception = ex;
 }