Label | Explanation | Data Type |
Input Table
| The table containing the source coordinates. | Table View |
Output Polygon Feature Class | The feature class containing the output polygon features. | Feature Class |
X Field (Longitude, UTM, MGRS, USNG, GARS, GeoRef)
| The field in the input table containing the x or longitude coordinates. | Field |
Input Coordinate Format
| Specifies the format of the input table coordinates.
| String |
Y Field (Latitude)
(Optional) | The field in the input table containing the y or latitude coordinates. The Y Field (latitude) parameter is used when the Input Coordinate Format parameter is set to Decimal Degrees - Two Fields, Degrees and Decimal Minutes - Two Fields, or Degrees Minutes and Seconds - Two Fields. | Field |
Line Grouping Field
(Optional) | The field in the input table used to create unique polygons. A polygon will be created for each unique value. | Field |
Sort Field
(Optional) | The field in the input table used to order the polygon vertices. The field must be a numerical field. | Field |
Output Coordinate System
(Optional) | The spatial reference of the output feature class. The default is GCS_WGS_1984. | Spatial Reference |
Summary
Creates polygon features from coordinates stored in a table.
Usage
The Coordinate Table To Polygon tool can accept CSV files, DBF tables and geodatabase tables as input when creating polygons.
Each row of the input table will become a vertex of an output polygon.
Individual polygons can be created using the Line Grouping Field parameter.
Parameters
arcpy.defense.CoordinateTableToPolygon(in_table, out_feature_class, x_or_lon_field, in_coordinate_format, {y_or_lat_field}, {line_group_field}, {sort_field}, {coordinate_system})
Name | Explanation | Data Type |
in_table | The table containing the source coordinates. | Table View |
out_feature_class | The feature class containing the output polygon features. | Feature Class |
x_or_lon_field | The field in the input table containing the x or longitude coordinates. | Field |
in_coordinate_format | Specifies the format of the input table coordinates.
| String |
y_or_lat_field (Optional) | The field in the input table containing the y or latitude coordinates. The y_or_lat_field parameter is used when the in_coordinate_format parameter is set to DD_2, DDM_2, or DMS_2. | Field |
line_group_field (Optional) | The field in the input table used to create unique polygons. A polygon will be created for each unique value. | Field |
sort_field (Optional) | The field in the input table used to order the polygon vertices. The field must be a numerical field. | Field |
coordinate_system (Optional) | The spatial reference of the output feature class. The default is GCS_WGS_1984. | Spatial Reference |
Code sample
The following Python window script demonstrates how to use the CoordinateTableToPolygon function.
import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.CoordinateTableToPolygon_defense(r"C:/Data/TableToPolygon.csv",
"Table2Poly", "X", "DD_2", "Y", "Name",
"VSort")
Create polygons from a table and then create buffers around the polygons.
# Description: Generate buffers around polygon features created from tabular
# data.
# Import system modules
import arcpy
# Set environment settings
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.env.overwriteOutput = True
# Create polygons
input_table = r"C:/DataFolder/TableToPolygon.csv"
result_polygon = "Table2Poly"
arcpy.CoordinateTableToPolygon_defense(input_table,
result_polygon,
"POINT_X",
"DD_2",
"POINT_Y",
"Name",
"VSort")
# Generate buffers around polygons
buffer_result = "Buffered_Polygons"
arcpy.Buffer_analysis(result_polygon, buffer_result, "100 Kilometers")
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes