HOLY SHIT IT WORKS

Make sure that you are in the correct environment. To check your current environment, type the following. The environment you are in will have a star next to it.

    conda info --envs

If you are not in the ee-python environment, you can switch into it using

    source activate ee-python

In [12]:
# Import the Earth Engine Python Package into Python environment.
import ee

# Initialize the Earth Engine object, using the authentication credentials.
ee.Initialize()

# Print the information for an image asset.
image = ee.Image('srtm90_v4')
print(image.getInfo())

#celebrate!!


{u'bands': [{u'crs': u'EPSG:4326', u'crs_transform': [0.0008333333535119891, 0.0, -180.0, 0.0, -0.0008333333535119891, 60.0], u'id': u'elevation', u'data_type': {u'max': 32767, u'type': u'PixelType', u'precision': u'int', u'min': -32768}, u'dimensions': [432000, 144000]}], u'version': 1427492341199000, u'type': u'Image', u'id': u'srtm90_v4', u'properties': {u'system:time_end': 951177600000, u'system:time_start': 950227200000}}

In [5]:
from IPython.display import Image
Image(url=image.getThumbUrl({'min':0, 'max': 3000}))


Out[5]:

In [6]:
from geopandas import GeoDataFrame
from shapely.geometry import shape


def fc2df(fc):
    # Convert a FeatureCollection into a pandas DataFrame
   
    # Features is a list of dict with the output
    features = fc.getInfo()['features']

    dictarr = []
      
    for f in features:
        # Store all attributes in a dict
        attr = f['properties']
        # and treat geometry separately
        attr['geometry'] = f['geometry']  # GeoJSON Feature!b
        # attr['geometrytype'] = f['geometry']['type']
        dictarr.append(attr)
       
    df = GeoDataFrame(dictarr)
    # Convert GeoJSON features to shape
    df['geometry'] = map(lambda s: shape(s), df.geometry)    
    return df
# End fc2df

In [8]:
fc = ee.FeatureCollection("ft:1KLL3aOt7-mavHuL_uyLLPXOf7vUVk6v08XbzIepq");

In [14]:
#!/usr/bin/env python
#"""Select rows from a fusion table."""
import ImageTk
import Image

ee.mapclient.centerMap(-93, 40, 4)

# Select the 'Sonoran desert' feature from the TNC Ecoregions fusion table.

fc = (ee.FeatureCollection('ft:1Ec8IWsP8asxN-ywSqgXWMuBaxI6pPaeh6hC64lA')
      .filter(ee.Filter().eq('ECO_NAME', 'Sonoran desert')))

# Paint it into a blank image.
image1 = ee.Image(0).mask(0)


---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-14-982eb9b9c430> in <module>()
      1 #!/usr/bin/env python
      2 #"""Select rows from a fusion table."""
----> 3 import ImageTk
      4 import Image
      5 

ImportError: No module named ImageTk