refactored code to generate shape column and added doc
"## Publish results to your GIS"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The `predict_video` function also updates the metadata file provided in csv format with the detections at each frame. We will now read this csv using pandas and publish it as a layer on our GIS."
+ ]
+ },
{
"cell_type": "code",
"execution_count": 17,
"df"
]
},
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "The code below removes rows from the DataFrame with no detections and also creates a new columns which contains count of the number of detections at each frame."
+ ]
+ },
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [],
"source": [
- "df_flt['SHAPE'] = df_flt.apply(lambda row : arcgis.geometry.Geometry({'x': row['Sensor Longitude'], \n",
- " 'y': row['Sensor Latitude']}), axis=1 )"
+ "sdf = GeoAccessor.from_xy(df_flt, 'Sensor Longitude', 'Sensor Latitude')"
]
},
{
"metadata": {},
"outputs": [],
"source": [
- "cracks_lyr = gis.content.import_data(df_flt, title='crack points')"
+ "cracks_lyr = gis.content.import_data(sdf, title='crack points')"
]
},
{
