Google Earth Engine – Separately Extracting States with Same Names from FAO Dataset

feature-filtergoogle-earth-engineshapefile

I am trying to filter Punjab shape from the FAO GAUL: Global Administrative Unit Layers 2015, First-Level Administrative Units in Google earth Engine. But since two states from two different countries (India and Pakistan) share the same name 'Punjab', both are getting called at the same time.

var admin2 = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level1");  
var Punjab = admin2.filter(ee.Filter.eq('ADM1_NAME', 'Punjab'));
var geometry = Punjab.geometry();
print(Punjab);

Following are properties (from print result) for the Punjab I'm interested in

properties: Object (10 properties)
ADM0_CODE: 115
ADM0_NAME: India
ADM1_CODE: 1505
ADM1_NAME: Punjab
DISP_AREA: NO
EXP1_YEAR: 3000
STATUS: Member State
STR1_YEAR: 1000
Shape_Area: 4.71469176168
Shape_Leng: 15.4216253262

Based on this I tried to replace 'ADM1_NAME' to 'ADM1_CODE' which is different for both Punjab states

var admin2 = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level1");  
var Punjab = admin2.filter(ee.Filter.eq('ADM1_CODE', '1505'));
var geometry = Punjab.geometry();
print(Punjab);

But then I'm not getting anything.
How can I call the Punjab shape that I want?

Best Answer

ADM1_CODE is not a string, but a number. Just remove the quotation marks:

var Punjab = admin2.filter(ee.Filter.eq('ADM1_CODE', 1505));
Related Question