HOW TO

Create polygons for areas of interest generated from a text file using ArcGIS LocateXT

Last Published: April 25, 2020

Summary

ArcGIS LocateXT in ArcGIS Pro is capable of generating points from files containing unstructured text. By combining the capability of ArcGIS LocateXT with the Aggregate Points tool, polygons for the areas of interest, (for example, in an archeological site) can be created to help archeologists focus on excavating only related areas, and avoid unrelated areas.

In this article, all the bones (points feature class) found on an archeological site within one mile radius of another set are considered areas of interest. This is important because the archeologist could draw a conclusion that a group of people had perished in a battle in this area indicating that it is a site of major catastrophe.

To generate polygons for the areas of interest, the Extract Locations from Document and the Aggregate Points geoprocessing tools are used.

Example of archeological site where several areas of interest must be created

Procedure

Use either the ModelBuilder or Python workflow to generate polygons for the areas of interest.

Note:
The model and script below are starting points, and can be expanded to build complexity.

Using ModelBuilder

  1. Open ModelBuilder in ArcGIS Pro.
  2. On the ModelBuilder tab, expand the Tools icon in the Insert group.
  3. In the Find Tools search box, search for and double-click the Extract Locations From Document tool.
Select the Extract Locations from Document tool.
  1. In the model view, double-click the tool to open the Extract Locations From Document pane.
    1. In the Parameters section, for Input File, browse to the document file.
    2. Set a name and location for Output Feature Class, and click OK.
Fill in the Extract Locations from Document parameter.
  1. In the Find Tools search box, search and double-click the Aggregate Points tool.
  2. In the model view, double-click the tool to open the Aggregate Points pane.
    1. In the Parameters section, for Input File, set the point features from Output Feature Class in step 4(b).
    2. Set a name and location for Output Feature Class.
    3. For Aggregation Distance, set the distance between the points to be clustered, and click OK.
The Aggregate Points dialog box.

The image below shows an example of the model in the model view.

ModelBuilder

Using Python

The following steps describe how to generate polygons for the areas of interest using the ArcPy module:

  1. Import the necessary modules.
import arcpy
  1. Set the overwriting output option to False.
arcpy.env.overwriteOutput = False
  1. Specify the path and name parameter.
Text_Input = r"Input path of the document" 
InterestAreas = r"Output path and name (.shp)" 
InterestAreas_AggregatePoint_Tbl = InterestAreas
InterestAreas_AggregatePoint = r"Output path and name" 
  1. Extract locations from the document to a point feature class.
arcpy.ExtractLocationsDocument_conversion(in_file=Text_Input, out_feature_class=InterestAreas, in_template="", coord_dd_latlon="FIND_DD_LATLON", coord_dd_xydeg="FIND_DD_XYDEG", coord_dd_xyplain="FIND_DD_XYPLAIN", coord_dm_latlon="FIND_DM_LATLON", coord_dm_xymin="FIND_DM_XYMIN", coord_dms_latlon="FIND_DMS_LATLON", coord_dms_xysec="FIND_DMS_XYSEC", coord_dms_xysep="FIND_DMS_XYSEP", coord_utm="FIND_UTM_MAINWORLD", coord_ups_north="DONT_FIND_UTM_NORTHPOLAR", coord_ups_south="DONT_FIND_UTM_SOUTHPOLAR", coord_mgrs="FIND_MGRS_MAINWORLD", coord_mgrs_northpolar="DONT_FIND_MGRS_NORTHPOLAR", coord_mgrs_southpolar="DONT_FIND_MGRS_SOUTHPOLAR", comma_decimal="USE_DOT_DECIMAL_MARK", coord_use_lonlat="PREFER_LATLON", in_coor_system="GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426.2;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", in_custom_locations="", fuzzy_match="DONT_USE_FUZZY", max_features_extracted="", ignore_first_features="", date_monthname="FIND_DATE_MONTHNAME", date_m_d_y="FIND_DATE_M_D_Y", date_yyyymmdd="FIND_DATE_YYYYMMDD", date_yymmdd="FIND_DATE_YYMMDD", date_yyjjj="FIND_DATE_YYJJJ", max_dates_extracted="", ignore_first_dates="", date_range_begin="", date_range_end="", in_custom_attributes="", file_link="", file_mod_datetime="", pre_text_length="254", post_text_length="254", std_coord_fmt="STD_COORD_FMT_DD")

  1. Create polygon features around clusters of proximate feature class.
arcpy.AggregatePoints_cartography(in_features=InterestAreas, out_feature_class=InterestAreas_AggregatePoint, aggregation_distance="1 Miles")

The following shows the full script for creating polygons for the areas of interest.

import arcpy

# To allow overwriting the outputs, change the overwrite option to true.
arcpy.env.overwriteOutput = False

# Local variables:
Text_Input = r"Input path of the document"
InterestAreas = r"Output path and name (.shp)"
InterestAreas_AggregatePoint_Tbl = InterestAreas
InterestAreas_AggregatePoint = r"Output path and name"

# Process: Extract Locations From Document
arcpy.ExtractLocationsDocument_conversion(in_file=Text_Input, out_feature_class=InterestAreas, in_template="", coord_dd_latlon="FIND_DD_LATLON", coord_dd_xydeg="FIND_DD_XYDEG", coord_dd_xyplain="FIND_DD_XYPLAIN", coord_dm_latlon="FIND_DM_LATLON", coord_dm_xymin="FIND_DM_XYMIN", coord_dms_latlon="FIND_DMS_LATLON", coord_dms_xysec="FIND_DMS_XYSEC", coord_dms_xysep="FIND_DMS_XYSEP", coord_utm="FIND_UTM_MAINWORLD", coord_ups_north="DONT_FIND_UTM_NORTHPOLAR", coord_ups_south="DONT_FIND_UTM_SOUTHPOLAR", coord_mgrs="FIND_MGRS_MAINWORLD", coord_mgrs_northpolar="DONT_FIND_MGRS_NORTHPOLAR", coord_mgrs_southpolar="DONT_FIND_MGRS_SOUTHPOLAR", comma_decimal="USE_DOT_DECIMAL_MARK", coord_use_lonlat="PREFER_LATLON", in_coor_system="GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]];-400 -400 11258999068426.2;-100000 10000;-100000 10000;8.98315284119521E-09;0.001;0.001;IsHighPrecision", in_custom_locations="", fuzzy_match="DONT_USE_FUZZY", max_features_extracted="", ignore_first_features="", date_monthname="FIND_DATE_MONTHNAME", date_m_d_y="FIND_DATE_M_D_Y", date_yyyymmdd="FIND_DATE_YYYYMMDD", date_yymmdd="FIND_DATE_YYMMDD", date_yyjjj="FIND_DATE_YYJJJ", max_dates_extracted="", ignore_first_dates="", date_range_begin="", date_range_end="", in_custom_attributes="", file_link="", file_mod_datetime="", pre_text_length="254", post_text_length="254", std_coord_fmt="STD_COORD_FMT_DD")

# Process: Aggregate Points
arcpy.AggregatePoints_cartography(in_features=InterestAreas, out_feature_class=InterestAreas_AggregatePoint, aggregation_distance="1 Miles")
The Python script

After running the model or the Python script above, a point feature class and a polygon feature class are created. Polygons are created only around the clusters of points that fall within the given area of interest.

Polygons containing all the points in a given area of interest and with the points on the edge of the area on the edge of the polygon

Article ID: 000021892

Software:
  • ArcGIS Pro 2 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options