RasterPaletteAdder
Creates a palette from an attribute, and adds this palette to all selected bands on a raster.
典型的用途
- Adding palettes to rasters to meet format or processing requirements.
How does it work?
RasterPaletteadder接收栅格功能,并将调色板添加到所有选定的频段。
The palette must be provided as an attribute, and the band(s) must have an interpretation type ofUINT8那uint16, 或者UINT32.。
如果它们不符合所选频段的解释,则将丢弃调色板键。例如,在向UINT8频段添加调色板时,将丢弃大于255的所有键。
This transformer supports raster band selection. Therasterselectorcan be used to modify selection.
Palettes
Palettes can be acquired and assigned to an attribute in a number of ways, including:
- Create a palette in a text file, and use anattributefilereader.要加载它并将其分配给属性
- 使用一个字符串在工作区中创建一个调色板,使用AttributeCreator或者AttributeManager
- Extract a palette from a different raster using aRasterPaletteExtractor
- Extract a palette from a different band on the same raster usingrasterselectorA.RasterPaletteExtractor
调色板属性的格式
调色板属性的一般格式如下:
格式 |
RGB Example |
字符串示例 |
---|---|---|
<值解释> [<字符串长度>] |
RGB24 |
字符串10. |
调色板的第一行必须包含价值解释。值解释的有效值是:
- RGB24
- RGBA32
- RGB48
- RGBA64
- Gray8.
- 灰色16.
- 细绳
RGBA并由comma-delim RGB面板值ited strings of integers between 0 and the maximum value of the data type. For example, a valid RGBA32 value would be64,128,255,255那A.valid RGB48 value would be16384,32768,65535。
当指定了字符串解释时,第一行可以可选地指定调色板值的最大字符串长度。此值必须是正整数。如果未明确指定字符串长度,则将假设默认值为32。
细绳palette values may consist of any arbitrary text, except for the newline character.
灰色调色板值由0个整数和数据类型的最大值之间组成。
第一个是键值对之后的所有线条。调色板键必须按升序组织,但它们不需要是连续的 - 也就是说,并非必须存在系列中的所有数字。所有缺陷的调色板键最多关注0或等效值,例如RGB的0,0,0或字符串调色板的空字符串。
Examples
在此示例中,我们将将调色板添加到单频带数字栅格中。原始栅格有一个值,带有0到8的值,0是0不data Value。请注意,乐队的解释类型是INT8,它没有调色板。
To add the palette, three steps are required:
- 将频段解释更改为与调色板兼容的类型。
- 读取调色板文本文件,并将其分配给属性。
- Add the palette to the raster.
The raster is first routed into aRasterBandInterpretationCoercer。In the parameters dialog,目的地解释类型被设定为UInt8,它与调色板兼容,接受0到255之间的值。
使用文本编辑器准备了调色板。
下一步是读取调色板文件并将其分配给属性,使用attributefilereader.。在参数对话框中,Destination Attribute将存储文件的内容,并被命名_file_contents.。
The final step is the RasterPaletteAdder. In the parameters dialog,Palette Attribute被设定为_file_contents.那which will retrieve the palette from that attribute and apply it to the raster.
The output raster feature has one band, interpretation type UINT8, and the palette is attached and rendered by the FME Data Inspector.
Usage Notes
- 要从栅格中的现有单元值生成调色板,请使用Rasterpalettegenerator。
选择光栅变压器
FME has an extensive selection of transformers for working with raster data. They can be generally categorized as working with whole rasters, bands, cells or palettes, and those designed for workflow control or combining raster with vector data.
有关光栅几何和属性的信息,请参阅罗斯克斯(IFMERaster)。
Working with Rasters
RasterCellOriginSetter | 将单元格源点设置在栅格中的单元格中。 |
RasterConvolver. | Applies a convolution filter (sometimes called a核心或者lens)栅格功能并输出结果。 |
rasterexpressionEvaluator. | 评估栅格或一对栅格中的每个单元格的表达式,包括代数操作和条件陈述。 |
RasterExtentsCoercer | Replaces the geometry of input raster features with a polygon covering either the extents of a raster or the extent of data within a raster. |
RasterGCPExtractor | 提取物地面控制点(GCP) coordinate system and point values from a raster feature and exposes them as attributes. |
Rastergcpsetter. | 套地面控制点s(GCPs) on a raster, pairing cell positions with known coordinates. |
RastergeoreFerencer. | 通过已知的角落坐标或起源,单元格尺寸和旋转来绕地理栅格。 |
Rasterhillsshader. | Generates a grayscale shaded relief representation of terrain, based on elevation values. |
RasterInterpretationCoercer | Alters the interpretation type of rasters, including all bands, and converts cell values if necessary. |
rastermosaicker. | 将多个栅格功能合并到单个栅格功能中。 |
RasterPropertyExtractor | 提取物the geometry properties of a raster feature and exposes them as attributes. |
Rasterpyramider. | 基于最小输出光栅的任一数量或尺寸,将栅格重新列出到多个分辨率。 |
RasterRegisterer | 转换图像以最小化其与另一个的差异。 |
RasterResampler. | Resamples rasters, based on specified output dimensions, cell size in ground units, or percentage of original, and interpolates new cell values. |
RasterRotationApplier | 根据其旋转角度旋转栅格功能,内插新的单元格值,更新所有受影响的栅格属性,并使用旋转角度产生输出栅格功能。 |
rastersharpener. | Enhances the features of a raster image. The RasterSharpener enhances the borders, lines, and curves while reducing noise in the flat areas of the raster image. |
rastersubsetter. | Clips raster features using pixel bounds instead of ground coordinates, and optionally adds cells around the perimeter. |
rastertiler. | Splits each input raster into a series of tiles by specifying either a tile size in cells/pixels or the number of tiles. |
RasterToPolygonCoercer | Creates polygons from input raster features. One polygon is output for each contiguous area of pixels with the same value in the input raster. |
WebMaptiler. | Creates a series of image tiles that can be utilized by web mapping applications such as Bing™ Maps, Google Maps™, or Web Map Tile Service. This is done by resampling rasters to various different resolutions and then splitting them into tiles. |
Working with Bands
RasterBandadder. | 添加一个新的乐队raster feature. |
RasterBandCombiner | 将巧合栅格功能合并到单个输出栅格功能,保留和附加所有频段。 |
RasterBandInterpretationCoercer | 改变单个光栅带的解释类型,如有必要,转换单元值。 |
Rasterbandeepter | Removes all unselected bands from a raster feature. |
RasterBandMinMaxExtractor | 提取物the minimum and maximum band values, palette keys, and palette values from a raster feature, and adds them to a list attribute. |
Rasterbandnamesetter. | 将所选频段的频带名称设置在栅格上,与频带数字相比,使栅格内容更加简单地理解。 |
RasterBandNodataRemover | Removes the existing nodata identifier from selected bands of a raster feature. Any values previously equal to the nodata value are considered valid data. |
RasterBandNodataseTter. | 套a new nodata value on selected bands of a raster feature. |
RasterBandorder | 指定栅格中的频带所需顺序。频带根据输入带索引重新排序。 |
RasterBandPropertyExtractor. | 提取物the band and palette properties of a raster feature and exposes them as attributes. |
RasterBandRemover | Removes any selected bands from a raster feature. |
漂流带带子 | 将频带或唯一频带和调色板组合分开,并输出单个栅格功能或包含所有组合的单个新栅格功能。 |
RasterStatisticsCalculator | 计算栅格频段的统计信息,并将结果添加为属性。 |
使用细胞
RasterAspectCalculator | Calculates the aspect (direction of slope) for each cell of a raster. Aspect is measured in degrees from 0 to 360, clockwise from north. |
RasterCellCoercer. | 为栅格中的每个单元格创建各个点或多边形,可选地将频带值提取为z坐标或属性。 |
RasterCellvaluecalculator. | 在一对栅格的单元格值上评估基本算术,最小值或平均操作。 |
RasterCellValueReplacer | Replaces a range of band values in a raster with a new single value. |
RasterCellValueRounder | 舍入光栅单元值。 |
罗斯特司人 | Partitions a raster image into arbitrarily sized groups of cells from the input image based on intensity differences in the input raster image cells. |
RasterSingularCellValueCalculator | Performs basic arithmetic operations on the cell values of a raster against a numeric value. |
rasterslopecalculator. | 计算栅格的每个单元格的斜率(z的最大变化率)。 |
Working with Palettes
RasterPaletteAdder | Creates a palette from an attribute, and adds this palette to all selected bands on a raster. |
RasterPaletteExtractor | 在栅格上创建现有调色板的字符串表示,并将其保存到属性。 |
Rasterpalettegenerator | Generates a palette out of the selected band(s) of a raster. The output raster will have the selected band(s) replaced by a new band with a palette. |
RasterpaletteInterpretationCoercer. | 改变光栅调色板的解释类型。 |
RasterPaletteNodataSetter | 标识与栅格乐队的Nodata值匹配的调色板键,并设置一个值。 |
RasterPaletteRemover | 从栅格功能中删除选定的调色板。 |
Rasterpaletteresolver | Resolves the palette(s) on a raster by replacing cell values with their corresponding palette values. Palette values with multiple components, such as RGB, are broken down and the individual values assigned to multiple, newly-added bands. |
Workflow Control
RastercheckPointer. | Forces accumulated raster operations to be processed, saving the state to disk and releasing resources to tune performance or assist with memory limitations. |
RasterConsumer. | Reads raster features for testing purposes, including any accumulated raster operations. No additional operations are performed, and nothing is done with the features. |
RasterExtractor | 将栅格功能的几何图中序列化为Blob属性,根据常用二进制栅格格式的选择编码内容。 |
RasternumericCreator. | Creates a numeric raster of specified size and resolution, with default cell values. |
RasterReplacer. | 解码包含存储为Blobs的编码栅格的二进制属性,用解码栅格替换要素的几何图形。 |
RasterRGBCreator | Creates a color raster feature of specified size, resolution, and interpretation type, with default cell values. |
rasterselector | Selects specific bands and palettes of a raster for subsequent transformer operations. |
Vectors and Rasters
ImageRasterizer. | 使用纯背景填充的FME_COLOR属性填充矢量功能,创建矢量或点云输入功能的光栅表示。可以使用颜色或强度分量呈现点云。 |
NumericRasterizer | 创建矢量或点云输入特征的数字栅格表示,其中从输入特征的z坐标中取出单元值并覆盖在均匀的背景上。 |
Mapnikerasterizer. | Generates a raster from input vector and raster features, with fine control over symbolization and labeling, using the Mapnik toolkit. |
PointCloudonRasterComponentsEtter. | 通过覆盖光栅上的点云来设置点云组件值。每个点的组件值从点位置处的频带值内插。 |
PointOnRasterValueExtractor | 从一个或多个输入点的位置处从栅格中提取频带和调色板值,并将其设置为特征上的属性。 |
RasterDEMGenerator | 通过统一采样从输入点和断裂线产生的Delaunay三角测量来产生光栅数字高度模型(DEM)。 |
vectoronrasteroverlayer. | 将矢量或点云功能光栅化到现有的光栅上。对于向量特征,FME_Color属性设置像素颜色,可以使用它们的颜色或强度分量呈现点云。 |
配置
输入端口
此变形器仅接受栅格功能。接收调色板的频段必须具有UINT8,UINT16或UINT32的解释类型。
输出Ports
带有提供给所有选定频段的调色板的栅格功能。
非栅格功能将被路由到<拒绝>端口以及无效的栅格。
拒绝功能将具有FME_Reempe_code属性,其中一个值之一:
Invalid_geometry_type.
INVALID_RASTER_BANDS
Invalid_feature_missing_attributes.
INVALID_RASTER_PALETTE
Rejected Feature Handling:can be set to either terminate the translation or continue running when it encounters a rejected feature. This setting is available both as a defaultFME选项A.s aworkspace parameter。
参数
Palette Attribute | 将读取调色板的属性。 |
Editing Transformer Parameters
使用一组菜单选项,可以通过引用工作区中的其他元素来分配变压器参数。一些变压器也可提供更高级的功能,例如高级编辑器和算术编辑器。要访问这些选项的菜单,请单击除适用的参数旁边。有关更多信息,请参阅Transformer Parameter Menu Options。
定义值
There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.
Using the Text Editor
文本编辑器提供了一种方便的方法来构建来自各种数据源的文本字符串(包括正则表达式),例如属性,参数和常量,其中结果直接在参数内使用。
使用算术编辑器
The Arithmetic Editor provides a convenient way to construct math expressions from various data sources, such as attributes, parameters, and feature functions, where the result is used directly inside a parameter.
条件值
Set values depending on one or more test conditions that either pass or fail.
Parameter Condition Definition Dialog
内容
Expressions and strings can include a number of functions, characters, parameters, and more.
When setting values - whether entered directly in a parameter or constructed using one of the editors - strings and expressions containing String, Math, Date/Time or FME Feature Functions will have those functions evaluated. Therefore, the names of these functions (in the form @<function_name>)不应用作文字字符串值。
这些功能操纵和格式化字符串。 | |
特殊的角色 |
A set of control characters is available in the Text Editor. |
两个编辑器都有数学函数。 | |
Date/Time Functions | Date and time functions are available in the Text Editor. |
These operators are available in the Arithmetic Editor. | |
这些主要是特定于特征的值。 | |
FME and workspace-specific parameters may be used. | |
创建和修改用户参数 | 创建自己的可编辑参数。 |
对话框选项 - 表格
Transformers with table-style parameters have additional tools for populating and manipulating values.
Row Reordering |
Enabled once you have clicked on a row item. Choices include:
|
剪裁,复制和粘贴 |
Enabled once you have clicked on a row item. Choices include:
切割,复制和粘贴可以在变压器或变压器之间使用。 |
Filter |
Start typing a string, and the matrix will only display rows matching those characters. Searches all columns. This only affects the display of attributes within the transformer - it does not alter which attributes are output. |
Import |
Import populates the table with a set of new attributes read from a dataset. Specific application varies between transformers. |
重置/刷新 |
通常将表重置为其初始状态,并且可以提供其他选项以删除无效条目。行为在变压器之间变化。 |
笔记:并非所有变压器都提供所有工具。
Reference
Processing Behavior |
|
功能持有 |
不 |
依赖关系 | 没有 |
FME Licensing Level | FME专业版及以上 |
别名 | |
历史 |
FME Community
The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.
搜索all results about the RasterPaletteAdder关于FME社区。亚搏国际在线官网
Examples may contain information licensed under the Open Government Licence – Vancouver and/or the Open Government Licence – Canada.