GeoEco.DataManagement.ArcGISRasters.ArcGISRaster.ToLinesTable
- classmethod ArcGISRaster.ToLinesTable(table, inputRasterField, outputFeatureClassField, backgroundValue='ZERO', minDangleLength=0.0, simplify=True, field=None, projectedCoordinateSystem=None, geographicTransformation=None, resamplingTechnique=None, projectedCellSize=None, registrationPoint=None, clippingDataset=None, clippingRectangle=None, mapAlgebraExpression=None, where=None, orderBy=None, skipExisting=False, overwriteExisting=False, basePath=None)
Converts the ArcGIS rasters listed in a table to lines that outline groups of adjacent raster cells having the same value.
Requires: ArcGIS Pro 3.2.0 or later or ArcGIS Server equivalent to ArcGIS Pro 3.2.0 or later.
- Parameters:
table (
Table) – Table to query.inputRasterField (
str) –Field containing the rasters to convert.
The rasters will be converted to line feature classes using the ArcGIS
RastertoPolyline()tool. For each pair of adjacent foreground raster cells, the tool draws a line connecting their centers. This algorithm is appropriate for converting line-like raster features, such as sea surface temperature fronts or other boundary data, into vector features. Minimum length꞉ 1.outputFeatureClassField (
str) – Field containing the output line feature classes. One feature class will be created per raster. Missing directories the output paths will be created if they do not exist. Minimum length꞉ 1.backgroundValue (
str, optional) –Specifies the cell value that will identify the background cells. The raster dataset is viewed as a set of foreground cells and background cells. The linear features are formed from the foreground cells.
ZERO- The background is composed of cells of zero or less or NoData. All cells with a value greater than zero are considered a foreground value.NODATA- The background is composed of NoData cells. All cells with valid values belong to the foreground.
Allowed values꞉
'ZERO','NODATA'.minDangleLength (
float, optional) – Minimum length of dangling lines that will be retained. The default is zero. Minimum value꞉ 0.0.simplify (
bool, optional) – If True (the default) the output lines will be smoothed according to an undocumented algorithm implemented by the ArcGISRastertoPolyline()tool.field (
str, optional) – The field used to assign values from the cells in the input raster to the lines in the output dataset. It can be an integer or a string field. Minimum length꞉ 1. Must exist.projectedCoordinateSystem (
str, optional) – New coordinate system to project the raster to. The raster may only be projected to a new coordinate system if the original projection is defined. An error will be raised if you specify a new coordinate system without defining the original coordinate system. The ArcGISProjectRaster()tool is used to perform the projection. The documentation for that tool recommends that you also specify a cell size for the new coordinate system. Minimum length꞉ 1.geographicTransformation (
str, optional) –A transformation method used to convert between the original coordinate system and the new coordinate system.
This parameter is only needed when you specify that the raster should be projected to a new coordinate system and that new system uses a different datum than the original coordinate system, or there is some other difference between the two coordinate systems that requires a transformation. To determine if a transformation is needed:
First, run this tool without specifying a new coordinate system, to obtain the raster in the original coordinate system.
Next, use the ArcGIS
ProjectRaster()tool on the raster to project it to the desired coordinate system. If a geographic transformation is needed, that tool will prompt you for one. Write down the exact name of the transformation you used.Finally, if a transformation was needed, type in the exact name into this tool, rerun it, and verify that the raster was projected as you desired.
Minimum length꞉ 1.
resamplingTechnique (
str, optional) –The resampling algorithm to be used to project the original raster to a new coordinate system. The ArcGIS
ProjectRaster()tool is used to perform the projection and accepts the following values:NEAREST- Nearest neighbor assignment.BILINEAR- Bilinear interpolation.CUBIC- Cubic convolution, also known as bicubic interpolation.
You must specify one of these algorithms to project to a new coordinate system. An error will be raised if you specify a new coordinate system without selecting an algorithm.
Allowed values꞉
'NEAREST','BILINEAR','CUBIC'. Case sensitive.projectedCellSize (
float, optional) – The cell size of the projected coordinate system. Although this parameter is optional, to receive the best results, the ArcGIS documentation recommends you always specify it when projecting to a new coordinate system.registrationPoint (
str, optional) – The x and y coordinates (in the projected coordinate system) used for cell alignment. This parameter is ignored if you do not specify that the raster should be projected to a new coordinate system. Minimum length꞉ 1. Must match regular expression꞉([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?).clippingDataset (
str, optional) – Existing feature class, raster, or other geographic dataset having the extent to which the raster should be clipped. Minimum length꞉ 1. Must exist.clippingRectangle (
str, optional) –Rectangle to which the raster should be clipped. This should only be given if the clipping dataset parameter is omitted.
If a projected coordinate system was specified, the clipping is performed after the projection and the rectangle’s coordinates should be specified in the projected coordinate system. If no projected coordinate system was specified, the coordinates should be specified in the original coordinate system.
The ArcGIS
Clip()tool is used to perform the clip. The clipping rectangle must be passed to this tool as a string of four numbers separated by spaces. The ArcGIS user interface automatically formats the string properly; when invoking this tool from the ArcGIS UI, you need not worry about the format. But when invoking it programmatically, take care to provide a properly-formatted string. The numbers are ordered LEFT, BOTTOM, RIGHT, TOP. For example, if the raster is in a geographic coordinate system, it may be clipped to 10 W, 15 S, 20 E, and 25 N with the string'10 15 20 25'. Integers or decimal numbers may be provided.Minimum length꞉ 1. Must match regular expression꞉
([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)\s+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?).mapAlgebraExpression (
str, optional) – Map algebra expression to execute on the raster. The expression is executed after the converted raster is projected and clipped (if those options are specified). UseinputRasterto represent the raster that you now want to perform map algebra upon. For example, to convert the raster to an integer raster and add 1 to all of the cells, use the expressionInt(inputRaster) + 1. Minimum length꞉ 1. Maximum length꞉ 4000. Requires: ArcGIS ‘spatial’ extension.where (
str, optional) –SQL WHERE clause expression that specifies the rows to include. If not provided, all of the rows will be included. If provided but the underlying storage format does not support WHERE clauses, an exception will be raised.
The exact syntax of this expression depends on the underlying storage format. If the underlying data store will be accessed through ArcGIS, this article may document some of the possible syntax, but not all of it may be supported through ArcGIS’s underlying Python API.
Minimum length꞉ 1.
orderBy (
str, optional) –SQL ORDER BY clause that specifies the order in which the rows should be accessed. If not provided, the rows will accessed according to the default behavior of the underlying storage format and the programming library used to access it.
The ORDER BY clause must be a comma-separated list of fields. Each field can optionally be followed by a space and the word
ASCto indicate ascending order orDESCto indicate descending order. If neither is specified,ASCis assumed.The underlying storage format and library perform the actual evaluation of this parameter and determine the rules of sorting, such as whether string comparisons are case-sensitive or case-insensitive. At present, there is no mechanism to interrogate or manipulate these rules; you must live with the default behavior of the underlying format and library.
Minimum length꞉ 1. Must match regular expression꞉
\s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*(,\s*\S+(\s+([aA][sS][cC]|[dD][eE][sS][cC]))?\s*)*.skipExisting (
bool, optional) – If True, conversion will be skipped for feature classes that already exist.overwriteExisting (
bool, optional) – If True and skipExisting is False, existing feature classes will be overwritten.basePath (
str, optional) –Base path to prepend to relative paths.
If any of the input paths (or output paths, if this method has outputs) obtained from the table are relative paths, they will be converted to absolute paths prior to processing, as follows:
If a base path is provided, it will be prepended to the relative path.
Otherwise, if the ArcGIS geoprocessor has been initialized and the geoprocessing workspace has been set (i.e. the Workspace property of the geoprocessor is not empty), it will be prepended to the relative path.
Otherwise, the current working directory for the executing process will be prepended to the path. If you have not explicitly changed the working directory, it is usually the directory that contains the Python interpreter (e.g., on Windows computers, it would be C:\Python24, if yo’re running Python 2.4).
Minimum length꞉ 1.