Create Location File From Text File (Intelligence)

Summary

Creates a location file for use in ArcGIS LocateXT from a text file from GeoNames, National Geospatial-Intelligence Agency Geonet Names Server, or U.S. Geological Survey Geographic Names Information Service.

Usage

  • The tool takes an input text file from GeoNames, the National Geospatial-Intelligence Agency (NGA) Geonet Names Server (GNS), or the U. S. Geological Survey's (USGS) Geographic Names Information Service (GNIS) for both the United States and Antarctica and creates a custom location file that can be used by the Extract Locations From Text and Extract Locations From Document tools or in the Extract Locations pane. For more information on how to enable custom locations for these tools, see Add and manage custom locations and custom attributes files.

    The tool creates a custom location file (.lxtgaz) that can be used on the Custom Locations tab of the Extract Locations pane and with the Extract Locations From Document and Extract Locations From Text tools.

  • The Data Source parameter is used to identify the source of the input file. GeoNames, GNS, and GNIS formats contain unique schemas and separators. If an incorrect data source is chosen, the output file will be empty. If this occurs, ensure that the selected data source matches the input place names file.

  • The Include Features parameter is used to limit the feature class types included in the output. Filtering can be done based on the following feature class types:

    • Administrative
    • Populated places
    • Vegetation
    • Locality
    • Undersea
    • Transportation
    • Terrain
    • Hydrological
    • Spot

    You can also filter by specifying a region of interest. When a region of interest is specified, the resulting Output Location File value will only contain results that are wholly contained within the specified region of interest.

  • Place name files can be downloaded from the following locations:

Parameters

LabelExplanationData Type
Input Placenames File

A place names text file obtained from GeoNames, NGA GNS, or USGS GNIS.

File
Data Source

Specifies the data source from which the input was created.

  • GeoNames — The input file is from GeoNames.org.
  • NGA GNS —The input file is from NGA GNS.
  • USGS GNIS —The input file is from USGS GNIS.
  • USGS Antarctic Names —The input file is from USGS GNIS Antarctic Names.
String
Output Location File

The output location file.

File
Include Features
(Optional)

Specifies the feature class types from the input data source that will be included in the output.

  • Administrative Features — Administrative features such as administrative boundaries, town, city, state, province, tribal, and country borders will be included.
  • Hydrological Features —Features such as rivers, lakes, ponds, and other water features will be included.
  • Locality Features —Features such as buildings, churches, hospitals, and other human-made points of interest will be included.
  • Populated Places —Locations of named places such as towns, cities, villages, and other consolidated areas of people will be included.
  • Transportation Features —Features such as roads, trails, railroads, and airports will be included.
  • Spot Features —Hypsographic features such as mountain peaks and other natural points of interest will be included.
  • Terrain Features —Features such as mountains, hills, cliffs, craters, and ridges will be included.
  • Vegetation Features —Features such as forests, bushland, scrubland, and other areas of consistent vegetation will be included.
  • Undersea Features —Undersea features such as reefs, bars, and shipwrecks will be included.
String
Input Regions Of Interest
(Optional)

The feature layer that will be used to create a subset of the input place names file.

Feature Layer

arcpy.intelligence.CreateLocationFileFromTextFile(in_placenames_file, data_source, out_location_file, {include_features}, {in_rois})
NameExplanationData Type
in_placenames_file

A place names text file obtained from GeoNames, NGA GNS, or USGS GNIS.

File
data_source

Specifies the data source from which the input was created.

  • GEONAMES The input file is from GeoNames.org.
  • NGA_GNSThe input file is from NGA GNS.
  • USGS_GNISThe input file is from USGS GNIS.
  • USGS_ANTARCTIC_NAMESThe input file is from USGS GNIS Antarctic Names.
String
out_location_file

The output location file.

File
include_features
[include_features,...]
(Optional)

Specifies the feature class types from the input data source that will be included in the output.

  • ADMINISTRATIVE_FEATURES Administrative features such as administrative boundaries, town, city, state, province, tribal, and country borders will be included.
  • HYDROLOGICAL_FEATURESFeatures such as rivers, lakes, ponds, and other water features will be included.
  • LOCALITY_FEATURESFeatures such as buildings, churches, hospitals, and other human-made points of interest will be included.
  • POPULATED_PLACESLocations of named places such as towns, cities, villages, and other consolidated areas of people will be included.
  • TRANSPORTATION_FEATURESFeatures such as roads, trails, railroads, and airports will be included.
  • SPOT_FEATURESHypsographic features such as mountain peaks and other natural points of interest will be included.
  • TERRAIN_FEATURESFeatures such as mountains, hills, cliffs, craters, and ridges will be included.
  • VEGETATION_FEATURESFeatures such as forests, bushland, scrubland, and other areas of consistent vegetation will be included.
  • UNDERSEA_FEATURESUndersea features such as reefs, bars, and shipwrecks will be included.
String
in_rois
(Optional)

The feature layer that will be used to create a subset of the input place names file.

Feature Layer

Code sample

CreateLocationFileFromTextFile (stand-alone script)

The following code demonstrates how to use the CreateLocationFileFromTextFile function in a stand-alone script.

# Name: CreateLocationFileFromTextFile.py
# Description: Create a custom location file for use with LocateXT. 

# Import system modules 
import arcpy 

source_file = r'C:\data\US.txt'
data_source = 'GEONAMES'
location_file = r'C:\data\US.lxtgaz'
filter_features = ['POPULATED_PLACES']
loudoun_county = r'C:\virginia.gdb\loudoun_co'

arcpy.CreateLocationFileFromTextFile_intelligence(source_file,
                                                  data_source,
                                                  location_file,
                                                  filter_features,
                                                  loudoun_county)

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: No
  • Advanced: Yes

Related topics