How to use the cligj.features.normalize_feature_inputs function in cligj

To help you get started, we’ve selected a few cligj 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 mapbox / cligj / tests / test_features.py View on Github external
def test_featurecollection_stdin(expected_features):
    sys.stdin = open("tests/twopoints.geojson", 'r')
    features = normalize_feature_inputs(None, 'features', [])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_featuresequence(expected_features):
    features = normalize_feature_inputs(
        None, 'features', ["tests/twopoints_seq.txt"])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_featurecollection_pretty_file(expected_features):
    features = normalize_feature_inputs(
        None, 'features', ["tests/twopoints-pretty.json"])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_featurecollection_file(expected_features):
    features = normalize_feature_inputs(
        None, 'features', ["tests/twopoints.geojson"])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_singlefeature(expected_features):
    features = normalize_feature_inputs(
        None, 'features', ["tests/onepoint.geojson"])
    assert _geoms(features) == _geoms([expected_features[0]])
github mapbox / cligj / tests / test_features.py View on Github external
def test_featuresequencers_stdin(expected_features):
    sys.stdin = open("tests/twopoints_seqrs.txt", 'r')
    features = normalize_feature_inputs(None, 'features', [])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_featuresequencers(expected_features):
    features = normalize_feature_inputs(
        None, 'features', ["tests/twopoints_seqrs.txt"])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_featuresequence_stdin(expected_features):
    sys.stdin = open("tests/twopoints_seq.txt", 'r')
    features = normalize_feature_inputs(None, 'features', [])
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / tests / test_features.py View on Github external
def test_coordpairs_space(expected_features):
    inputs = ["-122.7282 45.5801", "-121.3153 44.0582"]
    features = normalize_feature_inputs(None, 'features', inputs)
    assert _geoms(features) == _geoms(expected_features)
github mapbox / cligj / cligj / __init__.py View on Github external
# Multiple files, last of which is an output file.
files_inout_arg = click.argument(
    'files',
    nargs=-1,
    type=click.Path(resolve_path=True),
    required=True,
    metavar="INPUTS... OUTPUT")


# Features from files, command line args, or stdin.
# Returns the input data as an iterable of GeoJSON Feature-like
# dictionaries.
features_in_arg = click.argument(
    'features',
    nargs=-1,
    callback=normalize_feature_inputs,
    metavar="FEATURES...")


# Options.
verbose_opt = click.option(
    '--verbose', '-v',
    count=True,
    help="Increase verbosity.")

quiet_opt = click.option(
    '--quiet', '-q',
    count=True,
    help="Decrease verbosity.")

# Format driver option.
format_opt = click.option(