Commit e2e036c9 authored by Nicolas Garcia Ospina's avatar Nicolas Garcia Ospina
Browse files

Fixed style

parent 90ced127
Pipeline #25855 passed with stage
in 3 minutes and 32 seconds
......@@ -125,7 +125,11 @@ def get_tiles_from_polygon(in_geometry):
try:
tiles.extend(Babel("bing").polyfill(in_geometry, resolution=args.zoom))
except ZeroDivisionError:
logger.info("Quadkeys with zoom level {} are bigger than the geometry {}. No quadkeys found in batch".format(args.zoom, in_geometry))
logger.info(
"No quadkeys with zoom level {} fit the geometry {}.".format(
args.zoom, in_geometry
)
)
elif in_geometry.geom_type == "MultiPolygon":
geometries = list(in_geometry)
for geometry in geometries:
......@@ -134,11 +138,13 @@ def get_tiles_from_polygon(in_geometry):
except ZeroDivisionError:
logger.info(
"Quadkeys with zoom level {} are bigger than the geometry {}".format(
args.zoom, in_geometry))
args.zoom, in_geometry
)
)
else:
raise IOError("Input is not a geometry.")
if len(tiles)>0:
if len(tiles) > 0:
tiles_ids = [tile.to_dict()["tile_id"] for tile in tiles]
logger.info("Found {} tiles in batch".format(len(tiles_ids)))
return tiles_ids
......@@ -159,7 +165,7 @@ def main():
# Remove possible duplicated quadkeys
flat_list_ids = list(set([item for sublist in data for item in sublist]))
if len(flat_list_ids)>0:
if len(flat_list_ids) > 0:
logger.info("Writing {} Quadkeys to {}".format(len(flat_list_ids), args.output))
outfile = open(args.output, "w")
......@@ -171,5 +177,6 @@ def main():
else:
logger.info("No output file will be produced")
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment