Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to call a country using ee.Geometry.Polygon? #25

Closed
surajitdb opened this issue Sep 16, 2021 · 4 comments
Closed

How to call a country using ee.Geometry.Polygon? #25

surajitdb opened this issue Sep 16, 2021 · 4 comments

Comments

@surajitdb
Copy link

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.

@surajitdb surajitdb changed the title How to a country using ee.Geometry.Polygon? How to call a country using ee.Geometry.Polygon? Sep 16, 2021
@ErikSeras
Copy link

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').

@aazuspan
Copy link
Owner

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()

@surajitdb
Copy link
Author

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.

@aazuspan
Copy link
Owner

No problem, glad you got it working @surajitdb :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants