I have recently run the Time Series Cross Correlation geoprocessing tool to get outputs including a polygon feature class and a correlation table listing correlation coefficients for each polygon for each lag value defined by the correlation analysis. I am hoping to take this correlation table and convert it to a polygon feature class so that I can range-enable it and create an animation showing how each polygon's correlation coefficient changes over the lag value range.
In past projects, I converted tabular data to a point feature class by reading the tabular data into a pandas dataframe, converting that dataframe to a spatially enabled dataframe using the ArcGIS API for Python geoaccessor, and converting the spatially enabled dataframe to a point feature class. In this case, though, I want to convert my tabular data into a feature class with polygon geometry. I tried adding a column to my pandas dataframe with the polygon geometry obtained from the shape@ token using arcpy.da.SearchCursor() and using Geoaccessor.from_df() to specify this column as the dataframe's geometry information, but the function appears to have timed out without completing.
Is there a different function in the Geoaccessor module that I should be using instead, or is there perhaps a different workflow for applying polygon geometry to tabular data that would be better for me to use?
Solved! Go to Solution.
Hi @KevinBoes1,
If your goal here is to create a Polygon Feature Class you can do that with ArcPy (Create Feature Class) using your Correlation Table as a Template. Append in the Correlation table data, this will leave you without geometry which you can then grab from the original polygons. If you have a matching ID from the table back to the Polygon datasets you can iterate over the Polygon dataset with a SearchCursor and use an UpdateCursor to update the Polygon geometry.
All the best,
Glen
Hi @KevinBoes1,
If your goal here is to create a Polygon Feature Class you can do that with ArcPy (Create Feature Class) using your Correlation Table as a Template. Append in the Correlation table data, this will leave you without geometry which you can then grab from the original polygons. If you have a matching ID from the table back to the Polygon datasets you can iterate over the Polygon dataset with a SearchCursor and use an UpdateCursor to update the Polygon geometry.
All the best,
Glen
Glen,
This got me exactly what I wanted! Thank you!