Giter VIP home page Giter VIP logo

folium_gee's Introduction

FoliumGEE

A few simple functions to render Google Earth Engine Tile Layers with Folium.

Take a look at the tests directory for usage, but here is a simple example:

import ee
import foliumgee

ee.Initialize()

image = ee.Image('srtm90_v4')
m = foliumgee.map(image)
m.save('srtm.html')

Credentials

It is up to the user to either supply GEE credentials during the Initialization step:

import ee

creds = ee.ServiceAccountCredentials(
	service_account,
	'privatekey.json')
ee.Initialize(creds)

or through via a credentials file.

Install

Clone and install manually, or use pip:

# Method 1
git clone https://github.com/mccarthyryanc/folium_gee.git
cd folium_gee
python setup.py install
# Method 2
pip install git+https://github.com/mccarthyryanc/folium_gee.git

folium_gee's People

Contributors

mccarthyryanc avatar

Stargazers

 avatar PaulineM avatar NiFrA avatar  avatar Tek Kshetri avatar  avatar Henrique Mendonça avatar Pankaj Kumar avatar Jason Schneider avatar Jinyi Kuang  avatar Ian P .Davies avatar Justin Braaten avatar Philip Blankenau avatar  avatar Ramon Santos Souza avatar Rodrigo E. Principe avatar Sam Murphy avatar Rutger Hofste avatar

Watchers

James Cloos avatar  avatar

folium_gee's Issues

__init__ reports error in Folium

I tried to run your example script -

 import ee
 import foliumgee
 
 ee.Initialize()
 
 image = ee.Image('srtm90_v4')
 m = foliumgee.map(image)
 m.save('srtm.html')

and get this -

TypeErrorTraceback (most recent call last)
in ()
5
6 image = ee.Image('srtm90_v4')
----> 7 m = foliumgee.map(image)
8 m.save('srtm.html')

/usr/local/lib/python2.7/dist-packages/foliumgee/init.pyc in map(image, vis_params, folium_kwargs, name)
34 folium_kwargs['name'] = name
35
---> 36 return folium.Map(**folium_kwargs)
37
38 def layer(folium_map,image,vis_params=None,folium_kwargs={}):

TypeError: init() got an unexpected keyword argument 'name'

Using service account

I am trying to use this with a service account on a Colab. This does not work because line 7 in your main code -
ee.Initialize()
whereas I need to have
credentials = ee.ServiceAccountCredentials(service_account, 'privatekey.json')
ee.Initialize(credentials)

Can I ask why you initialize at all? Why not assume the user of the package initialize somehow before running any of the codes in your package ?

Guy

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.