예제 #1
0
def download(geojson_file, basepath, output, progress):
    """
    Download features' image_url/label_url data products
    """
    features = geojson.read(geojson_file)
    products = []
    for feature in features:
        mod_feature = Download.run(feature,
                                   base_path=basepath,
                                   progressbar=progress)
        products.append(mod_feature)
    log.debug(products)
    if output:
        json_2_geojson(products, filename=output)
    else:
        import json
        click.echo(json.dumps(products, indent=2))
예제 #2
0
def process(geojson_file, basepath, output, tmpdir):
    """
    WIP
    """
    features = geojson.read(geojson_file)
    if docker_isis:
        from npt import isis
        isis.set_docker(docker_isis)
    products = []
    for feature in features:
        mod_feature = Processing.run(feature,
                                     output_path=basepath,
                                     tmpdir=tmpdir)
        products.append(mod_feature)
    log.debug(products)
    if output:
        json_2_geojson(products, filename=output)
    else:
        import json
        click.echo(json.dumps(products, indent=2))
예제 #3
0
파일: _sh.py 프로젝트: chbrandt/npt
 def _sh(*args, **kwargs):
     v = [f'{v}' for v in args]
     kv = [f'{k}={v}' for k, v in kwargs.items()]
     comm = ' '.join(exec + v + kv)
     log.debug(comm)
     return sh(comm)
예제 #4
0
파일: _sh.py 프로젝트: chbrandt/npt
 def reset(self):
     _sh = _set_sh()
     log.debug(_sh)
     self._sh = _sh
예제 #5
0
파일: _sh.py 프로젝트: chbrandt/npt
 def log(res):
     log.debug("Exit code: " + str(res and res.exit_code))