How to call a country using ee.Geometry.Polygon?
Closed this issue · 4 comments
Hi Aaron, I am wondering how to call a country using ee.Geometry.Polygon in wxee or is there any other way? Since Google Fusion Tables is not supported any more on Earth Engine, is there a way out to call a country polygon?
Thank you.
Hi, you can use the osm_to_ee() function from the geemap
package to get data (such as a country polygon) from OpenStreetMap and convert it to an ee.FeatureCollection
object. For example: geemap.osm_to_ee('Brasil')
.
Good idea @ErikSeras!
Another option is to use the country datasets built into Earth Engine like FAO GAUL. One of the examples in the wxee docs shows how you can load that FeatureCollection
, select a single country, and use that as the region
for converting a TimeSeries
to xarray.
Something like
countries = ee.FeatureCollection("FAO/GAUL_SIMPLIFIED_500m/2015/level0")
madagascar = countries.filterMetadata("ADM0_NAME", "equals", "Madagascar")
region = madagascar.geometry().bounds()
Hi @ErikSeras and @aazuspan,
Thank you so much for the prompt reply. I tried both and they worked successfully. In addition to geemap, one would still need to install pandas and osmnx libraries to run the first alternative. Sorry that I did not happen to go through the whole document because of which I missed the second alternative.
No problem, glad you got it working @surajitdb :)