Giter VIP home page Giter VIP logo

cartoee'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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cartoee's Issues

Review for JOSS

Ref. openjournals/joss-reviews#1207

  • version number mismatch: you have published release 0.03 (on github) where it should be 0.0.3 (like on pip)

  • installation / list of dependencies: I've tried installing with jupyter lab/python3 and I get an error from ee indicating that it's probably only compatible with python2. Is this correct, and can you clarify this situation? Please mention that ee is a dependency too (even if that's pretty obvious).

(That's all I can say for now. I'll be back later if I manage to install it.)

Reprojection Error

I get the following error when I want to run an example using a different projection:

TypeError: 'numpy.float64' object cannot be interpreted as an integer

Any idea why this is and how to fix this?

EEException: Pixel grid dimensions (432000x144000) must be less than or equal to 10000.

I am trying to run the first example

plot the result using cartoee

ax = cee.getMap(srtm,region=bbox,visParams=visualization)

ax.coastlines()
plt.show()

and getting the following error.

It seems this is due to some limit that GEE is capping. Can you please help me with this ?

HttpError Traceback (most recent call last)
~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/data.py in _execute_cloud_call(call, num_retries)
344 try:
--> 345 return call.execute(num_retries=num_retries)
346 except googleapiclient.errors.HttpError as e:

~/anaconda3/envs/py36/lib/python3.6/site-packages/oauth2client/_helpers.py in positional_wrapper(*args, **kwargs)
132 logger.warning(message)
--> 133 return wrapped(*args, **kwargs)
134 return positional_wrapper

~/anaconda3/envs/py36/lib/python3.6/site-packages/googleapiclient/http.py in execute(self, http, num_retries)
841 if resp.status >= 300:
--> 842 raise HttpError(resp, content, uri=self.uri)
843 return self.postproc(resp, content)

HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/thumbnails?fields=name&alt=json returned "Pixel grid dimensions (432000x144000) must be less than or equal to 10000.">

During handling of the above exception, another exception occurred:

EEException Traceback (most recent call last)
in
2
3 # plot the map
----> 4 ax = cee.getMap(srtm,cmap='terrain',region=bbox,visParams=visualization)
5 # add a color bar using cartoee
6 cb = cee.addColorbar(ax,loc='right',cmap='terrain',visParams=visualization)

~/anaconda3/envs/py36/lib/python3.6/site-packages/cartoee-0.0.5-py3.6.egg/cartoee/plotting.py in getMap(imgObj, proj, **kwargs)
32
33 ax = plt.axes(projection=proj)
---> 34 ax = addLayer(imgObj,ax=ax,**kwargs)
35
36 return ax

~/anaconda3/envs/py36/lib/python3.6/site-packages/cartoee-0.0.5-py3.6.egg/cartoee/plotting.py in addLayer(imgObj, ax, dims, region, cmap, visParams)
94 args[key] = visParams[key]
95
---> 96 url = imgObj.getThumbUrl(args)
97 img = urlopen(url)
98 a = plt.imread(img)

~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/deprecation.py in Wrapper(*args, **kwargs)
30 filename=func.code.co_filename,
31 lineno=func.code.co_firstlineno + 1)
---> 32 return func(*args, **kwargs)
33 deprecation_message = '\nDEPRECATED: ' + message
34 try:

~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/image.py in getThumbURL(self, params)
490 # behaviour.
491 if data._use_cloud_api: # pylint: disable=protected-access
--> 492 return data.makeThumbUrl(self.getThumbId(params))
493 image, params = self._apply_visualization(params)
494 params['image'] = image

~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/image.py in getThumbId(self, params)
462 image, params = image._apply_visualization(params) # pylint: disable=protected-access
463 params['image'] = image
--> 464 return data.getThumbId(params)
465
466 def getThumbURL(self, params=None):

~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/data.py in getThumbId(params, thumbType)
822 result = _execute_cloud_call(
823 _get_cloud_api_resource().projects().thumbnails().create(
--> 824 parent=_get_projects_path(), fields='name', body=request))
825 return {'thumbid': result['name'], 'token': ''}
826 request = params.copy()

