GeoNames To Geodatabase (Topographic Production)

Summary

Loads GeoNames data into a feature class and table. The feature class is composed of point features, and the table contains fields with information concerning the naming conventions used for the features. The feature class contains the Unique Feature Identifier (UFI) and Unique Name Identifier (UNI) fields, which match the same fields in the GeoNames table.

Usage

  • This tool is designed to work with downloadable files from the National Geospatial-Intelligence Agency (NGA) Geographic Names Server and defaults to the NGA GeoNames schema.

  • Before loading the GeoNames data into a database, the feature class and table must already exist.

  • If your organization has an existing GeoNames database, you can use it as long as it includes the UFI and UNI fields.

Parameters

LabelExplanationData Type
GeoNames Source File

The path to the source file containing the GeoNames information. This must be a properly formatted GeoNames file.

Shapefile; Text File
GeoNames Feature Class Name

The GeoNames feature class. This feature class is in the working database.

Feature Class
Allow Duplicates

Specifies whether duplicate features will be imported to the GeoNames feature class.

  • Checked—Features with the same geometry and attributes will be imported.
  • Unchecked—Features with the same geometry and attributes will not be imported. This is the default.
Boolean
GeoNames Table Name

The GeoNames table. This table is in the working database.

Table
Matching Fields
(Optional)

Specific fields in the GeoNames source file that will be mapped to fields in the GeoNames feature class and table.

Value Table

Derived Output

LabelExplanationData Type
Out feature class

Output feature class containing GeoName features.

Feature Class
Out table

Output table containing attribution for GeoName features.

Table

arcpy.topographic.GeoNamesToGeodatabase(in_source, in_feature_class, in_allow_duplicates, in_table, {match_fields})
NameExplanationData Type
in_source

The path to the source file containing the GeoNames information. This must be a properly formatted GeoNames file.

Shapefile; Text File
in_feature_class

The GeoNames feature class. This feature class is in the working database.

Feature Class
in_allow_duplicates

Specifies whether duplicate features will be imported to the GeoNames feature class.

  • ALLOW_DUPLICATESFeatures with the same geometry and attributes will be imported.
  • DON'T_ALLOW_DUPLICATESFeatures with the same geometry and attributes will not be imported. This is the default.
Boolean
in_table

The GeoNames table. This table is in the working database.

Table
match_fields
[match_fields,...]
(Optional)

Specific fields in the GeoNames source file that will be mapped to fields in the GeoNames feature class and table.

Value Table

Derived Output

NameExplanationData Type
out_featureclass

Output feature class containing GeoName features.

Feature Class
out_table

Output table containing attribution for GeoName features.

Table

Code sample

GeoNamesToGeodatabase example (stand-alone script)

The following stand-alone script demonstrates how to use the GeoNamesToGeodatabase function to import GeoNames from a properly formatted text file to a selected GeoNames feature class and table.

# Name: GeoNamesToGeodatabase_sample.py
# Description: Use the GeoNames To Geodatabase tool to import GeoNames from a properly formatted text file to a selected GeoNames feature class and table

# Import System Modules
import arcpy

# Check Out Extensions
arcpy.CheckOutExtension('Foundation')

# Setting Local Variables
in_source = r'C:\Data\Aruba.txt'
in_feature_class = r'C:\Data\Geonames_Template_Script1.gdb\GeoNames_FeaturesP'
in_allow_duplicates = "DON'T_ALLOW_DUPLICATES"
in_table = r'C:\Data\Geonames_Template_Script1.gdb\GEONAMES_TABLE'
match_fields = 'adm1 adm1 adm1;lat_dd lat_dd lat_dd;long_dd long_dd long_dd;ufi ufi ufi;uni uni uni'

# Use the GeoNames To Geodatabase tool to import GeoNames from a properly formatted text file
arcpy.topographic.GeoNamesToGeodatabase(in_source, in_feature_class, in_allow_duplicates, in_table, match_fields)

# Check In Extensions
arcpy.CheckInExtension('Foundation')

Environments

This tool does not use any geoprocessing environments.

Licensing information

  • Basic: No
  • Standard: Requires Production Mapping
  • Advanced: Requires Production Mapping

Related topics