Dear Open Foris team, I am trying to calculate the Land Productivity Dynamics with Earth Map using a complex polygon to be found in this folder: https://drive.google.com/drive/folders/1ITQTTHS2w4tVwZseIJurv0Ov5TNupQte The polygon has been generated following a river stream with a buffer of 12 km. What do you suggest, shall I simplify it to perform the analytics? asked 13 Sep, 11:34 carmen_morales Open Foris ♦♦ |
Problem: The issue you're encountering while calculating analytics on Earth Map is not so much about the size of the area of your shapefile, but more about the complexity of the polygons themselves. Google Earth Engine, which Earth Map depends on, struggles with very complex polygons, particularly when there is clipping involved. This is compounded when the shapefile contains many small polygons and holes. For example, the shapefile you're using includes many small islands in the rivers and holes (such as small lakes) outside the rivers. Zoomed detail showing islands and holes: These small polygons and holes cause performance issues during analysis. The best solution is to simplify the shapefile by removing them. You can do this using a tool like QGIS or with a simple Python script, which I'll guide you through below. Solution: Simplify Your Shapefile with PythonHere’s how you can clean up your shapefile by removing small polygons (less than 100 hectares by default) and holes within polygons. This will make the shapefile easier to process on Earth Map and Google Earth Engine. Steps:
Important Notes: - Change the shapefile path to your file's location in line 29. - Check the CRS (Coordinate Reference System) for your area and adjust it in line 33. If you're unsure, feel free to ask on the forum. - You can modify the minimum polygon size (default is 100 hectares) in line 45. - The script outputs both a shapefile and a GeoJSON file. The GeoJSON can be used directly in Earth Map! You can download the Python Script here Python Script to Simplify Polygons:
Output Files:
You can now upload the cleaned GeoJSON directly into Earth Map for better performance. Let us know if this solution works for you! We’ve tested it on your shapefile, and here are the results: answered 13 Sep, 13:59 Open Foris ♦♦ |