~/anaconda3/envs/py36/lib/python3.6/site-packages/ee/data.py in _execute_cloud_call(call, num_retries)
345 return call.execute(num_retries=num_retries)
346 except googleapiclient.errors.HttpError as e:
--> 347 raise _translate_cloud_exception(e)
348
349

EEException: Pixel grid dimensions (432000x144000) must be less than or equal to 10000.

colorbar 'cmap' error

This example from the documentation of cartoee gives an error when adding cmap for the colorbar (but works when using custom palette)

# get an earth engine image
srtm = ee.Image("CGIAR/SRTM90_V4")
# vis 
visualization = {'min':-500,'max':3000,'bands':'elevation'}
bbox = [-180,-90,180,90]

# plot the map
ax = cee.getMap(srtm,cmap='terrain',
                region=bbox,
                visParams=visualization,
                dims=1000)
# add a color bar using cartoee
cb = cee.addColorbar(ax,loc='right',
                     cmap='terrain',
                     visParams=visualization)

ax.coastlines()

TypeError Traceback (most recent call last)
in ()
14 cb = cee.addColorbar(ax,loc='right',
15 cmap='terrain',
---> 16 visParams=visualization)
17
18 ax.coastlines()

2 frames
/usr/local/lib/python3.7/dist-packages/matplotlib/cbook/init.py in _check_isinstance(_types, **kwargs)
2126 ", ".join(names[:-1]) + " or " + names[-1]
2127 if len(names) > 1 else names[0],
-> 2128 type_name(type(v))))
2129
2130

TypeError: 'cmap' must be an instance of matplotlib.colors.Colormap or None, not a str

colorbar 'cmap' error and MatplotlibDeprecationWarning: Passing the minor parameter of set_yticks()

Hi,

I have tried to run the cartoee example docs in colab platform but it shows error in colorbar 'cmap' function and it doesn't work on subplots.

First:


srtm = ee.Image("CGIAR/SRTM90_V4")

visualization = {'min':-500,'max':3000,'bands':'elevation'}
bbox = [-180,-90,180,90]


ax = cee.getMap(srtm,cmap='terrain',
                region=bbox,
                visParams=visualization,
                dims=1000)

cb = cee.add_colorbar(ax,visualization,loc='right',cmap='terrain')
ax.coastlines() 

First Error:

AttributeError: module 'cartoee' has no attribute 'add_colorbar'

first

Second:

#set up a blank map with multiple subplots
fig,ax = plt.subplots(ncols=2,nrows=2,figsize=(10,7),
                      subplot_kw={'projection': ccrs.Orthographic(-80,35)})


imgs = np.array([[djf,mam],[jja,son]])
titles = np.array([['DJF','MAM'],['JJA','SON']])

for i in range(len(imgs)):
    for j in range(len(imgs[i])):
        ax[i,j] = cee.addLayer(imgs[i,j],ax=ax[i,j],
                               region=bbox,dims=500,
                               visParams=ndviVis,cmap='YlGn'
                              )
        ax[i,j].coastlines()
        ax[i,j].gridlines(linestyle='--')
        ax[i,j].set_title(titles[i,j])

plt.tight_layout()

cax = fig.add_axes([0.9, 0.2, 0.02, 0.6])
cb = cee.addColorbar(ax[i,j],ndviVis,cax=cax,cmap='YlGn')

plt.show()  

Second Error:

TypeError: 'cmap' must be an instance of matplotlib.colors.Colormap or None, not a str
ValueError: provided loc not of type str. options are "left", "top", "right", or "bottom"
glob

Third: I got some unexpected error in Map inset example

Third Error:

/usr/local/lib/python3.7/dist-packages/cartopy/mpl/geoaxes.py:820: MatplotlibDeprecationWarning: Passing the minor parameter of set_yticks() positionally is deprecated since Matplotlib 3.2; the parameter will become keyword-only two minor releases later. return super(GeoAxes, self).set_yticks(yticks, minor)

Third command Output

inset

How can I resolve it? any suggestion or solution???

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.