You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I convert from (Geo)DataFrame that contains a column with date to FeatureCollection, I cannot filter by date because the date is only stored in properties of the FeatureCollection.
Source code
gdf_radd = gpd.read_file('RADD_alerts.gpkg')
alerts_subset = gdf_radd.query(''20210101 < date < 2021-03-03')
#alerts subset returns a non-empty GeoDataFrame containing rows within selected dates
ee_radd = geemap.geopandas_to_ee(gdf_radd)
alerts_subset_ee = ee_radd.filterDate(ee.Date('2021-01-01'), ee.Date('2021-03-03'))
#alerts_subset_ee is empty. it is not possible to filter by date
Desired behaviour
#I would be able to specify a column that contains date/datetime when converting from (Geo)DataFrame to GEE FeatureCollection
ee_radd = geemap.geopandas_to_ee(gdf_radd, datetime=gdf_radd.date)
Possible sketch of a solution
def set_date(feature):
date = feature.get('date').getInfo()
year, month, day = [int(i) for i in date.split()[0].split('/')]
date_mls = ee.Date.fromYMD(year, month, day).millis()
feature = feature.set("system:time_start", date_mls)
return feature
ee_radd_with_dates = ee_radd.map(set_date)
The text was updated successfully, but these errors were encountered:
Description
When I convert from (Geo)DataFrame that contains a column with date to FeatureCollection, I cannot filter by date because the date is only stored in properties of the FeatureCollection.
Source code
Desired behaviour
Possible sketch of a solution
The text was updated successfully, but these errors were encountered: