I have more than >100 shp files (each one contain points). I would like to make polygon around particular shp (scale is not necessary, should be zoomed). I have already printed them but it would be great to make one illustrative map where they are located. So as a result one map allow to recognize where thea are located (if proper labelled of course). Is there any tool (arcgis) which will automate generate polygons around each one?
An out-of-the-box ArcMap tool that can do this is Data Management Tools > Features > Minimum Bounding Geometry. This will create a polygon feature class containing one polygon that depicts the extent of your features.
You can do different things with this tool. To create a polygon feature class containing a single feature depicting the extent of all features of the input shapefile, tell it you want to create Geometry Type = Envelope and Group Option = All. This is telling the tool you want to create a rectangular polygon from the extent of all features.
Then you can merge all the output extent feature classes.
Note that if you check to add geometry characteristics and your data is in projected space, you can get the area of your polygons, etc.
Since you don't want to use a script, you could use the batch grid, in the following fashion.
- Make a new geodatabase.
- Set this new geodatabase to be your default geodatabase in the Catalog Window.
- Open the Minimum Bounding Geometry tool to the batch grid. (Right-click and select Batch.)
- Select all the input shapefiles and drag them to the input features parameter, so they will create a batch.
- If you have a common name column you can use for labeling, you can group by that, instead of saying ALL.
- Let ArcMap pick the output names and paths.
- Click OK.
7 yo script to do the job:
# Import arcpy module import arcpy, traceback, os, sys from arcpy import env env.overwriteOutput = True try: # input folder with shapefiles or rasters inputFolder = arcpy.GetParameterAsText(0) env.workspace = inputFolder # output folder for tiles shapefile outputFolder = arcpy.GetParameterAsText(1) # table name outputFile = "tiles.shp" inRasters = arcpy.ListFeatureClasses() arcpy.CreateFeatureclass_management(outputFolder, outputFile, "POLYGON", "", "DISABLED", "DISABLED", "", "", "0", "0", "0") outputFile=outputFolder+ os.sep +outputFile arcpy.AddField_management(outputFile, "FILE_NAME", "TEXT", "", "", 250, "", "NON_NULLABLE", "NON_REQUIRED", "") inRows = arcpy.InsertCursor(outputFile) arcpy.SetProgressor("step", "", 0, len(inRasters)) for inRaster in inRasters: desc = arcpy.Describe(inRaster) ext=desc.extent thePoints=[ext.lowerLeft, ext.upperLeft,ext.upperRight,ext.lowerRight, ext.lowerLeft] pntarray = arcpy.Array(thePoints) polygon = arcpy.Polygon(pntarray) row = inRows.newRow() row.Shape=polygon row.FILE_NAME=inputFolder+os.sep+inRaster inRows.insertRow(row) arcpy.SetProgressorPosition() arcpy.AddMessage (inRaster + "...processed") del inRows except: tb = sys.exc_info() tbinfo = traceback.format_tb(tb) pymsg = "PYTHON ERRORS:\nTraceback Info:\n" + tbinfo + "\nError Info:\n " + \ str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n" msgs = "GEOPROCESSOR ERRORS:\n" + arcpy.GetMessages(2) + "\n" arcpy.AddError(msgs) arcpy.AddError(pymsg)
Script assumes that all shapefiles are stored in single input folder (with little efforts this can be changed). It will create output_folder\tiles.shp containing extents of input shapefiles. The output table will have a field with shapefile name stored in it for individual rectangle.