#
# Sources description
#

# That one is completely empty on purpose
feed:


airports:
    paths     : Airports/GeoNames/airports_geonames_only_clean.csv
    key_fields: iata_code
    delimiter : ^
    headers   :
        - iata_code
        - name
        - city_code
        - country_code
        - country_name
        - lat
        - lng


countries:
    paths     :
        #- /thing/that/does/not/exist
        - Countries/countryInfo.txt
        - 'http://download.geonames.org/export/dump/countryInfo.txt'
    key_fields: code
    delimiter : "\t"
    subdelimiters :
        languages : ','
        neighbors : ','
    headers   :
        - code
        - iso_alpha3
        - iso_numeric
        - fips_code
        - name
        - capital
        - area_in_sq_km
        - population
        - continent
        - tld
        - currency_code
        - currency_name
        - phone
        - postal_code_format
        - postal_code_regex
        - languages
        - geoname_id
        - neighbors


capitals:
    paths     : Countries/capitals.csv
    key_fields: country_code
    delimiter : ^
    headers   :
        - country_code
        - capital_name
        - country_name
        - area_in_sq_km
        - population
        - lat
        - lng


continents:
    paths     : Continents/continentCodes.txt
    key_fields: code
    delimiter : "\t"
    headers   :
        - code
        - name
        - geoname_id


stations:
    paths     : TrainStations/DataGouvFr/RFF_gares.ids.gm.man.red.csv
    key_fields: code
    delimiter : ^
    subdelimiters :
        lines: ','
    headers   :
        - code
        - lines
        - name
        - info
        - lat
        - lng


stations_nls:
    paths     : TrainStations/NLS/NLS_CODES_RefDataSNCF.csv
    key_fields: nls_code
    delimiter : ','
    headers   :
        - uic_code
        - name
        - nls_code
        - physical


stations_uic:
    paths     : TrainStations/UIC/sncfExtract_v1.0.csv
    key_fields: uic_code
    delimiter : ','
    headers   :
        - uic_code
        - name
        - lat
        - lng


languages:
    paths     :
        - Languages/iso-languagecodes.txt
        - 'http://download.geonames.org/export/dump/iso-languagecodes.txt'
    key_fields: code
    delimiter : "\t"
    skip      : 1
    headers   :
        - code
        - code_iso_2
        - code_iso_1
        - name


timezones:
    paths     :
        - TimeZones/timeZones.txt
        - 'http://download.geonames.org/export/dump/timeZones.txt'
    key_fields: code
    delimiter : "\t"
    skip      : 1
    headers   :
        - country_code
        - code
        - gmt_offset
        - dst_offset
        - raw_offset


cities:
    paths     :
        - archive : Cities/cities15000.zip
          file    : cities15000.txt
        - archive : 'http://download.geonames.org/export/dump/cities15000.zip'
          file    : cities15000.txt
    key_fields: code
    delimiter : "\t"
    subdelimiters :
        alternatenames : ','
    headers   :
        - code
        - name
        - asciiname
        - alternatenames
        - lat
        - lng
        - fclass
        - fcode
        - country_code
        - cc2
        - admin1
        - admin2
        - admin3
        - admin4
        - population
        - elevation
        - dem
        - timezone
        - modification


ori_por:
    paths         : &ori_por_paths
        - Por/Ori/ori_por_public.csv
        - 'https://github.com/opentraveldata/optd/raw/trunk/refdata/ORI/ori_por_public.csv'
    key_fields    : iata_code
    indices       : [iata_code, [iata_code, country_code]]
    limit         : # put a number to load only the first lines
    skip          : 1 # put a number to skip the first lines
    discard_dups  : false # This is the default behavior anyway
    delimiter     : ^
    subdelimiters : &ori_por_subdel
        # Here you may put '' to
        # split every char 'AB' -> ['A', 'B']
        #location_type    : ''
        alt_name_section : ['=', '|']
        tvl_por_list     : ','
    headers : &ori_por_headers
        - iata_code
        - icao_code
        - faa_code
        - is_geonames
        - geoname_id
        - valid_id
        - name
        - asciiname
        - lat           # is latitude  in ori_por headers
        - lng           # is longitude in ori_por headers
        - fclass
        - fcode
        - page_rank
        - date_from
        - date_until
        - comment
        - country_code
        - cc2
        - country_name
        - continent_name
        - adm1_code
        - adm1_name_utf
        - adm1_name_ascii
        - adm2_code
        - adm2_name_utf
        - adm2_name_ascii
        - adm3_code
        - adm4_code
        - population
        - elevation
        - gtopo30
        - timezone
        - gmt_offset
        - dst_offset
        - raw_offset
        - moddate
        - city_code
        - city_name_utf
        - city_name_ascii
        - tvl_por_list
        - state_code
        - location_type
        - wiki_link
        - alt_name_section


