0

I have a collection of countries that I filter from WDPA to give me the protected area polygons for those countries. The problem arises however when I want to filter the polygons to only show me terrestrial polygons. This is done by specifying the "MARINE"-band as 0 which then should only show the polygons with this designation. When I do this however the map doesn't display anything, and I'm not quite sure why.

Code: https://code.earthengine.google.com/5c99655210f64d7126bd3d555f6f085d

var dataset = ee.FeatureCollection('WCMC/WDPA/current/polygons');


var countries = ee.List(['MEX', 'GTM', 'NIC', 'CRI', 'PAN', 'COL', 'VEN', 'SUR', 'ECU', 'PER', 'BRA', 'BOL', 'PRY', 'URY', 'ARG', 'SLE', 'LBR', 'CIV', 'GHA', 'TGO', 'BEN', 'NGA', 'CMR', 'GNQ', 'GAB', 'COD', 'COG', 'RWA', 'UGA', 'KEN', 'TZA', 'MOZ', 'MWI', 'AGO', 'ZWE', 'ZMB', 'BWA', 'ZAF', 'MDG', 'THA', 'IND', 'MMR', 'LAO', 'VNM', 'KHM', 'MYS', 'IDN', 'PHL', 'PNG', 'TLS']);

var selected = dataset.filter(ee.Filter.inList('PARENT_ISO', countries));


var protected_terrestrial = selected.filter(ee.Filter.and(
  ee.Filter.eq('MARINE', 0),
  ee.Filter.neq('STATUS', 'proposed')));

Map.addLayer(protected_terrestrial, {}, 'Protected Areas');

1 Answer 1

1

It's because the MARINE column is of type string, It's missing the brackets around the 0, i.e. '0' not 0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.