I am creating a series of geoprocessing tools for an AGE project and one of these tools includes a union function that is called when certain conditions are met. I am using the arcgis.geometry.module from the ArcGIS API for Python library. I am using a list comprehension of geometries that I created from a feature set that contains the polygons I would like to create a union from. I use this list comprehension as the geometries parameter in the union function to create a new polygon but what is returned is a single set of geometry, which appears to be the centroid of one of the polygons. Below is a summation of what my script looks like inside my union function.
getGeom = [polygon.geometry for polygon in checkStat]
This is what the list above looks like when it is returned.
[{'rings': [[[-79608.7971409224, 853510.7087014914], [-6525.311090338975, 856120.8334024921], [-2610.1243669204414, 780427.2229789868], [-78303.73479042202, 780427.2229789868], [-79608.7971409224, 853510.7087014914]]], 'spatialReference': {'wkid': 2881, 'latestWkid': 2881}}, {'rings': [[[-44372.1163020879, 880917.0160934925], [32626.556143827736, 886137.2648393214], [41761.991941161454, 837849.9618078247], [-44372.1163020879, 837849.9618078247], [-44372.1163020879, 880917.0160934925]]], 'spatialReference': {'wkid': 2881, 'latestWkid': 2881}}]
bndPoly = getGeom
bndUnion =union(bndPoly, spatial_ref=2881, gis=gis)
This is what is returned from the union.
[-83.0702025625555, 26.60882017966672]
I have also tried this, but get the same result.
polyList=[]
for poly in getGeom:
polygon = (Polygon(poly))
sr = polygon.spatialReference
geom1_reprojected = project(geometries = [polygon], in_sr = sr, out_sr = 2881)[0]
polyList.append(geom1_reprojected)
Any help or insight into what I am doing wrong is greatly appreciated, thank you!