chun7642/workaround to support temporal filtering part2
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from arcgis import geometry\n",
"\n",
- "def filter_images(my_map, where_clause):\n",
+ "def filter_images(my_map, where_clause, suffix):\n",
" global df\n",
"\n",
" selected = ls_water_lyr.filter_by(where=where_clause, geometry=geometry.filters.intersects(ls_water_lyr.extent))\n",
" \n",
" blend_lyr.properties.spatialReference = blend_lyr.properties.extent.spatialReference\n",
" \n",
- " lyr = blend_lyr.save('blend_lyr_1999_2000', for_viz=True)\n",
+ " lyr = blend_lyr.save('blend_lyr' + suffix, for_viz=True)\n",
" my_map.add_layer(lyr)\n",
" \n",
" fs = selected.query(out_fields=\"AcquisitionDate, GroupName, Month, JulianDay, WRS_Row, WRS_Path, Name\", \n",
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": 14,
"metadata": {},
"outputs": [
{
"2 6.439793 144 53 1990-01-24 "
]
},
- "execution_count": 7,
+ "execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"satmap1 = gis.map(\"Tamil Nadu, India\")\n",
- "df = filter_images(satmap1, \"(Year = 1989) OR (Year = 1990)\") \n",
+ "df = filter_images(satmap1, \"(Year = 1989) OR (Year = 1990)\", \"_1989_1990\") \n",
"df.head(3)"
]
},
{
"cell_type": "code",
- "execution_count": 9,
+ "execution_count": 15,
"metadata": {},
"outputs": [
{
"2 6.574525 143 54 2009-02-14 04:55:47.066999911 "
]
},
- "execution_count": 9,
+ "execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"satmap2 = gis.map(\"Tamil Nadu, India\")\n",
- "df = filter_images(satmap2, \"(Year = 2009) OR (Year = 2010)\")\n",
+ "df = filter_images(satmap2, \"(Year = 2009) OR (Year = 2010)\",\"_2009_2010\")\n",
"df.head(3)"
]
},
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "6309cc5d939f410daa59a8a975887d80",
+ "model_id": "c0fe73c196434ff08dbf2b3bcc697883",
"version_major": 2,
"version_minor": 0
},
