Skip to content

Commit

Permalink
bugfix myanmar boundary for forest monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
biplovbhandari committed Sep 14, 2019
1 parent f917043 commit 28514f6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions forest_monitor/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ class ForestMonitor():
PRIMARY_FOREST = ee.ImageCollection('projects/servir-mekong/yearly_primitives_smoothed/primary_forest')

# geometries
MEKONG_FEATURE_COLLECTION = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw')
COUNTRIES_GEOM = MEKONG_FEATURE_COLLECTION.filter(ee.Filter.inList('Country',
settings.COUNTRIES_NAME)).geometry()
#MEKONG_FEATURE_COLLECTION = ee.FeatureCollection('ft:1tdSwUL7MVpOauSgRzqVTOwdfy17KDbw-1d9omPw')
#COUNTRIES_GEOM = MEKONG_FEATURE_COLLECTION.filter(ee.Filter.inList('Country',
# settings.COUNTRIES_NAME)).geometry()
MEKONG_BOUNDARY = ee.FeatureCollection('users/biplov/mekong-boundary')
MEKONG_FEATURE_COLLECTION = ee.FeatureCollection('users/biplov/Mekong')
#COUNTRIES_GEOM = MEKONG_FEATURE_COLLECTION.filter(ee.Filter.inList('NAME_0',
# settings.COUNTRIES_NAME)).geometry()

# -------------------------------------------------------------------------
def __init__(self, area_path, area_name, shape, geom, radius, center):
Expand All @@ -33,7 +37,7 @@ def __init__(self, area_path, area_name, shape, geom, radius, center):
#if (area_name == 'Myanmar'):
# area_name = 'Myanmar (Burma)'
self.geometry = ForestMonitor.MEKONG_FEATURE_COLLECTION.filter(\
ee.Filter.inList('Country', [area_name])).geometry()
ee.Filter.inList('NAME_0', [area_name])).geometry()
self.scale = 100
elif (area_path == 'province'):
path = os.path.join(os.path.dirname(os.path.dirname(__file__)),
Expand All @@ -51,7 +55,7 @@ def __init__(self, area_path, area_name, shape, geom, radius, center):
self.geometry = feature.geometry()
self.scale = 30
else:
self.geometry = ForestMonitor.COUNTRIES_GEOM
self.geometry = ForestMonitor.MEKONG_BOUNDARY
self.scale = 100
else:
self.geometry = self._get_geometry(shape)
Expand All @@ -77,7 +81,7 @@ def _get_geometry(self, shape):
self.scale = 30

self.scale = 100
return ForestMonitor.COUNTRIES_GEOM
return ForestMonitor.MEKONG_BOUNDARY

# -------------------------------------------------------------------------
def tree_canopy(self,
Expand Down

0 comments on commit 28514f6

Please sign in to comment.