com.esri.arcgis.geoprocessing.tools.datamanagementtools
Class CreateRandomPoints
java.lang.Object
com.esri.arcgis.geoprocessing.AbstractGPTool
com.esri.arcgis.geoprocessing.tools.datamanagementtools.CreateRandomPoints
- All Implemented Interfaces:
- GPTool
public class CreateRandomPoints
- extends AbstractGPTool
Creates a specified number of random point features. Random points can be generated in an extent window, inside polygon features, on point features, or along line features.
The Create Random Points tool is contained in the Data Management Tools tool box.
Usage tips:
- The area in which random points will be generated can be defined either by constraining polygon, point, or line features or by a constraining extent window.
- The Number of Points parameter can be specified as a number or as a numeric field in the Constraining Feature Class containing values for how many random points to place within each feature. The field option is only valid for polygon or line constraining features. If the number of points is supplied as a number, each feature in the constraining feature class will have that number of random points generated inside or along it.
- To assign random values to randomly placed points, first generate random points using the this tool. Second, use the tool to create a new numeric field in the random points feature class. Suggested field types are long integer or float. Third, use the tool to assign random values to the empty field in the random points feature class. To generate a random integer between a and b (inclusive), use the Python expression random.randint(a,b). To generate a random float number between a and b (exclusive), use the Python expression random.uniform(a,b). Do not forget to set Expression Type to PYTHON, replace the a and b values, and import the random module in the Code Block section using the expression import random.
- The Constraining Extent parameter can be entered as a set of minimum and maximum x- and y-coordinates or as equal to the extent of a feature layer or feature class.
- If values for both Constraining Feature Class and Constraining Extent are specified, the Constraining Feature Class value will be used and the Constraining Extent value will be ignored.
- In the tool dialog box, the Constraining Extent values can be reset using the Clear button.
- When unable to place any more random points within a constraining area without breaking the minimum allowed distance specification, the number of random points in the constraining area will be reduced to the maximum possible under the minimum allowed distance.
- The Minimum Allowed Distance parameter can be specified as a linear unit or a field from the constraining features containing numeric values. This value will determine the minimum allowed distance between random points within each input feature. The field option is only valid for polygon or line constraining features. Random points may be within the minimum allowed distance if they were generated inside or along different constraining features.
- Using point features as the constraining feature class creates a random subset of the constraining point features. No new point locations are generated.
- Noninteger (whole) positive values for the Number of Points and Minimum Allowed Distance parameters will be rounded to the nearest whole number. Nonnumeric and negative values are set to 0.
Constructor Summary |
CreateRandomPoints()
Creates the Create Random Points tool with defaults. |
CreateRandomPoints(java.lang.Object outPath,
java.lang.String outName)
Creates the Create Random Points tool with the required parameters. |
Method Summary |
java.lang.Object |
getConstrainingExtent()
Returns the Constraining Extent parameter of this tool . |
java.lang.Object |
getConstrainingFeatureClass()
Returns the Constraining Feature Class parameter of this tool . |
java.lang.String |
getCreateMultipointOutput()
Returns the Create Multipoint Output parameter of this tool . |
java.lang.Object |
getMinimumAllowedDistance()
Returns the Minimum Allowed Distance [value or field] parameter of this tool . |
int |
getMultipointSize()
Returns the Maximum Number of Points per Multipoint parameter of this tool . |
java.lang.Object |
getNumberOfPointsOrField()
Returns the Number of Points [value or field] parameter of this tool . |
java.lang.Object |
getOutFeatureClass()
Returns the Output Feature Class parameter of this tool (Read only). |
java.lang.String |
getOutName()
Returns the Output Point Feature Class parameter of this tool . |
java.lang.Object |
getOutPath()
Returns the Output Location 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 |
setConstrainingExtent(java.lang.Object constrainingExtent)
Sets the Constraining Extent parameter of this tool . |
void |
setConstrainingFeatureClass(java.lang.Object constrainingFeatureClass)
Sets the Constraining Feature Class parameter of this tool . |
void |
setCreateMultipointOutput(java.lang.String createMultipointOutput)
Sets the Create Multipoint Output parameter of this tool . |
void |
setMinimumAllowedDistance(java.lang.Object minimumAllowedDistance)
Sets the Minimum Allowed Distance [value or field] parameter of this tool . |
void |
setMultipointSize(int multipointSize)
Sets the Maximum Number of Points per Multipoint parameter of this tool . |
void |
setNumberOfPointsOrField(java.lang.Object numberOfPointsOrField)
Sets the Number of Points [value or field] parameter of this tool . |
void |
setOutName(java.lang.String outName)
Sets the Output Point Feature Class parameter of this tool . |
void |
setOutPath(java.lang.Object outPath)
Sets the Output Location parameter of this tool . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CreateRandomPoints
public CreateRandomPoints()
- Creates the Create Random Points tool with defaults.
Initializes the array of tool parameters with the default values specified when the tool was created.
CreateRandomPoints
public CreateRandomPoints(java.lang.Object outPath,
java.lang.String outName)
- Creates the Create Random Points 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:
outPath
- the location or workspace in which the random points feature class will be created. This location or workspace must already exist.outName
- the name of the random points feature class to be created.
getOutPath
public java.lang.Object getOutPath()
- Returns the Output Location parameter of this tool .
This parameter is the location or workspace in which the random points feature class will be created. This location or workspace must already exist.
This is a required parameter.
- Returns:
- the Output Location
setOutPath
public void setOutPath(java.lang.Object outPath)
- Sets the Output Location parameter of this tool .
This parameter is the location or workspace in which the random points feature class will be created. This location or workspace must already exist.
This is a required parameter.
- Parameters:
outPath
- the location or workspace in which the random points feature class will be created. This location or workspace must already exist.
getOutName
public java.lang.String getOutName()
- Returns the Output Point Feature Class parameter of this tool .
This parameter is the name of the random points feature class to be created.
This is a required parameter.
- Returns:
- the Output Point Feature Class
setOutName
public void setOutName(java.lang.String outName)
- Sets the Output Point Feature Class parameter of this tool .
This parameter is the name of the random points feature class to be created.
This is a required parameter.
- Parameters:
outName
- the name of the random points feature class to be created.
getConstrainingFeatureClass
public java.lang.Object getConstrainingFeatureClass()
- Returns the Constraining Feature Class parameter of this tool .
This parameter is random points will be generated inside or along the features in this feature class. The constraining feature class can be geometry type point, multipoint, line, or polygon. Points will randomly be placed inside polygon features, along line features, or at point feature locations.
This is an optional parameter.
- Returns:
- the Constraining Feature Class
setConstrainingFeatureClass
public void setConstrainingFeatureClass(java.lang.Object constrainingFeatureClass)
- Sets the Constraining Feature Class parameter of this tool .
This parameter is random points will be generated inside or along the features in this feature class. The constraining feature class can be geometry type point, multipoint, line, or polygon. Points will randomly be placed inside polygon features, along line features, or at point feature locations.
This is an optional parameter.
- Parameters:
constrainingFeatureClass
- random points will be generated inside or along the features in this feature class. The constraining feature class can be geometry type point, multipoint, line, or polygon. Points will randomly be placed inside polygon features, along line features, or at point feature locations.
getConstrainingExtent
public java.lang.Object getConstrainingExtent()
- Returns the Constraining Extent parameter of this tool .
This parameter is random points will be generated inside the extent. The constraining extent will only be used if no constraining feature class is specified.
This is an optional parameter.
- Returns:
- the Constraining Extent
setConstrainingExtent
public void setConstrainingExtent(java.lang.Object constrainingExtent)
- Sets the Constraining Extent parameter of this tool .
This parameter is random points will be generated inside the extent. The constraining extent will only be used if no constraining feature class is specified.
This is an optional parameter.
- Parameters:
constrainingExtent
- random points will be generated inside the extent. The constraining extent will only be used if no constraining feature class is specified.
getNumberOfPointsOrField
public java.lang.Object getNumberOfPointsOrField()
- Returns the Number of Points [value or field] parameter of this tool .
This parameter is the number of points to be randomly generated. the number of points can be specified as a long integer number or as a field from the constraining features containing numeric values for how many random points to place within each feature. The field option is only valid for polygon or line constraining features. If the number of points is supplied as a long integer number, each feature in the constraining feature class will have that number of random points generated inside or along it.
This is an optional parameter.
- Returns:
- the Number of Points [value or field]
setNumberOfPointsOrField
public void setNumberOfPointsOrField(java.lang.Object numberOfPointsOrField)
- Sets the Number of Points [value or field] parameter of this tool .
This parameter is the number of points to be randomly generated. the number of points can be specified as a long integer number or as a field from the constraining features containing numeric values for how many random points to place within each feature. The field option is only valid for polygon or line constraining features. If the number of points is supplied as a long integer number, each feature in the constraining feature class will have that number of random points generated inside or along it.
This is an optional parameter.
- Parameters:
numberOfPointsOrField
- the number of points to be randomly generated. the number of points can be specified as a long integer number or as a field from the constraining features containing numeric values for how many random points to place within each feature. The field option is only valid for polygon or line constraining features. If the number of points is supplied as a long integer number, each feature in the constraining feature class will have that number of random points generated inside or along it.
getMinimumAllowedDistance
public java.lang.Object getMinimumAllowedDistance()
- Returns the Minimum Allowed Distance [value or field] parameter of this tool .
This parameter is the shortest distance allowed between any two randomly placed points. If a value of "1 Meter" is specified, all random points will be farther than 1 meter away from the closest point.
This is an optional parameter.
- Returns:
- the Minimum Allowed Distance [value or field]
setMinimumAllowedDistance
public void setMinimumAllowedDistance(java.lang.Object minimumAllowedDistance)
- Sets the Minimum Allowed Distance [value or field] parameter of this tool .
This parameter is the shortest distance allowed between any two randomly placed points. If a value of "1 Meter" is specified, all random points will be farther than 1 meter away from the closest point.
This is an optional parameter.
- Parameters:
minimumAllowedDistance
- the shortest distance allowed between any two randomly placed points. If a value of "1 Meter" is specified, all random points will be farther than 1 meter away from the closest point.
getCreateMultipointOutput
public java.lang.String getCreateMultipointOutput()
- Returns the Create Multipoint Output parameter of this tool .
This parameter is determines if the output feature class will be a multipart or single part feature.
This is an optional parameter.
- Returns:
- the Create Multipoint Output
setCreateMultipointOutput
public void setCreateMultipointOutput(java.lang.String createMultipointOutput)
- Sets the Create Multipoint Output parameter of this tool .
This parameter is determines if the output feature class will be a multipart or single part feature.
This is an optional parameter.
- Parameters:
createMultipointOutput
- determines if the output feature class will be a multipart or single part feature.
getMultipointSize
public int getMultipointSize()
- Returns the Maximum Number of Points per Multipoint parameter of this tool .
This parameter is if the Create Multipoint Output option is used (checked/MULTIPOINT), this parameter specifies the number of random points to be placed in each multipoint geometry.
This is an optional parameter.
- Returns:
- the Maximum Number of Points per Multipoint
setMultipointSize
public void setMultipointSize(int multipointSize)
- Sets the Maximum Number of Points per Multipoint parameter of this tool .
This parameter is if the Create Multipoint Output option is used (checked/MULTIPOINT), this parameter specifies the number of random points to be placed in each multipoint geometry.
This is an optional parameter.
- Parameters:
multipointSize
- if the Create Multipoint Output option is used (checked/MULTIPOINT), this parameter specifies the number of random points to be placed in each multipoint geometry.
getOutFeatureClass
public java.lang.Object getOutFeatureClass()
- Returns the Output Feature Class parameter of this tool (Read only).
This is an derived parameter.
- Returns:
- the Output Feature Class
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