I am working to create a polygon from UTM coordinates. The script I am using fails with a "must be a sequence, not float" error:
Traceback (most recent call last):
File "F:/sample/clipTiles.py", line 104, in <module>
arcpy.Array([arcpy.Point(*coords) for coords in feature])))
TypeError: type object argument after * must be a sequence, not float
I have been working off the ArcGIS Polygon help section. My UTM coordinates are generated earlier in a script and take the following form:
[[734855.5142000001, 4744379.424500001], [740607.6685000001, 4744379.424500001], [740607.6685000001, 4736862.1753], [734855.5142000001, 4736862.1753]]
These are the min/max point pairs of a custom bounding box I need to convert to polygon.
# feature_info eventually takes the following form: [[734855.5142000001, 4744379.424500001], [740607.6685000001, 4744379.424500001], [740607.6685000001, 4736862.1753], [734855.5142000001, 4736862.1753]]
feature_info = [[xmin, ymax], [xmax,ymax], [xmax, ymin], [xmin, ymin]]
# A list that will hold each of the Polygon objects
features = []
for feature in feature_info:
# Create a Polygon object based on the array of points
# Append to the list of Polygon objects
features.append(
arcpy.Polygon(
arcpy.Array([arcpy.Point(*coords) for coords in feature])))
# Persist a copy of the Polyline objects using CopyFeatures
outshp = os.path.join(outws, row[2] + "_shp")
arcpy.CopyFeatures_management(features, outshp)
How can I write these UTM coordinates to a polygon featureclass?