I get this error (Script Error, File too large: larger than 512kb) in Google Earth Engine and my layer is a Multypolygon, just with 86 polygons. I have another layer with 300 polygons without any problem, and I noticed that it's a GeometryCollection (Type), but I don't Know how it changes. Do you know how can I do that?
In Earth Engine's geometry model, something being called a
GeometryCollection rather than
MultiPolygon just means that some of the geometries are not polygons (they could be lines or points). You cannot cause a
GeometryCollection to be made out of polygons except by unioning them with a non-polygon geometry.
However, there is no reason to do this — geometry collections are not processed more efficiently if they are non-uniform.
(I'm referring to geometries being processed within Earth Engine only. Of course, external formats — including the GeoJSON that EE's geometry I/O is based on — allow writing a container more general than necessary; I'm saying that this doesn't matter once the geometry is loaded, and the answer you get will always be based on the actual contents, not what was loaded.)
For your problem, you should consider storing your complex geometry as an asset instead of a script import. This will have much better performance and larger size limits. (The disadvantage is that you cannot edit it interactively.)