fromGeoInterface#

classmethod geetools.FeatureCollectionAccessor.fromGeoInterface(data)#

Create a ee.FeatureCollection from a geo interface.

The geo_interface is a protocol representing a vector collection as a python GeoJSON-like dictionary structure. More information is available at https://gist.github.com/sgillies/2217756. Note that the ee.FeatureCollection constructor is only supporting data represented in EPSG:4326.

The user can either provide an object that implements the __geo_interface__ method or a dictionary that respects the protocol described in the link above.

Parameters:
Returns:

The created ee.FeatureCollection from the geo_interface.

Return type:

ee.FeatureCollection

Examples

import geetools

data = {
    "type": "FeatureCollection",
    "features": [
        {
            "type": "Feature",
            "properties": {"name": "Coors Field"},
            "geometry": {
                "type": "Point",
                "coordinates": [-104.99404, 39.75621]
            }
        }
    ]
}

fc = ee.FeatureCollection.geetools.fromGeoInterface(data, crs="EPSG:4326")