Metadata-Version: 2.4
Name: gee_zonal
Version: 0.1.1
Summary: Wrapper function to request temporal and zonal statistics from Google Earth Engine
Author-email: Development Data Group <github@worldbank.org>
Maintainer-email: Andres Chamorro <achamorroelizond@worldbank.org>
License: World Bank Master Community License Agreement
        
        THIS WORLD BANK COMMUNITY LICENSE AGREEMENT ("Agreement") is entered
        between the International Bank for Reconstruction and
        Development/International Development Association ("<ins>World Bank</ins>")
        and the party identified as licensee on the signature page of this
        Agreement ("Licensee"). Licensee and the World Bank are each referred to
        herein as a "<ins>Party</ins>" and collectively as, the "<ins>Parties</ins>".
        
        A.  The World Bank has developed that certain computer software
            identified on Exhibit B ("<ins>Licensed Software</ins>") for use for the
            public good and desire to make the Licensed Software available to
            Licensee on a royalty-free basis, subject to certain other terms and
            conditions.
        
        B.  Licensee wishes to secure certain rights to use, modify and
            sublicense the Licensed Software.
        
        NOW, THEREFORE, in consideration of the mutual promises of the Parties
        and other good and valuable consideration, receipt of which is hereby
        acknowledged, the Parties agree as follows:
        
        1. Definitions
        
            1. **"Contribution"** means any subject matter which is created by
                any person, which subject matter has the effect of adding to,
                deleting from, replacing, or otherwise modifying the text,
                binary or other material in a Core Program, whether deriving
                directly from a Core Program or from Licensed Software. A
                Contribution may be included in the same file as material from a
                Core Program, or in a separate file that is or can be used in
                connection with a compilation, build or similar process to add
                to, delete from, replace or otherwise modify material from the
                file containing Licensed Software.
        
            2. **"Core Programs"** mean the Computer programs and associated
                data originally created by or for the World Bank as part of the
                Licensed Software and made available by the World Bank or its
                licensees pursuant to the terms equivalent to those of this
                Agreement.
        
            3. **"Covered Licensee"** has the meaning set forth in Section 2.3.
        
            4. **"Covered Work"** means any work that includes Licensed
                Software and Independent Software.
        
            5. **"Distribute"** means, for the purpose of this Agreement, to
                deliver or offer to deliver a copy of a work to a person other
                than to a person controlled by, controlling or under common
                control with the first person or a person engaged solely to
                develop, maintain, test, or operate such work on behalf the
                first person.
        
            6. **"Exploit"** means in the case of copyrightable subject matter
                to copy, make derivative works, distribute, display, and perform
                such subject matter and any analogous or additional rights
                provided under the laws of any country within the Licensed
                Territory. In the case of patentable subject matter, "Exploit"
                includes the right to make, use, sell, offer for sale, have
                made, import the relevant subject matter. Except as expressly
                provided in this Agreement, the right to Exploit does not
                include the right to authorize others to Exploit the subject
                matter.
        
            7. **"Independent** **Software"** means any software that does not
                include any Core Programs or Contributions. No software
                contained in the same file as Licensed Software shall be deemed
                Independent Software under the terms of this Agreement.
        
            8. **"Licensed Software"** means the Core Programs identified on
                Exhibit B hereto, together with any Contributions thereto,
                whether in Source Code or Object Code form.
        
            9. **"Licensed** **Territory"** has the meaning set forth in
                Section 2.2.
        
            10. **"Object Code"** means any version of a computer program which
                is capable of being installed, loaded, and operated on a
                computer without any intervening process other than a system
                loader or linkage editor or a real-time interpreter.
        
            11. **"Source Code"** means any version of a computer program other
                than Object Code, including without limitation any text or
                text-equivalent capable of being compiled or translated into
                Object Code, and any associated documentation in existence that
                is necessary or convenient to compile, modify, edit (including
                without limitation any linkage edit or build process), integrate
                and configure such computer program for installation and/or use.
        
        2. Licenses
        
            1. **Basic Grant.** Subject to Licensee's compliance with all terms
                and conditions of this Agreement, World Bank grants to Licensee
                the royalty-free, perpetual, non-exclusive right and license to
                Exploit the Licensed Software, whether alone or as part of a
                Covered Work.
        
            2. **Territorial Limitations.** The rights granted to Licensee
                hereunder only apply to exploitation in the member countries of
                the World Bank ("Licensed Territory").
        
            3. **Rights in Contributions.** Licensee hereby grants to World
                Bank a paid up, royalty-free, perpetual, irrevocable,
                non-exclusive, sublicenseable right and license to Exploit any
                Contributions created by or for Licensee, effective immediately
                on the first Distribution of any work containing a Contribution.
                Such Contribution shall be thereafter considered part of the
                Licensed Software and authorized for Exploitation by any person
                or entity who has received rights to the Core Software ("Covered
                Licensee").
        
            4. **Patent Rights.** Licensee further grants to World Bank and all
                other Covered Licensees a paid up, royalty-free, perpetual,
                irrevocable and sublicenseable license to Exploit its
                Contributions or any version of the Licensed Software including
                its Contributions under any patents now or in the future owned
                or licenseable by Licensee, solely to the extent that such
                Exploitation is of a work consisting of Licensed Software and
                Licensee's Contribution.
        
            5. **Sublicenses.** In the event that Licensee is an entity
                chartered under the laws of a nation state within the Licensed
                Territory, Licensee shall be permitted to grant sublicenses to
                others to Exploit the Licensed Software pursuant to a license
                agreement containing the provisions set forth in Exhibit A
                hereto, as the same may be modified from time to time by the
                World Bank in accordance with this Section. Licensee shall
                maintain a computerized repository from which sublicensees may
                download the Licensed Software, which repository shall require a
                reasonable means by which the Licensee so downloading the code
                may be identified. If practicable, each downloadable copy shall
                be electronically watermarked so as to identify the repository
                from which it has been downloaded. Nothing herein shall be
                deemed to prohibit the restriction or fee-based licensing of
                Covered Works, provided that Licensee and any sublicensees
                comply in full with all requirements for the unrestricted
                further distribution of Licensed Software included within such
                Covered Work. Except as expressly provided in this Section 2.5,
                Licensee shall not grant sublicenses of Licensed Software and/or
                any Contribution to any person.
        
            6. **Revision of Sublicense Terms.** The World Bank may from time
                to time establish different terms for sublicenses to replace the
                terms of Exhibit A hereto. Such different terms shall apply to
                any sublicenses granted by Licensee pursuant to Section 2.5, on
                ten (10) days notice given to Licensee pursuant to this
                Agreement, by which time Licensee shall have posted the revised
                terms in print (if previously published in print) and any
                electronically accessible location where it has previously
                posted such terms..
        
            7. **No Personal Use.** Licensee represents and warrants that the
                Licensed Software is not intended to be used and will not be
                used or authorized for use for personal, household and/or family
                uses.
        
        3. Obligations of Licensee
        
            1. **Distribution of Source Code.** In the event that Licensee
                Distributes any form of the Licensed Software, whether as Source
                Code or Object Code and whether by itself or as part of a
                Covered Work, Licensee shall promptly make available the full
                Source Code of such Licensed Software (including any
                Contributions by Licensee) to all persons on the terms set forth
                in Exhibit A, either by making such Source Code accessible in a
                commonly available online source code repository, an online
                repository under the direct control of Licensee, or by notifying
                such persons that such Source Code may be delivered by
                electronic transmission to any requesting person, at no charge
                other than a reasonable fee covering the cost of distribution to
                the recipient.
        
            2. **Inclusion of Applicable License Provisions.** Licensee shall
                assure that every copy of Licensed Software (including any such
                copy included in a Covered Work) shall either include the full
                text of the license required by Section 3.2 or a statement that
                identifies a uniform resource locator which contains the
                applicable license.
        
            3. **No Further Restrictions.** Licensee shall not impose any
                restrictions on the further use, distribution or modification of
                Licensed Software, whether distributed by itself or as part of a
                Covered Work, provided that the License Software is made
                available by Licensee and its sublicensee on terms specified in
                Exhibit A hereto. Nothing herein shall prohibit Licensee from
                imposing any conditions Licensee sees fit on the subsequent
                distribution of Independent Software included in any Covered
                Work.
        
            4. **Enforcement of Sublicenses.** By accepting this License
                Agreement and a copy of the Licensed Software, Licensee agrees
                that it will take action to enforce the terms of any
                sublicenses, including without limitation seeking injunctive or
                other equitable relief. Licensee shall not, however, name or
                attempt to name the World Bank as an involuntary plaintiff in
                any such action, without the prior written consent of the World
                Bank . No enforcement action shall be required if the World Bank
                is deemed a necessary party plaintiff or defendant and the World
                Bank withholds consent to being so named. In the event that
                Licensee becomes aware of breaches of any of its sublicenses, it
                shall notify the World Bank in writing as soon as practicable
                and, in the event Licensee determines to seek legal relief, it
                shall so notify the World Bank of its intention to pursue such
                legal relief.
        
            5. **Conditions of License.** Sections 3.1 through 3.4 above are
                conditions of the licenses granted in Article 2 Licensee
                specifically acknowledges that its failure to comply strictly
                with such conditions voids all licenses granted to Licensee
                hereunder, without further notice from World Bank. Sublicenses
                granted by Licensee in accordance with this Agreement shall
                continue in effect, provided that the applicable sublicensees
                comply and continue to comply with all provisions of Exhibit A
                hereto.
        
            6. **Permitted Arrangements.** Nothing herein shall prohibit
                Licensee (or any sublicensee) from offering and charging for
                warranty, support, indemnity, or liability obligations to one or
                more recipients of Licensed Software or Covered Works, provided
                that Licensee and any applicable sublicensee prominently
                notifies any persons purchasing such additional obligations that
                such obligations are solely the obligations of the persons
                offering such obligations neither World Bank nor any person
                other than the person offering such services is obligated or
                responsible in any way with respect to the Licensed Software or
                any portion thereof.
        
            7. **Attribution and Disclaimer.** All copies of Licensed Software
                and/or Covered Works Distributed by Licensee and any sublicensee
                deriving from Licensee shall contain a notice that certain
                underlying work was originally developed by or for the World
                Bank, that the World Bank is not responsible for the accuracy,
                other functionality or performance of such Licensed Software
                and/or Covered Work.
        
        4. Warranties by Licensee
        
            1. **Non-infringement of Copyright.** Licensee hereby represents
                and warrants to World Bank and any persons who are licensees of
                Licensed Software deriving from Core Software that its
                Contributions are and/or will be either its original works of
                authorship or that it has sufficient rights in such
                Contributions to grant the rights required to be granted in such
                Contributions (and derivatives thereof) pursuant to this
                Agreement.
        
            2. **Patent Warranties.** Licensee hereby represents that, to the
                best of its knowledge, the combination of any Licensed Software
                with a Contribution from Licensee does not infringe the patent
                rights of any third party.
        
            3. **Disclaimer.** LICENSEE UNDERSTANDS AND AGREES THAT ITS USE
                (INCLUDING WITHOUT LIMITATION, THE EXERCISE OF ANY RIGHTS
                GRANTED TO IT UNDER THIS AGREEMENT) OF THE SOFTWARE IS AT
                LICENSEE'S SOLE RISK. THE SOFTWARE IS PROVIDED ON AN "AS IS" AND
                "AS AVAILABLE" BASIS. THE WORLD BANK DISCLAIMS ALL
                REPRESENTATIONS AND WARRANTIES OF ANY KIND, WHETHER EXPRESS,
                IMPLIED, OR STATUTORY, WITH RESPECT TO THE SOFTWARE (INCLUDING,
                BUT NOT LIMITED TO, THE IMPLIED OR STATUTORY WARRANTIES OF
                MERCHANTABILITY, FITNESS FOR A PARTICULAR USE OR PURPOSE, TITLE,
                QUIET ENJOYMENT, AND NON-INFRINGEMENT. IN PARTICULAR, THE WORLD
                BANK DOES NOT REPRESENT OR WARRANT THAT ANY INFORMATION OR OTHER
                CONTENT OBTAINED OR VIEWED BY LICENSEE OR ANYONE ELSE AS A
                RESULT OF LICENSEE'S EXPLOITATION OF THE SOFTWARE WILL BE
                ACCURATE, COMPLETE OR RELIABLE, THAT LICENSEE'S ACCESS TO THE
                SOFTWARE WILL BE UNINTERRUPTED, FREE OF MALICIOUS CODE OR
                ERROR-FREE, OR THAT DEFECTS WILL BE CORRECTED. THE WORLD BANK
                DISCLAIMS ALL LIABILITY AND RESPONSIBILITY ARISING FROM , OUT OF
                OR IN CONNECTION WITH THE SOFTWARE OR THE USE OF, PERFORMANCE OF
                OR OTHER DEALINGS IN THE SOFTWARE. THE WORLD BANK GROUP
                DISCLAIMS ALL EQUITABLE INDEMNITIES.
        
            4. **Limitation of Liability.** THE WORLD BANK EXPRESSLY DISCLAIMS
                AND IN NO EVENT BE LIABLE UNDER ANY THEORY OF LIABILITY WHETHER
                BASED IN CONTRACT, TORT, STRICT LIABILITY OR OTHERWISE, FOR ANY
                DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PERSONAL
                INJURY/WRONGFUL DEATH, PUNITIVE, OR EXEMPLARY DAMAGES (EVEN IF
                SUCH PARTIES KNEW OF OR SHOULD HAVE KNOWN OF THE POSSIBILITY OF
                SUCH DAMAGES), INCLUDING BUT NOT LIMITED TO AS A RESULT OF: (A)
                LICENSEE'S USE OF OR INABILITY TO USE THE SOFTWARE OR (B) ANY
                LOSS OF DATA. SHOULD ANY OF THEWORLD BANK BE FOUND TO BE LIABLE
                TO YOU OR ANY THIRD PARTY NOTWITHSTANDING THE FOREGOING, SUCH
                LIABILITY WILL NOT EXCEED \$100.00 IN THE AGGREGATE.
        
            5. **Indemnity by Licensee.** Licensee agrees that Licensee will
                release, indemnify and hold harmless the World Bank and each of
                their respective business partners, content providers, licensors
                and service providers, and any of their respective officers,
                directors, shareholders, employees, contractors,
                representatives, or agents (including without limitation any
                authors or copyright holders of the Software) (collectively, the
                "World Bank Indemnified Parties") from and against any and all
                claims, actions, losses, damages, costs, fees and expenses
                (including attorneys' fees) arising out of or relating to: (i)
                Licensee's use or Exploitation of the Licensed Software, (ii)
                Licensee's data, (iii) Licensee's connection to the
                Software, (iv) Licensee's violation of this Agreement, (v)
                Licensee's violation of any rights of another, and/or (vi) the
                Exploitation and licensing of the Licensed Software by any
                person claiming rights by operation of any license granted by
                Licensee to such person.
        
            6. **Waiver and Release.** Licensee hereby waives any rights and
                benefits it may have or that may accrue to it under any law
                providing that a general release does not extend to claims that
                the creditor does not know or suspect to exist in his, her or
                their favor at the time of executing the release, which if known
                by him, her or them must have materially affected his settlement
                with the debtor, or something substantially similar. The World
                Bank reserves the right, at its own expense, to assume the
                exclusive defense and control of any matter otherwise subject to
                indemnification by Licensee, and Licensee shall not in any event
                settle any matter without the written consent of the World Bank
                Indemnified Parties.
        
        5. Miscellaneous Provisions
        
            1. **Governing Law.** This Agreement and the relationship between
                and among the Parties shall be governed by the Laws of the State
                of New York, United States of America, without giving effect to
                any choice or conflict of law provision or rule (whether of the
                state of New York or any other jurisdiction). Licensee agrees
                that regardless of any statute or law to the contrary, any claim
                or cause of action arising out of or related to use of the
                Software or this Agreement must be filed within one (1) year
                after such claim or cause of action arose or be forever barred.
        
            2. **Remedies.** \[injunctive remedies, etc., to conform to
                arbitration clause.\]
        
            3. **Arbitration.** Any controversy or claim arising out of or
                relating to this Agreement, or that contests the validity of
                this Agreement, shall be settled by arbitration in accordance
                with the UNCITRAL Arbitration Rules from time to time in force.
                The place of arbitration shall be New York, New York and the
                arbitration shall be conducted in English. The Parties hereby
                waive any rights under any applicable law to appeal any
                arbitration award or to seek determination of a preliminary
                point of law with respect to such proceedings. Notwithstanding
                the foregoing, The World Bank shall have the right to seek
                interim, provisional or other equitable relief, including
                temporary or permanent injunctive relief, as necessary to
                protect its interests.
        
            4. **Preservation of Immunities.** Nothing in this Agreement and no
                submission by The World Bank to arbitration shall be construed
                as a limitation upon or a waiver, renunciation or modification
                of any immunities, privileges or exemptions of the World Bank
                accorded under any of the Articles of Agreement of the
                International Bank for Reconstruction and Development,
                international convention or any applicable law. Such immunities,
                privileges or exemptions are specifically reserved.
        
            5. **Notices.** Any notice required or permitted to be given
                pursuant to this Agreement shall be effective if given by
                electronic mail addressed to the applicable Party at the address
                set forth in connection with its signature on this Agreement.
        
            6. **Execution.** This Agreement may be executed in duplicates or
                counterparts and transmitted by facsimile or other imaging
                means.
        
        IN WITNESS WHEREOF, the Parties have executed this Agreement as of the
        \_\_\_ day of \_\_\_\_\_.
        
          --------------------------------------------------------------------------------------------------------------------------------------------------------------------
          International Bank for Reconstruction and Development / International Development Association   \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
          ----------------------------------------------------------------------------------------------- --------------------------------------------------------------------
          By\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\                               By \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
          its
        
          --------------------------------------------------------------------------------------------------------------------------------------------------------------------
        
        **EXHIBIT A**
        
        **REQUIRED SUBLICENSE TERMS**
        
        A sublicense granted pursuant to the World Bank Master Community License
        Agreement shall include the following provisions:
        
        1. A preamble as follows:
        
        By acquiring a copy of the Survey Solutions (the "Subject
        Software"), the person so acquiring such copy, for himself/herself and
        on behalf of his or her employer or principal (collectively,
        "Licensee"), acknowledges and agrees that the exploitation of the
        Subject Software is subject strictly to the terms and conditions of this
        License Agreement, that Licensee is furthermore bound to perform all
        obligations of Licensee in all material respects, and that this
        Agreement may be enforced against Licensee by Licensor and/or any other
        person or entity who holds the copyright to the Core Software, the
        Licensed Software, or any Contribution thereto, as defined below.
        
        2. All definitions included in Article 1 of the Agreement.
        
        3. The following sections:
        
        **Basic Grant.** Subject to Licensee's compliance with all terms and
        conditions of this Agreement, Licensor grants to Licensee the
        royalty-free, perpetual, non-exclusive right and license to Exploit the
        Licensed Software, whether alone or as part of a Covered Work.
        
        **Territorial Limitations.** The rights granted to Licensee hereunder
        only apply to exploitation in the member countries of the World Bank
        ("Licensed Territory").
        
        **Rights in Contributions.** Licensee hereby grants to Licensor and its
        licensors a paid up, royalty-free, perpetual, irrevocable,
        non-exclusive, sublicenseable right and license to Exploit any
        Contributions created by or for Licensee, effective immediately on the
        first Distribution of any work containing a Contribution.
        
        **Patent Rights.** Licensee further grants to Licensor and its licensors
        and their respective licensees a paid up, royalty-free, perpetual,
        irrevocable and sublicenseable license to Exploit its Contributions or
        any version of the Licensed Software including its Contributions under
        any patents now or in the future owned or licenseable by Licensee,
        solely to the extent that such Exploitation is of a work consisting of
        Licensed Software and Licensee's Contribution.
        
        **No Personal Use.** Licensee represents and warrants that the Licensed
        Software is not intended to be used and will not be used or authorized
        for use for personal, household and/or family uses.
        
        **Distribution of Source Code.** In the event that Licensee Distributes
        any form of the Licensed Software, whether as Source Code or Object Code
        and whether by itself or as part of a Covered Work, Licensee shall
        promptly make available the full Source Code of such Licensed Software
        (including any Contributions by Licensee) to all persons on the terms
        set forth in this License Agreement, either by making such Source Code
        accessible in a commonly available online source code repository, an
        online repository under the direct control of Licensee, or by notifying
        such persons that such Source Code may be delivered by electronic
        transmission to any requesting person, at no charge other than a
        reasonable fee covering the cost of distribution to the recipient.
        
        **Inclusion of Applicable License Provisions.** Licensee shall assure
        that every copy of Licensed Software (including any such copy included
        in a Covered Work) shall either include the full text of this license or
        a statement that identifies a uniform resource locator which contains
        the applicable license.
        
        **No Further Restrictions.** Licensee shall not impose any restrictions
        on the further use, distribution or modification of Licensed Software,
        whether distributed by itself or as part of a Covered Work, other than
        the terms of this License. Nothing herein shall prohibit Licensee from
        imposing any conditions Licensee sees fit on the subsequent distribution
        of Independent Software included in any Covered Work.
        
        **Non-infringement of Copyright.** Licensee hereby represents and
        warrants to Licensor Parties and any persons or entities who are
        licensees of Licensed Software that its Contributions are and/or will be
        either its original works of authorship or that it has sufficient rights
        in such Contributions to grant the rights required to be granted in such
        Contributions (and derivatives thereof) pursuant to this Agreement.
        
        **Patent Warranties.** Licensee hereby represents that, to the best of
        its knowledge, the combination of any Licensed Software with a
        Contribution from Licensee does not infringe the patent rights of any
        third party.
        
        **Disclaimer.** LICENSEE UNDERSTANDS AND AGREE THAT ITS USE (INCLUDING
        WITHOUT LIMITATION, THE EXERCISE OF ANY RIGHTS GRANTED TO IT UNDER THIS
        AGREEMENT) OF THE SOFTWARE IS AT LICENSEE'S SOLE RISK. THE SOFTWARE IS
        PROVIDED ON AN "AS IS" AND "AS AVAILABLE" BASIS. LICENSEE, FOR ITSELF
        AND ITS LICENSORS ("COLLECTIVELY LICENSOR PARTIES") DISCLAIM ALL
        REPRESENTATIONS AND WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR
        STATUTORY, WITH RESPECT TO THE SOFTWARE (INCLUDING, BUT NOT LIMITED TO,
        THE IMPLIED OR STATUTORY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
        PARTICULAR USE OR PURPOSE, TITLE, QUIET ENJOYMENT, AND NON-INFRINGEMENT.
        IN PARTICULAR, LICENSOR PARTIES DO NOT REPRESENT OR WARRANT THAT ANY
        INFORMATION OR OTHER CONTENT OBTAINED OR VIEWED BY LICENSEE OR ANYONE
        ELSE AS A RESULT OF LICENSEE'S EXPLOITATION OF THE SOFTWARE WILL BE
        ACCURATE, COMPLETE OR RELIABLE, THAT LICENSEE'S ACCESS TO THE SOFTWARE
        WILL BE UNINTERRUPTED, FREE OF MALICIOUS CODE OR ERROR-FREE, OR THAT
        DEFECTS WILL BE CORRECTED. LICENSOR PARTIES DISCLAIM ALL LIABILITY AND
        RESPONSIBILITY ARISING FROM , OUT OF OR IN CONNECTION WITH THE SOFTWARE
        OR THE USE OF, PERFORMANCE OF OR OTHER DEALINGS IN THE SOFTWARE.
        LICENSING PARTIES DISCLAIM ALL EQUITABLE INDEMNITIES.
        
        **Limitation of Liability.** LICENSOR PARTIES EXPRESSLY DISCLAIM AND IN
        NO EVENT WILL ANY OF THEM BE LIABLE UNDER ANY THEORY OF LIABILITY
        WHETHER BASED IN CONTRACT, TORT, STRICT LIABILITY OR OTHERWISE, FOR ANY
        DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PERSONAL
        INJURY/WRONGFUL DEATH, PUNITIVE, OR EXEMPLARY DAMAGES (EVEN IF SUCH
        PARTIES KNEW OF OR SHOULD HAVE KNOWN OF THE POSSIBILITY OF SUCH
        DAMAGES), INCLUDING BUT NOT LIMITED TO AS A RESULT OF: (A) LICENSEE'S
        USE OF OR INABILITY TO USE THE SOFTWARE OR (B) ANY LOSS OF DATA. SHOULD
        THEWORLD BANK BE FOUND TO BE LIABLE TO YOU OR ANY THIRD PARTY
        NOTWITHSTANDING THE FOREGOING, SUCH LIABILITY WILL NOT EXCEED \$100.00
        IN THE AGGREGATE.
        
        **Indemnity by Licensee.** Licensee agrees that Licensee will release,
        indemnify and hold harmless Licensor Parties and each of Licensor
        Parties' respective business partners, content providers, licensors and
        service providers, and any of their respective officers, directors,
        shareholders, employees, contractors, representatives, or agents
        (including without limitation any authors or copyright holders of the
        Software) (collectively, the "Licensor Indemnified Parties") from and
        against any and all claims, actions, losses, damages, costs, fees and
        expenses (including attorneys' fees) arising out of or relating to: (i)
        Licensee's use or Exploitation of the Licensed Software, (ii) Licensee's
        data, (iii) Licensee's connection to the Software, (iv) Licensee's
        violation of this Agreement, (v) Licensee's violation of any rights of
        another, and/or (vi) the Exploitation and licensing of the Licensed
        Software by any person claiming rights by operation of any license
        granted by Licensee to such person.
        
        **Express Third Party Beneficiary.** Licensee acknowledges and agrees
        that the World Bank is an express third party beneficiary of this
        agreement and is entitled to enforce the terms of this Agreement or to
        assume the prosecution of any remedy, either in addition to or in lieu
        of enforcement undertaken by Licensor.
        
        **Governing Law.** This Agreement and the relationship between and among
        the Parties shall be governed by the Laws of the State of New York,
        United States of America, without giving effect to any choice or
        conflict of law provision or rule (whether of the state of New York or
        any other jurisdiction). Licensee agrees that regardless of any statute
        or law to the contrary, any claim or cause of action arising out of or
        related to use of the Software or this Agreement must be filed within
        one (1) year after such claim or cause of action arose or be forever
        barred.
        
        **Arbitration.** This Agreement, at the option of Licensor, or The World
        Bank so elects, The World Bank, may be enforced against Licensee in the
        state or federal courts of the State of New York, the courts of the
        country in which Licensee resides, or any other appropriate
        jurisdiction, or concurrently in more than one jurisdiction. Subject to
        the foregoing option of Licensor or The World Bank, any controversy or
        claim arising out of or relating to this Agreement, or that contests the
        validity of this Agreement, shall be settled by arbitration in
        accordance with the UNCITRAL Arbitration Rules from time to time in
        force. The place of arbitration shall be New York, New York and the
        arbitration shall be conducted in English. The Parties hereby waive any
        rights under any applicable law to appeal any arbitration award or to
        seek determination of a preliminary point of law with respect to such
        proceedings. Notwithstanding the foregoing, The World Bank shall have
        the right to seek interim, provisional or other equitable relief,
        including temporary or permanent injunctive relief, as necessary to
        protect its interests.
        
Project-URL: Homepage, https://github.com/worldbank/GEE_Zonal
Project-URL: Bug Reports, https://github.com/worldbank/GEE_Zonal/issues
Project-URL: Source, https://github.com/worldbank/GEE_Zonal
Keywords: zonal statistics,gee,earth engine
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: earthengine-api>=0.1.342
Requires-Dist: pandas>=1.2.2
Requires-Dist: geopandas>=0.12.2
Provides-Extra: notebook
Requires-Dist: notebook>=6.5.2; extra == "notebook"
Dynamic: license-file

# GEE Zonal

[![PyPI version](https://badge.fury.io/py/gee-zonal.svg)](https://badge.fury.io/py/gee-zonal)
![GitHub issues](https://img.shields.io/github/issues/worldbank/GEE_Zonal?style=plastic)
![GitHub stars](https://img.shields.io/github/stars/worldbank/GEE_Zonal?style=social)

This python package provides a wrapper function to request temporal and zonal statistics from Google Earth Engine (GEE) datasets.

## Summary

A zonal statistics function was created to ease the process of working with the GEE API. The function can work with any raster data loaded to EE (`ee.ImageCollections` or `ee.Image`) and vector features (`geopandas.GeoDataFrame` or `ee.FeatureCollection`), and returns tabular data.

Statistics can be requested at various temporal resolutions (`original` frequency, `monthly`, or `annual`). The workflow conducts pixel-by-pixel temporal aggregations, before summarizing statistics over target features.

Additionally, the package provides functionality to quickly search the GEE Catalog.

#### [Documentation Pages](https://worldbank.github.io/GEE_Zonal/)

## Installation

The required dependencies are *earthengine-api*, *geopandas*, *geojson*, and *notebook*. The package (and dependencies) can be installed via pip:

```sh
pip install gee_zonal
```

## Setup

The Earth Engine Python API needs to be authenticated with a Google account. First, sign up to Google Earth Engine [here](https://earthengine.google.com/signup/).

Launch a jupyter notebook, and authenticate your account with the ee library.

```python
import ee
ee.Authenticate()
```

You can check that this worked by running `ee.Initialize()`, then import and run the library:

```python
from gee_zonal import ZonalStats, Catalog
```

If the pip installation is not working, you can recreate the environment before and install the package from source:

```sh
conda create -n ee
conda activate ee
conda install -c conda-forge earthengine-api geopandas notebook ipykernel​
git clone https://github.com/worldbank/GEE_Zonal.git
python setup.py build
python setup.py install
python -m ipykernel install --user --name ee --display-name "Earth Engine"
```

## Usage

### ZonalStats()

Main class to calculate temporal and zonal statistics using the GEE backend. The object can be initialized with parameters specifying data inputs and the type of aggregation.

```python
import ee
from gee_zonal import ZonalStats
AOIs = ee.FeatureCollection('<id of ee.FeatureCollection>')
AOIs = '<path to shapefile>'
zs = ZonalStats(
  collection_id = 'LANDSAT/LC08/C01/T1_8DAY_NDVI',
  target_features = AOIs,
  statistic_type = "all", # all includes min, max, mean, and stddev
  frequency = "annual",
  temporal_stat = "mean"
)
```

See docstring for more details on the input parameters for `ZonalStats()` and the [example notebook](./notebooks/Test%20Zonal%20Statistics.ipynb).

The output statistics can be retrieved directly in the notebook (as a `DataFrame`):

```python
res = zs.runZonalStats()
```

Or retrieved from Google Drive as a csv table if an `output_name` and `output_dir` were specified.

### Catalog()

Inventory of Earth Engine datasets with some functions to search catalog by tags, title, and year / time period

```python
from gee_zonal import Catalog
cat = Catalog()
```

The catalog object contains a `datasets` variable, a `DataFrame` containing a copy of the Earth Engine data catalog, retrieved from [Earth-Engine-Datasets-List](https://github.com/samapriya/Earth-Engine-Datasets-List).

```python
cat.datasets
```

#### Search functions

```python
results = cat.search_tags("ndvi")
results = results.search_by_period(1985, 2021)
results = results.search_title("landsat")
print(results)
```

## Additional Resources

- [geemap](https://geemap.org/): Python library with more functionality to work with GEE.
- [awesome-gee-community-catalog](https://gee-community-catalog.org/): Extended catalog of EE datasets.

## License

[**World Bank Master Community License Agreement**](LICENSE.md).
