Criando Ferições a partir de um arquivo texto
-
Upload
gessivaldo-costa -
Category
Documents
-
view
216 -
download
0
Transcript of Criando Ferições a partir de um arquivo texto
-
7/28/2019 Criando Feries a partir de um arquivo texto
1/2
Create Features from Text File (Samples)
Creates features using coordinates in text files.
Usage tips
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, theoutput 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:Point0 1.0 1.0 3.0 1.4
1 2.0 2.0 1.0 3.22 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:
Multipointmultipoint_id 0
pnt_id x y z mpnt_id x y z m
...multipoint_id 0
pnt_id x y z m
...END
An example would be:Multipoint
0 01 23.0 12.0 5.0 1.0
2 34.0 32.0 4.0 1.03 11.0 54.0 5.0 1.01 0
1 11.0 9.0 1.0 1.02 5.0 5.5 1.0 1.0
3 9.8 3.2 1.0 1.0END
Text files that represent lines should be in the following format: The first line should contain the word Line 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:
polylineline_id part_number
pnt_id x y z mpnt_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.Line0 0
0 1.0 1.0 0.0 0.01 2.0 2.0 0.0 0.0
2 3.0 3.0 0.0 0.00 1
0 4.0 4.0 0.0 0.01 5.0 5.0 0.0 0.02 6.0 6.0 0.0 0.0
1 00 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.0END
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 mpnt_id x y z m
...InteriorRing
pnt_id x y z m
pnt_id x y z m...
polygon_id part_numberpnt_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
Pgina 1 de 2Create Features from Text File (Samples)
22/11/2012ms-its:C:\Program Files (x86)\ArcGIS\Help\data_management_samples_tools.chm::/create_features_fro...
-
7/28/2019 Criando Feries a partir de um arquivo texto
2/2
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.
The following environment settings affect this tool: Coordinate System, Output XY Domain
Command line syntax
An overview of the command line window
CreateFeaturesFromTextFile_samples {output_feature_class_spatial_reference}
Data types for geoprocessing tool parameters
Command line example
CreateFeaturesFromTextFile C:\temp\PolySample.txt . C:\temp\NewShp.shp #
Scripting syntax
An overview of scripting in geoprocessing
CreateFeaturesFromTextFile_samples (input_text_file, input_decimal_separator, output_feature_class, output_feature_class_spatial_reference)
Data types for geoprocessing tool parameters
Script example
# 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", "#")
Parameter Explanation Data type
A text file containing coordinates.
Text File
The character that separates the whole number from the decimal. This may vary depending onthe source of your data. If the coordinates take the form "1.5", your separator is a period.
String
The name of the new feature class to be created from the input coordinates.
Feature Class
{output_feature_class_spatial_reference}The spatial reference of the output coordinates.
Spatial Reference
Parameter Explanation Data type
input_text_file (Required)
A text file containing coordinates.
Text File
input_decimal_separator (Required)The character that separates the whole number from the decimal. This may vary dependingon the source of your data. If the coordinates take the form "1.5", your separator is a
period.
String
output_feature_class (Required)The name of the new feature class to be created from the input coordinates.
Feature Class
output_feature_class_spatial_reference(Optional)
The spatial reference of the output coordinates.Spatial Reference
Pgina 2 de 2Create Features from Text File (Samples)
22/11/2012ms-its:C:\Program Files (x86)\ArcGIS\Help\data management samples tools.chm::/create features fro...