I want to use the images provided by Planet & NICFI (https://www.planet.com/nicfi/#sign-up). This images are now available on GEE as shown in the dataset catalog in Google Earth engine: https://developers.google.com/earth-engine/datasets/tags/nicfi.
when I run the test scrip in my JS code editor:
var nicfi = ee.ImageCollection('projects/planet-nicfi/assets/basemaps/asia');
// Filter basemaps by date and get the first image from filtered results
var basemap= nicfi.filter(ee.Filter.date('2021-03-01','2021-07-01')).first();
Map.setCenter(107, 10, 4);
var vis = {"bands":["R","G","B"],"min":64,"max":5454,"gamma":1.8};
Map.addLayer(basemap, vis, '2021-03 mosaic');
Map.addLayer(
basemap.normalizedDifference(['N','R']).rename('NDVI'),
{min:-0.55,max:0.8,palette: [
'8bc4f9', 'c9995c', 'c7d270','8add60','097210'
]}, 'NDVI', false);
It works as expected.
when I translate this code in Python and try to display it using geemap
:
from geemap import Map
import ee
ee.Initialize()
Map = Map()
nicfi = ee.ImageCollection('projects/planet-nicfi/assets/basemaps/asia')
# Filter basemaps by date and get the first image from filtered results
basemap = nicfi.filter(ee.Filter.date('2021-03-01','2021-07-01')).first()
Map.setCenter(107, 10, 4)
vis = {"bands":["R","G","B"],"min":64,"max":5454,"gamma":1.8}
Map.addLayer(basemap, vis, '2021-03 mosaic')
Map
I get the following error:
EEException: ImageCollection.load: ImageCollection asset 'projects/planet-nicfi/assets/basemaps/asia' not found.
How can a collection be available in the JS code editor but not in the Python API ?
I'm using the same account to authenticate in both services (Python API and JS code editor)
Best Answer
I had updated my NICFI data access. If anyone face this issue, you should reset your GEE authentification in your Python environment and start again:
Now the code run on both platform