I am trying to transform some weather ee.Image to vector format. For context, my final goal is to export data as shapefile, read into GeoPandas and use it as input to a deep learning model, so there may be easier ways to do this since I am pretty noob with gee.
# load the image collection and filter
collection_idx = "JAXA/GPM_L3/GSMaP/v6/operational"
collection = ee.ImageCollection(collection_idx)\
.filter(ee.Filter.date('2020-01-01', '2020-01-02'))\
.select("hourlyPrecipRate")
# define amazon region
region = ee.Geometry.Rectangle(
[
[-73.99097222, -18.04176667], [-43.95182736, 5.272225]
]
)
# sum hourly values
reduced_quarter_image = collection.reduce(ee.Reducer.sum()).clip(region)
# reduce to vectors using 3 km scale
vector = reduced_quarter_image.gt(0).reduceToVectors({
"reducer": ee.Reducer.sum(),
"geometry": region,
"scale": 3e3,
"geometryType": 'polygon',
"crs": reduced_quarter_image.projection()
})
I am receveing the following error:
EEException: Invalid argument for ee.Reducer(): ({'reducer': <ee.Reducer...
What is wrong here?