ori_por_multi:
    paths         : *ori_por_paths
    key_fields    : [iata_code, location_type]
    delimiter     : ^
    skip          : 1
    subdelimiters : *ori_por_subdel
    headers       : *ori_por_headers


ori_por_non_iata:
    paths         :
        - Por/Ori/ori_por_non_iata.csv
        - 'https://github.com/opentraveldata/optd/raw/trunk/refdata/ORI/ori_por_non_iata.csv'
    key_fields    : iata_code
    delimiter     : ^
    skip          : 1
    subdelimiters : *ori_por_subdel
    headers       : *ori_por_headers


currencies:
    paths     : Currencies/wiki_source_ISO_4217.csv
    key_fields: currency_code
    delimiter : ;
    subdelimiters :
        countries : ','
    headers   :
        - currency_code
        - numeric_code
        - digits_number
        - currency_name
        - countries


airlines:
    paths     :
        - Airlines/ori_airlines.csv
        - 'https://github.com/opentraveldata/optd/raw/trunk/refdata/ORI/ori_airlines.csv'
    key_fields: unified_code
    delimiter : ^
    skip      : 1
    headers   :
        - unified_code
        - 3char_code
        - 2char_code
        - num_code
        - name
        - name2
        - alliance_code
        - alliance_status


cabins:
    paths     : Cabins/cabins.csv
    key_fields: code
    delimiter : ^
    headers   :
        - code
        - name


locales:
    paths     : Locales/locales.csv
    key_fields: locale
    delimiter : ;
    headers   :
        - locale
        - title
        - language
        - territory
        - revision
        - date
        - codeset


location_types:
    paths     : LocationTypes/location_types.csv
    key_fields: location_type
    delimiter : ^
    headers   :
        - location_type
        - name


feature_classes:
    paths     : FeatureClasses/feature_classes.csv
    key_fields: fclass
    delimiter : ^
    headers   :
        - fclass
        - name


feature_codes:
    paths     : FeatureCodes/featureCodes_en.txt
    key_fields: fcode
    delimiter : "\t"
    headers   :
        - fclass
        - fcode
        - name
        - description


geonames_FR:
    paths     :
        - archive : Por/GeoNames/FR.zip
          file    : FR.txt
        - archive : 'http://download.geonames.org/export/dump/FR.zip'
          file    : FR.txt
    key_fields: geoname_id
    delimiter : "\t"
    subdelimiters :
        alternatenames : ','
    headers   : &geonames_headers
        - geoname_id
        - name
        - asciiname
        - alternatenames
        - lat
        - lng
        - fclass
        - fcode
        - country_code
        - cc2
        - adm1_code
        - adm2_code
        - adm3_code
        - adm4_code
        - population
        - elevation
        - dem
        - timezone
        - moddate


geonames_MC:
    paths     :
        - archive : Por/GeoNames/MC.zip
          file    : MC.txt
        - archive : 'http://download.geonames.org/export/dump/MC.zip'
          file    : MC.txt
    key_fields: geoname_id
    delimiter : "\t"
    subdelimiters :
        alternatenames : ','
    headers   : *geonames_headers


postal_codes_FR:
    paths     :
        - archive : PostalCodes/GeoNames/FR.zip
          file    : FR.txt
        - archive : 'http://download.geonames.org/export/zip/FR.zip'
          file    : FR.txt
    key_fields: &postal_codes_key postal_code
    delimiter : "\t"
    headers   : &postal_codes_headers
        - country_code
        - postal_code
        - name
        - adm1_name
        - adm1_code
        - adm2_name
        - adm2_code
        - adm3_name
        - adm3_code
        - lat
        - lng
        - accuracy


postal_codes_MC:
    paths     :
        - archive : PostalCodes/GeoNames/MC.zip
          file    : MC.txt
        - archive : 'http://download.geonames.org/export/zip/MC.zip'
          file    : MC.txt
    key_fields: *postal_codes_key
    delimiter : "\t"
    headers   : *postal_codes_headers

