Giter VIP home page Giter VIP logo

restee's People

Contributors

kmarkert avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

restee's Issues

Support for large area requests

Need to add in support for users to be able to request large areas. Right now if there are too many pixels being requested then it fails. We can chuck a domain into smaller domains for request and merge them all back together.

GeoPandas driver error

I believe I have set up everything correctly, but the following code:

import ee
ee.Initialize()

import restee as ree

# get an authenticated session with GCP for REST API calls
session = ree.EESession("<secret>","<super secret>")

# use ee to get a featurecollection for USA
countries = ee.FeatureCollection("USDOS/LSIB_SIMPLE/2017")
camerica= countries.filter(ee.Filter.eq("wld_rgn", "Central America"))

# define the domain imagery will be requested for
# in this case it is the computed USA featurecollection
domain = ree.Domain.from_ee_geometry(session,camerica,resolution=0.01)

gives the following error: DriverError: '/vsimem/5c2fb0daef8141bc9dc81453856ced7c' not recognized as a supported file format.
full traceback:

---------------------------------------------------------------------------
CPLE_OpenFailedError                      Traceback (most recent call last)
fiona/_shim.pyx in fiona._shim.gdal_open_vector()

fiona/_err.pyx in fiona._err.exc_wrap_pointer()

CPLE_OpenFailedError: '/vsimem/5c2fb0daef8141bc9dc81453856ced7c' not recognized as a supported file format.

During handling of the above exception, another exception occurred:

DriverError                               Traceback (most recent call last)
/tmp/ipykernel_3018/3436715166.py in <module>
     13 # define the domain imagery will be requested for
     14 # in this case it is the computed USA featurecollection
---> 15 domain = ree.Domain.from_ee_geometry(session,camerica,resolution=0.01)
     16 
     17 # define some computations

~/miniconda3/envs/xaquacrop-dev/lib/python3.9/site-packages/restee/core.py in from_ee_geometry(session, geom, resolution)
    231         response = session.send_request(url, payload)
    232 
--> 233         gdf = gpd.read_file(StringIO(response.content.decode()))
    234 
    235         return Domain.from_geopandas(gdf, resolution=resolution)

~/miniconda3/envs/xaquacrop-dev/lib/python3.9/site-packages/geopandas/io/file.py in _read_file(filename, bbox, mask, rows, **kwargs)
    199 
    200     with fiona_env():
--> 201         with reader(path_or_bytes, **kwargs) as features:
    202 
    203             # In a future Fiona release the crs attribute of features will

~/miniconda3/envs/xaquacrop-dev/lib/python3.9/site-packages/fiona/collection.py in __init__(self, bytesbuf, **kwds)
    553 
    554         # Instantiate the parent class.
--> 555         super(BytesCollection, self).__init__(self.virtual_file, vsi=filetype,
    556                                               encoding='utf-8', **kwds)
    557 

~/miniconda3/envs/xaquacrop-dev/lib/python3.9/site-packages/fiona/collection.py in __init__(self, path, mode, driver, schema, crs, encoding, layer, vsi, archive, enabled_drivers, crs_wkt, ignore_fields, ignore_geometry, **kwargs)
    160             if self.mode == 'r':
    161                 self.session = Session()
--> 162                 self.session.start(self, **kwargs)
    163             elif self.mode in ('a', 'w'):
    164                 self.session = WritingSession()

fiona/ogrext.pyx in fiona.ogrext.Session.start()

fiona/_shim.pyx in fiona._shim.gdal_open_vector()

DriverError: '/vsimem/5c2fb0daef8141bc9dc81453856ced7c' not recognized as a supported file format.

where it is linked to this SO thread and it seems that for some reason response.content.decode results in a HTML page?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.