How to use the timezonefinder.global_settings.INVALID_ZONE_ID function in timezonefinder

To help you get started, we’ve selected a few timezonefinder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github MrMinimal64 / timezonefinder / timezonefinder / file_converter.py View on Github external
# write corresponding zone id for every shortcut (iff unique)
    path = 'shortcuts_unique_id.bin'
    print('writing file "', path, '"')
    output_file = open(path, 'wb')
    if poly_zone_ids[-1] >= INVALID_ZONE_ID:
        raise ValueError(
            'There are too many zones for this data type (H). The shortcuts_unique_id file need a Invalid Id!')
    for x in range(360 * NR_SHORTCUTS_PER_LNG):
        for y in range(180 * NR_SHORTCUTS_PER_LAT):
            try:
                shortcuts_this_entry = shortcuts[(x, y)]
                unique_id = poly_zone_ids[shortcuts_this_entry[0]]
                for nr in shortcuts_this_entry:
                    if poly_zone_ids[nr] != unique_id:
                        # there is a polygon from a different zone (hence an invalid id should be written)
                        unique_id = INVALID_ZONE_ID
                        break
                output_file.write(pack(b'
github MrMinimal64 / timezonefinder / timezonefinder / file_converter.py View on Github external
# write Line_Nrs for every shortcut
    path = 'shortcuts_data.bin'
    print('writing file "', path, '"')
    output_file = open(path, 'wb')
    for entries in shortcut_entries:
        for entry in entries:
            if entry > nr_of_lines:
                raise ValueError(entry)
            output_file.write(pack(b'= INVALID_ZONE_ID:
        raise ValueError(
            'There are too many zones for this data type (H). The shortcuts_unique_id file need a Invalid Id!')
    for x in range(360 * NR_SHORTCUTS_PER_LNG):
        for y in range(180 * NR_SHORTCUTS_PER_LAT):
            try:
                shortcuts_this_entry = shortcuts[(x, y)]
                unique_id = poly_zone_ids[shortcuts_this_entry[0]]
                for nr in shortcuts_this_entry:
                    if poly_zone_ids[nr] != unique_id:
                        # there is a polygon from a different zone (hence an invalid id should be written)
                        unique_id = INVALID_ZONE_ID
                        break
                output_file.write(pack(b'
github MrMinimal64 / timezonefinder / timezonefinder / file_converter.py View on Github external
raise ValueError(
            'There are too many zones for this data type (H). The shortcuts_unique_id file need a Invalid Id!')
    for x in range(360 * NR_SHORTCUTS_PER_LNG):
        for y in range(180 * NR_SHORTCUTS_PER_LAT):
            try:
                shortcuts_this_entry = shortcuts[(x, y)]
                unique_id = poly_zone_ids[shortcuts_this_entry[0]]
                for nr in shortcuts_this_entry:
                    if poly_zone_ids[nr] != unique_id:
                        # there is a polygon from a different zone (hence an invalid id should be written)
                        unique_id = INVALID_ZONE_ID
                        break
                output_file.write(pack(b' nr_of_lines:
            raise ValueError(line, nr_of_lines)
        output_file.write(pack(b'