ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

ArcMap

  • Inicio
  • Introducción
  • Cartografiar
  • Analizar
  • Administrar datos
  • Herramientas
  • Extensiones

Create Features from Text File

  • Resumen
  • Uso
  • Sintaxis
  • Muestra de código
  • Entornos
  • Información de licenciamiento

Resumen

Creates features using coordinates in text files.

Heredado:
This tool has been deprecated. For more information, see An overview of the Samples toolbox.

Uso

  • This tool will create a feature class based on coordinates given in a text file. Text files can be the output from the Write Features To Text File tool or from files you created.

  • Text files must be space delimited and will have different formats, depending on the geometry type.

  • It is not necessary to provide z- and m-values to point coordinates. Values of 1.#QNAN are given to unprovided z- and m-values.

  • If you use a thousands separator, the script will not work correctly. Instead of using 1,023.5, use 1023.5.

  • The script is able to handle various decimal separators. For example, data from the United States will often be in the format 1234.5, while data from Europe may be in the format 1234,5. Specify the decimal separator that corresponds to your data. If you have only integers, you may specify any separator you like.

  • The spatial reference parameter is optional. If you know the spatial reference of the input text coordinates, you can specify it; however, it is not required. If specified, the output feature class will have the spatial reference you selected.

  • Text files that represent points should be in the following format: The first line should contain the word Point to indicate the geometry type and the next lines should have the id and x,y,z,m coordinates of the points delimited by a space. The final line should contain the word END. Generically, it will look like this:

    Point
    id x y z m
    id x y z m
    ...
    END
    

    An example would be:

    Point
    0 1.0 1.0 3.0 1.4
    1 2.0 2.0 1.0 3.2
    2 3.0 1.0 2.0 2.5
    3 2.0 0.0 1.0 1.0
    END
    
  • Text files that represent multipoints should be in the following format: The first line should contain the word Multipoint to indicate the geometry type and the structure continues with the id number of the first group of points (id x y z m), followed by a zero. The points themselves follow. The final line should contain the word END. Generically, it will look like this:

    Multipoint
    multipoint_id 0
    pnt_id x y z m
    pnt_id x y z m
    ...
    multipoint_id 0
    pnt_id x y z m
    ...
    END
    

    An example would be:

    Multipoint
    0 0
    1 23.0 12.0 5.0 1.0
    2 34.0 32.0 4.0 1.0
    3 11.0 54.0 5.0 1.0
    1 0
    1 11.0 9.0 1.0 1.0
    2 5.0 5.5 1.0 1.0
    3 9.8 3.2 1.0 1.0
    END
    
  • Text files that represent lines should be in the following format: The first line should contain the word Polyline to indicate the geometry type and the structure continues with the id number of the first line, followed by the part number (in case it is a multipart line). The point coordinates follow. The final line should contain the word END. Generically, it will look like this:

    Polyline
    line_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    line_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    END
    

    The example below represents a line feature class with two features. Feature zero contains two parts.

    Polyline
    0 0
    0 1.0 1.0 0.0 0.0
    1 2.0 2.0 0.0 0.0
    2 3.0 3.0 0.0 0.0
    0 1
    0 4.0 4.0 0.0 0.0
    1 5.0 5.0 0.0 0.0
    2 6.0 6.0 0.0 0.0
    1 0
    0 1.0 6.0 0.0 0.0
    1 2.0 5.0 0.0 0.0
    2 3.0 4.0 0.0 0.0
    END
    
  • Text files that represent polygons should be in the following format: The first line should contain the word Polygon to indicate the geometry type and the structure continues with the id number of the first line, followed by the part number (in case it is a multipart polygon). Point coordinates for the respective part and feature follow. In the case of an interior ring, the word InteriorRing (no space) is written before the group of coordinates. Polygons should be closed, that is, the first and last points should be the same. The final line should contain the word END. Generically, it will look like this:

    Polygon
    polygon_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    InteriorRing
    pnt_id x y z m
    pnt_id x y z m
    ...
    polygon_id part_number
    pnt_id x y z m
    pnt_id x y z m
    ...
    END
    

    In the example below, there are two polygons. Polygon zero has two parts. The second part has an interior ring. Polygon one is a normal polygon.

    Polygon
    0 0
    0 5.0 5.0 1.#QNAN 1.#QNAN
    1 5.0 6.0 1.#QNAN 1.#QNAN
    2 6.0 6.0 1.#QNAN 1.#QNAN
    3 6.0 5.0 1.#QNAN 1.#QNAN
    4 5.0 5.0 1.#QNAN 1.#QNAN
    0 1
    0 0.0 0.0 1.#QNAN 1.#QNAN
    1 0.0 4.0 1.#QNAN 1.#QNAN
    2 4.0 4.0 1.#QNAN 1.#QNAN
    3 4.0 0.0 1.#QNAN 1.#QNAN
    4 0.0 0.0 1.#QNAN 1.#QNAN
    InteriorRing
    0 1.0 1.0 1.#QNAN 1.#QNAN
    1 1.0 3.0 1.#QNAN 1.#QNAN
    2 3.0 3.0 1.#QNAN 1.#QNAN
    3 3.0 1.0 1.#QNAN 1.#QNAN
    4 1.0 1.0 1.#QNAN 1.#QNAN
    1 0
    0 5.0 3.0 1.#QNAN 1.#QNAN
    1 5.0 4.0 1.#QNAN 1.#QNAN
    2 6.0 4.0 1.#QNAN 1.#QNAN
    3 6.0 3.0 1.#QNAN 1.#QNAN
    4 5.0 3.0 1.#QNAN 1.#QNAN
    END
    
  • All the examples above will work. Pass them into a text file, save the text file, and use it as input to the tool.

Sintaxis

arcpy.samples.CreateFeaturesFromTextFile(input_text_file, input_decimal_separator, output_feature_class, {output_feature_class_spatial_reference})
ParámetroExplicaciónTipo de datos
input_text_file

A text file containing coordinates.

Text File
input_decimal_separator

The character that separates the whole number from the decimal. This may vary depending on the source of your data. If the coordinates take the form "1.5", your separator is a period.

String
output_feature_class

The output feature class.

Feature Class
output_feature_class_spatial_reference
(Opcional)

The spatial reference of the output coordinates.

Spatial Reference

Muestra de código

# Create geoprocessing dispatch object
import arcgisscripting
gp = arcgisscripting.create()
 
# Set up inputs to tool
inTxt = r"C:\temp\StreamPoints.txt"
inSep = "."
strms = r"C:\temp\Streams.shp"
 
# Run tool
gp.CreateFeaturesFromTextFile(inTxt, inSep, strms, "#")
 
# Use output from createfeatures tool as input to buffer
outFCbuf = r"C:\temp\StreamsBuf.shp"
gp.buffer(strms, "10 Unknown", "FULL", "ROUND", "NONE", "#")

Entornos

  • Dominio XY de salida
  • Sistema de coordenadas de salida

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog de Esri
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2021 Esri. | Privacidad | Legal