Feature Layers#
Layer Info and Table#
Command |
Description |
|---|---|
|
Number of features |
|
Properties (dictionary) of feature n |
|
List of field names |
|
Value of the field |
Common Functions#
Command |
Description |
|---|---|
|
Statistics (mean) of column ‘field’ |
|
Merge two layers |
|
Area in hectares for every feature |
|
Buffer of 300m on every polygon |
|
Convert feature collection to image |
img = ee.Image('UMD/hansen/global_forest_change_2018_v1_6').select(['lossyear'])
AOI = ee.FeatureCollection('users/user/DVC_for_hab')
def getHist(feature):
hist = img.reduceRegion(reducer=ee.Reducer.frequencyHistogram(), geometry=feature.geometry())
return feature.set(hist)
AOI = AOI.map(lambda feature: getHist(feature))
Selecting#
Command |
Description |
|---|---|
|
Select by property |
|
Select by property. Operators: |
|
Select by geometry, features that intersect fc2 |
Vector to Raster#
sheds = ee.FeatureCollection('ft:1IXfrLpTHX4dtdj1LcNXjJADBB-d93rkdJ9acSEWK')
# Version 1
empty = ee.Image().byte().clip(sheds)
sheds_Layer = empty.paint(ee.FeatureCollection(sheds))
# Version 2
sheds_Layer = sheds.reduceToImage(['Area'], ee.Reducer.first())