This question already has an answer here:
I'm using ArcMap 10.
I want a python script that tells me the Xmin, Xmax, Ymin, and Ymax of a polygon. (I guess this is finding the extent of a polygon?)
My current script gives me the correct the Xmin and Xmax, but it gives me the Ymin and Ymax of the data frame. I want the Ymin and Ymax of a polygon.
Here is my current code:
# Specify the shapefileshapeFile = "C:/Big_Creek_MapUnits.shp"# Use the describe functiondesc = arcpy.Describe(shapeFile)# Print stuff outarcpy.AddMessage(desc.extent.Xmin)arcpy.AddMessage(desc.extent.Xmax)arcpy.AddMessage(desc.extent.Ymin)arcpy.AddMessage(desc.extent.Ymax)Anyone have any solutions or tips?
أكثر...
I'm using ArcMap 10.
I want a python script that tells me the Xmin, Xmax, Ymin, and Ymax of a polygon. (I guess this is finding the extent of a polygon?)
My current script gives me the correct the Xmin and Xmax, but it gives me the Ymin and Ymax of the data frame. I want the Ymin and Ymax of a polygon.
Here is my current code:
# Specify the shapefileshapeFile = "C:/Big_Creek_MapUnits.shp"# Use the describe functiondesc = arcpy.Describe(shapeFile)# Print stuff outarcpy.AddMessage(desc.extent.Xmin)arcpy.AddMessage(desc.extent.Xmax)arcpy.AddMessage(desc.extent.Ymin)arcpy.AddMessage(desc.extent.Ymax)Anyone have any solutions or tips?
أكثر...