0

I want to get the union of a list of multiple LineStrings and Polygons. The variable geoLeyte contains this list, but if I want to use the .dissolve() attribute, it gives an error. Who could help me?

var table = table.filter(ee.Filter.eq('ADM2_EN', 'Leyte'))

Map.centerObject(table)
Map.addLayer(table, {}, 'Leyte')

var geoLeyte = table.geometry().geometries()
var union = ee.Geometry.MultiPolygon(geoLeyte).dissolve() 
print(union)

See code here https://code.earthengine.google.com/dcc98657ae22092ed4909e02c96965cf

1 Answer 1

2

You've taken too many steps. Once you've called geometries(), you've turned it into a list, and getting back from there is tough if they're not all the same type. Just dissolve the table's geometry directly.

var geoLeyte = table.geometry().dissolve()

That said, the resulting geometry is pretty big, so you're probably going to run into problems using it. You should consider trying to use the original table directly instead.

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.