Skip to main content
Question

Convert Point Layer with attributes to raster


Forum|alt.badge.img

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

jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 8, 2019

Are your points evenly distributed?

 

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

erik_jan
Contributor
Forum|alt.badge.img+18
  • Contributor
  • July 8, 2019

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.


Forum|alt.badge.img
  • Author
  • July 8, 2019
jdh wrote:

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.


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • July 8, 2019

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

Forum|alt.badge.img
  • Author
  • July 9, 2019

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.

 


Forum|alt.badge.img
  • Author
  • July 9, 2019
jdh wrote:

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.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings