Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@cligj.indent_opt
def cmd(indent):
click.echo("%s" % indent)
@indent_opt
@compact_opt
@projection_geographic_opt
@projection_projected_opt
@projection_mercator_opt
@sequence_opt
@use_rs_opt
@geojson_type_collection_opt(True)
@geojson_type_feature_opt(False)
@geojson_type_bbox_opt(False)
@click.pass_context
def bounds(ctx, input, precision, indent, compact, projection, sequence,
use_rs, geojson_type):
"""Write bounding boxes to stdout as GeoJSON for use with, e.g.,
geojsonio
$ rio bounds *.tif | geojsonio
@indent_opt
# Options to pick out a single metadata item and print it as
# a string.
@click.option('--count', 'meta_member', flag_value='count',
help="Print the count of features.")
@click.option('-f', '--format', '--driver', 'meta_member', flag_value='driver',
help="Print the format driver.")
@click.option('--crs', 'meta_member', flag_value='crs',
help="Print the CRS as a PROJ.4 string.")
@click.option('--bounds', 'meta_member', flag_value='bounds',
help="Print the boundary coordinates "
"(left, bottom, right, top).")
@click.option('--name', 'meta_member', flag_value='name',
help="Print the datasource's name.")
@click.pass_context
@with_context_env
def info(ctx, input, indent, meta_member, layer):
@cligj.indent_opt
@cligj.compact_opt
@cligj.projection_projected_opt
@cligj.sequence_opt
@cligj.use_rs_opt
@click.option(
'--bidx', type=click.INT, default=0,
help="Index of the band that is the source of shapes.")
@click.pass_context
def blocks(
ctx, input, output, precision, indent, compact, projection, sequence,
use_rs, bidx):
"""Write dataset blocks as GeoJSON features.
This command writes features describing a raster's internal blocks, which
are used directly for raster I/O. These features can be used to visualize
@indent_opt
@compact_opt
@dst_crs_opt
@click.option(
"--pagesize", "-p", default=10000, help="Max number of records to request"
)
@click.option("--sortby", "-s", help="Name of sort field")
@click.option(
"--bounds-crs", "--bounds_crs", help="CRS of provided bounds", default="EPSG:3005"
)
@verbose_opt
@quiet_opt
def cat(
dataset,
query,
bounds,
bounds_crs,
@cligj.indent_opt
@cligj.compact_opt
@click.option('--record-buffered/--no-record-buffered', default=False,
help="Economical buffering of writes at record, not collection "
"(default), level.")
@click.option('--ignore-errors/--no-ignore-errors', default=False,
help="log errors but do not stop serialization.")
@click.option('--with-ld-context/--without-ld-context', default=False,
help="add a JSON-LD context to JSON output.")
@click.option('--add-ld-context-item', multiple=True,
help="map a term to a URI and add it to the output's JSON LD "
"context.")
@click.pass_context
@with_context_env
def dump(ctx, input, encoding, precision, indent, compact, record_buffered,
ignore_errors, with_ld_context, add_ld_context_item, layer):
@cligj.indent_opt
@cligj.compact_opt
@click.option('--ignore-errors/--no-ignore-errors', default=False,
help="log errors but do not stop serialization.")
@options.dst_crs_opt
@cligj.use_rs_opt
@click.option('--bbox', default=None, metavar="w,s,e,n",
help="filter for features intersecting a bounding box")
@click.pass_context
@with_context_env
def cat(ctx, files, precision, indent, compact, ignore_errors, dst_crs,
use_rs, bbox, layer):
"""
Concatenate and print the features of input datasets as a sequence of
GeoJSON features.
When working with a multi-layer dataset the first layer is used by default.
@indent_opt
@click.pass_context
@with_context_env
def ls(ctx, input, indent):
"""
List layers in a datasource.
"""
result = fiona.listlayers(input)
click.echo(json.dumps(result, indent=indent))
@indent_opt
@compact_opt
@projection_geographic_opt
@projection_projected_opt
@projection_mercator_opt
@click.option(
'--dst-crs', default='', metavar="EPSG:NNNN", callback=to_lower,
help="Output in specified coordinates.")
@options.sequence_opt
@use_rs_opt
@geojson_type_collection_opt(True)
@geojson_type_feature_opt(False)
@geojson_type_bbox_opt(False)
@click.pass_context
def bounds(ctx, input, precision, indent, compact, projection, dst_crs,
sequence, use_rs, geojson_type):
"""Write bounding boxes to stdout as GeoJSON for use with, e.g.,
@indent_opt
@compact_opt
@projection_geographic_opt
@projection_projected_opt
@sequence_opt
@use_rs_opt
@geojson_type_feature_opt(True)
@geojson_type_bbox_opt(False)
@click.option('--band/--mask', default=True,
help="Choose to extract from a band (the default) or a mask.")
@click.option('--bidx', 'bandidx', type=int, default=None,
help="Index of the band or mask that is the source of shapes.")
@click.option('--sampling', type=int, default=1,
help="Inverse of the sampling fraction; "
"a value of 10 decimates.")
@click.option('--with-nodata/--without-nodata', default=False,
help="Include or do not include (the default) nodata regions.")