Question

Convert Point Layer with attributes to raster


Badge

I have a point layer with one attribute (categorial string data) that I like to convert to a raster dataset. There are about 20 different attribute values. Each point should become a raster cell. The value of the raster cell should be corresponding to the categorial attribute value of the point. Which transformer with what attribute values is needed for this operation?

Thanks for any help!


6 replies

Badge +22

Are your points evenly distributed?

 

Do you need a string palette, or is a classified numeric raster sufficient?
Userlevel 2
Badge +12

FME has multiple options for creating raster data from points.

Have a look at the NumericRasterizer, the ImageRasterizer and the MapnikRasterizer transformers.

The links are pointing to the documentation.

Badge

Are your points evenly distributed?

 

Do you need a string palette, or is a classified numeric raster sufficient?

Yes, the points are evenly distributed, every N meters in X and Y direction.

In the end, I need a string palette.

Badge +22

If you don't already have a corresponding number to category mapping, you need to set one up (ex class Water = 1). This can be done in a variety of ways, by joining a csv or other format, using an AttributeValueMapper . A quick and dirty dynamic way would be Aggregator (Group by category -> Counter->Deaggregator.

 

 

3DForcer to set the Z Value of the points to the numeric class

 

Numeric Rasterizer

 

 

To add a stringPalette you need to have an attribute containing the palette in the format:

 

STRING <string length>

 

<key> <value>

 

<key> <value>

 

 

This can be produced ahead of time if you already have a static mapping table, and then use an AttributeFileReader to add it as an attribute.

 

Otherwise it can be constructed in-situ from the original data.

 

 

Either way you then use a RasterPaletteAdder on the Raster
Badge

Great, thank you!

I use the 3DForcer with conditional values to add elevation data based on the category attribute of the points. Then the NumericRasterizer produces a raster with a given resolution and the AttributeFileReader reads the category names according to the z-values which are then added to the raster with RasterPaletteAdder.

 

Badge

If you don't already have a corresponding number to category mapping, you need to set one up (ex class Water = 1). This can be done in a variety of ways, by joining a csv or other format, using an AttributeValueMapper . A quick and dirty dynamic way would be Aggregator (Group by category -> Counter->Deaggregator.

 

 

3DForcer to set the Z Value of the points to the numeric class

 

Numeric Rasterizer

 

 

To add a stringPalette you need to have an attribute containing the palette in the format:

 

STRING <string length>

 

<key> <value>

 

<key> <value>

 

 

This can be produced ahead of time if you already have a static mapping table, and then use an AttributeFileReader to add it as an attribute.

 

Otherwise it can be constructed in-situ from the original data.

 

 

Either way you then use a RasterPaletteAdder on the Raster

Great, thank you!

I use the 3DForcer with conditional values to add elevation data based on the category attribute of the points. Then the NumericRasterizer produces a raster with a given resolution and the AttributeFileReader reads the category names according to the z-values which are then added to the raster with RasterPaletteAdder.

 

Reply