How to use the sentinelsat.read_geojson function in sentinelsat

To help you get started, we’ve selected a few sentinelsat 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 sentinelsat / sentinelsat / tests / test_mod.py View on Github external
def test_boundaries_longitude_less(fixture_path):
    with pytest.raises(ValueError):
        geojson_to_wkt(read_geojson(fixture_path('map_boundaries_lon.geojson')))
github sentinelsat / sentinelsat / tests / test_geographic.py View on Github external
def test_boundaries_latitude_more(fixture_path):
    with pytest.raises(ValueError):
        geojson_to_wkt(read_geojson(fixture_path("map_boundaries_lat.geojson")))
github sentinelsat / sentinelsat / tests / test_mod.py View on Github external
def test_boundaries_latitude_more(fixture_path):
    with pytest.raises(ValueError):
        geojson_to_wkt(read_geojson(fixture_path('map_boundaries_lat.geojson')))
github sentinelsat / sentinelsat / tests / test_mod.py View on Github external
def test_get_coordinates(fixture_path):
    wkt = ('POLYGON((-66.2695 -8.0592,-66.2695 0.7031,'
           '-57.3047 0.7031,-57.3047 -8.0592,-66.2695 -8.0592))')
    assert geojson_to_wkt(read_geojson(fixture_path('map.geojson'))) == wkt
    assert geojson_to_wkt(read_geojson(fixture_path('map_z.geojson'))) == wkt
    assert geojson_to_wkt(read_geojson(fixture_path('map_nested.geojson'))) == wkt
github sentinelsat / sentinelsat / tests / test_geographic.py View on Github external
def test_get_coordinates(fixture_path):
    wkt = (
        "POLYGON((-66.2695 -8.0592,-66.2695 0.7031,"
        "-57.3047 0.7031,-57.3047 -8.0592,-66.2695 -8.0592))"
    )
    assert geojson_to_wkt(read_geojson(fixture_path("map.geojson"))) == wkt
    assert geojson_to_wkt(read_geojson(fixture_path("map_z.geojson"))) == wkt
    assert geojson_to_wkt(read_geojson(fixture_path("map_nested.geojson"))) == wkt
github sentinelsat / sentinelsat / tests / test_geographic.py View on Github external
def test_boundaries_longitude_less(fixture_path):
    with pytest.raises(ValueError):
        geojson_to_wkt(read_geojson(fixture_path("map_boundaries_lon.geojson")))
github clcr / pyeo / pyeo / queries_and_downloads.py View on Github external
The maximum cloud clover (as calculated by Copernicus) to download.

    Returns
    -------
    A dictionary of Sentinel-2 granule products that are touched by your AOI polygon, keyed by product ID.
    Returns both level 1 and level 2 data.

    Notes
    -----
    If you get a 'request too long' error, it is likely that your polygon is too complex. The following functions
    download by granule; there is no need to have a precise polygon at this stage.

    """
    # Originally by Ciaran Robb
    api = SentinelAPI(user, passwd)
    footprint = geojson_to_wkt(read_geojson(geojsonfile))
    log.info("Sending Sentinel-2 query:\nfootprint: {}\nstart_date: {}\nend_date: {}\n cloud_cover: {} ".format(
        footprint, start_date, end_date, cloud))
    products = api.query(footprint,
                         date=(start_date, end_date), platformname="Sentinel-2",
                         cloudcoverpercentage="[0 TO {}]".format(cloud))
    return products