com.esri.arcgis.geoprocessing.tools.samples
Class CreateFeaturesFromTextFile
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.samples.CreateFeaturesFromTextFile
- All Implemented Interfaces:
- GPTool
public class CreateFeaturesFromTextFile
- extends AbstractGPTool
Creates features using coordinates in text files.
The Create Features From Text File tool is contained in the Samples tool box.
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, 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:An example would be:
- 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:An example would be:
- 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:The example below represents a line feature class with two features. Feature zero contains two parts.
- 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: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.
- All the examples above will work. Pass them into a text file, save the text file, and use it as input to the tool.
Constructor Summary |
CreateFeaturesFromTextFile()
Creates the Create Features From Text File tool with defaults. |
CreateFeaturesFromTextFile(java.lang.Object inputTextFile,
java.lang.String inputDecimalSeparator,
java.lang.Object outputFeatureClass)
Creates the Create Features From Text File tool with the required parameters. |
Method Summary |
java.lang.String |
getInputDecimalSeparator()
Returns the Input Decimal Separator parameter of this tool . |
java.lang.Object |
getInputTextFile()
Returns the Input Text File parameter of this tool . |
java.lang.Object |
getOutputFeatureClass()
Returns the Output Feature Class parameter of this tool . |
java.lang.Object |
getOutputFeatureClassSpatialReference()
Returns the Output Feature Class Spatial Reference parameter of this tool . |
java.lang.String |
getToolboxAlias()
Returns the alias of the tool box containing this tool. |
java.lang.String |
getToolboxName()
Returns the name of the tool box containing this tool. |
java.lang.String |
getToolName()
Returns the name of this tool. |
void |
setInputDecimalSeparator(java.lang.String inputDecimalSeparator)
Sets the Input Decimal Separator parameter of this tool . |
void |
setInputTextFile(java.lang.Object inputTextFile)
Sets the Input Text File parameter of this tool . |
void |
setOutputFeatureClass(java.lang.Object outputFeatureClass)
Sets the Output Feature Class parameter of this tool . |
void |
setOutputFeatureClassSpatialReference(java.lang.Object outputFeatureClassSpatialReference)
Sets the Output Feature Class Spatial Reference parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CreateFeaturesFromTextFile
public CreateFeaturesFromTextFile()
- Creates the Create Features From Text File tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
CreateFeaturesFromTextFile
public CreateFeaturesFromTextFile(java.lang.Object inputTextFile,
java.lang.String inputDecimalSeparator,
java.lang.Object outputFeatureClass)
- Creates the Create Features From Text File tool with the required parameters.
Initializes the array of tool parameters with the values as specified for the required parameters and with the default values for the other parameters.
- Parameters:
inputTextFile
- nullinputDecimalSeparator
- nulloutputFeatureClass
- null
getInputTextFile
public java.lang.Object getInputTextFile()
- Returns the Input Text File parameter of this tool .
This is a required parameter.
- Returns:
- the Input Text File
setInputTextFile
public void setInputTextFile(java.lang.Object inputTextFile)
- Sets the Input Text File parameter of this tool .
This is a required parameter.
- Parameters:
inputTextFile
- null
getInputDecimalSeparator
public java.lang.String getInputDecimalSeparator()
- Returns the Input Decimal Separator parameter of this tool .
This is a required parameter.
- Returns:
- the Input Decimal Separator
setInputDecimalSeparator
public void setInputDecimalSeparator(java.lang.String inputDecimalSeparator)
- Sets the Input Decimal Separator parameter of this tool .
This is a required parameter.
- Parameters:
inputDecimalSeparator
- null
getOutputFeatureClass
public java.lang.Object getOutputFeatureClass()
- Returns the Output Feature Class parameter of this tool .
This is a required parameter.
- Returns:
- the Output Feature Class
setOutputFeatureClass
public void setOutputFeatureClass(java.lang.Object outputFeatureClass)
- Sets the Output Feature Class parameter of this tool .
This is a required parameter.
- Parameters:
outputFeatureClass
- null
getOutputFeatureClassSpatialReference
public java.lang.Object getOutputFeatureClassSpatialReference()
- Returns the Output Feature Class Spatial Reference parameter of this tool .
This is an optional parameter.
- Returns:
- the Output Feature Class Spatial Reference
setOutputFeatureClassSpatialReference
public void setOutputFeatureClassSpatialReference(java.lang.Object outputFeatureClassSpatialReference)
- Sets the Output Feature Class Spatial Reference parameter of this tool .
This is an optional parameter.
- Parameters:
outputFeatureClassSpatialReference
- null
getToolName
public java.lang.String getToolName()
- Returns the name of this tool.
- Returns:
- the tool name
getToolboxName
public java.lang.String getToolboxName()
- Returns the name of the tool box containing this tool.
- Returns:
- the tool box name
getToolboxAlias
public java.lang.String getToolboxAlias()
- Returns the alias of the tool box containing this tool.
- Returns:
- the tool box alias