Example #1
0
def sns_worker(messages, topic, subject=None):
    """Send batch of SNS messages."""
    session = boto3_session()
    client = session.client("sns")
    for message in messages:
        client.publish(Message=json.dumps(message), TargetArn=topic)
    return True


@click.command()
@click.argument("sources", default="-", type=click.File("r"), callback=sources_callback)
@click.option(
    "--cog-profile",
    "-p",
    "cogeo_profile",
    type=click.Choice(cog_profiles.keys()),
    default="deflate",
    help="CloudOptimized GeoTIFF profile (default: deflate).",
)
@options.creation_options
@click.option(
    "--options",
    "--op",
    "options",
    metavar="NAME=VALUE",
    multiple=True,
    callback=options._cb_key_val,
    help="rio_cogeo.cogeo.cog_translate input options.",
)
@click.option(
    "--allow-remote-read",
Example #2
0
    """Rasterio cogeo subcommands."""
    pass


@cogeo.command(short_help="Create COGEO")
@options.file_in_arg
@options.file_out_arg
@click.option("--bidx",
              "-b",
              type=BdxParamType(),
              help="Band indexes to copy.")
@click.option(
    "--cog-profile",
    "-p",
    "cogeo_profile",
    type=click.Choice(cog_profiles.keys(), case_sensitive=False),
    default="deflate",
    help="CloudOptimized GeoTIFF profile (default: deflate).",
)
@click.option(
    "--nodata",
    type=NodataParamType(),
    metavar="NUMBER|nan",
    help="Set nodata masking values for input dataset.",
)
@click.option(
    "--add-mask",
    is_flag=True,
    help="Force output dataset creation with an internal mask (convert alpha "
    "band or nodata to mask).",
)