fromGeoInterface#
- classmethod geetools.ee_feature_collection.FeatureCollectionAccessor.fromGeoInterface(data)#
Create a
ee.FeatureCollectionfrom a geo interface.The
geo_interfaceis 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 theee.FeatureCollectionconstructor 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:
data (dict | GeoInterface) – The geo_interface to create the
ee.FeatureCollectionfrom.crs – The CRS to use for the FeatureCollection. Default to
EPSG:4326.
- Returns:
The created
ee.FeatureCollectionfrom the geo_interface.- Return type:
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")