1

I've imported two shapefiles into Google Earth engine and am trying to combine them to form a feature collection. I do this using the code;

var ROI = ee.FeatureCollection([
ee.Feature(OSPAR_II.geometry(), {'id': 'OSPAR_II'}),
ee.Feature(OSPAR_III. geometry(), {'id': 'OSPAR_III'}) 
]);

This seems to print fine, but when I try and add this layer to the map;

Map.addLayer(ROI, {}, 'ROI');

I get the error ROI: Layer error: Description length exceeds maximum.

What is causing this? I've done something similar before and never had this issue.

My code can be found here

2 Answers 2

1

You can merge your two FeatureCollections instead. I don't know why that works better, but it happily displays on the map.

var ROI = OSPAR_II.merge(OSPAR_III)

https://code.earthengine.google.com/b47e64be67cd2869573737c87388571f

1
  • Works perfectly thanks Commented Mar 13, 2020 at 11:52
0

I have the same case relating to the shapefiles. In my case, the error was caused by the complexity of the geometry. The limitation of the Earth Engine is 2M edges of the geometry. When I use a simple polygon, my code works well. Hope this will help you.

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.