The layer Polygon_A is a vector layer consisting of numerous polygons, created from a binary raster layer with values of 0 and 1. On the other hand, Polygon_B is a vector layer created from user-defined geometrical shapes and contains only three distinct polygon shapes. When subtracting Polygon_A from Polygon_B and exporting the resulting layer as Polygon_C, an issue arises when importing it into Arcmap. Specifically, only one polygon appears in the attribute table, which requires investigation to determine the cause of this problem and how to resolve it.
Below shows necessary JavaScript code related with subtraction of A from B in Google Earth Engine (GEE).
// Define the geometry of B feature
var Polygon_B= ee.FeatureCollection(table);
var B=Polygon_B.geometry();
// Define the geometry of A feature
var A = Polygon_A.geometry();
// Erase A from B and create C
var C= A.difference(B, ee.ErrorMargin(1));
// Convert geometry to feature
var Polygon_C= ee.Feature(C);
print(Polygon_C)
// Export the polygon as a shapefile to a specific folder in Google Drive
Export.table.toDrive({
collection: ee.FeatureCollection([Polygon_C]),
description: 'Polygon_C',
folder: 'Shapefile_GEE', //My Folder name of Google Drive
fileFormat: 'SHP'
});