Skip to main content
Solved

RasterDEMGenerator not carrying feature attributes through to output


rclarkenz
Contributor
Forum|alt.badge.img+2

In my LAS reader I have selected fme_basename to be outputted as an attribute with the feature.

In the data inspector I can see it has correctly populated this attributed with the filename of my LAS.

The dropdown under DEMRaster in the ReasterDemGenerator shows that fme_basename is an attribute.

 

However when I look in the data inspector it doesn't contain my LAS filename but instead 'RasterDEMGenerator'

Is this correct? I was going to read multiple LAS files and output a DEM for each file, using the fme_basename as the filename for the DEM. Seeing it's not being carried through though I've had to create a user parameter and process one file at a time now.

Thanks in advance.

Best answer by takashi

As you have observed, some raster transformers such as RasterDEMGenerator, NumericeRasterizer etc. generate/overwrite "fme_basename" with the transformer name. It seems to be the correct behavior, though I don't know why Safe's developers designed like that.

A possible workaround is to expose "fme_feature_type" in the LAS reader, and set it to the Group By parameter in the RasterDEMGenerator. You can then set the value of "fme_feature_type" to "fme_basename" with the AttributeCreator or the AttributeManager, if necessary.

View original
Did this help you find an answer to your question?

6 replies

srg
Forum|alt.badge.img+10
  • January 14, 2019

@rclarkenz

for some reason the pictures in your post are not visible.

When reading a LAS file, the reader allows you to set the FeatureTypeName either from File Name(s): Generates one feature type per source filename or from Format Name: Produces only a single feature type containing the format name.

Check if you have set this to format name?

LAS Reader Parameters

hope that helps

happy fme-ing :-)

srg


takashi
Contributor
Forum|alt.badge.img+19
  • Contributor
  • Best Answer
  • January 14, 2019

As you have observed, some raster transformers such as RasterDEMGenerator, NumericeRasterizer etc. generate/overwrite "fme_basename" with the transformer name. It seems to be the correct behavior, though I don't know why Safe's developers designed like that.

A possible workaround is to expose "fme_feature_type" in the LAS reader, and set it to the Group By parameter in the RasterDEMGenerator. You can then set the value of "fme_feature_type" to "fme_basename" with the AttributeCreator or the AttributeManager, if necessary.


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • January 14, 2019

@rclarkenz

 

Use the Group By in the RasterDEMGenerator and set it to basename (or featuretypename.)

Use same GroupBy in the fanout of the DEM writer.

 

These attributes are often replaced by the transformer name ( dem generated could be from a single featuretype, more or none. )


rclarkenz
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • January 14, 2019
srg wrote:

@rclarkenz

for some reason the pictures in your post are not visible.

When reading a LAS file, the reader allows you to set the FeatureTypeName either from File Name(s): Generates one feature type per source filename or from Format Name: Produces only a single feature type containing the format name.

Check if you have set this to format name?

LAS Reader Parameters

hope that helps

happy fme-ing :-)

srg

Thanks for this.

Not sure why pics don't showed up. They are showing on my screen. Weird.

happy fme-ing to you too :o)


rclarkenz
Contributor
Forum|alt.badge.img+2
  • Author
  • Contributor
  • January 14, 2019
takashi wrote:

As you have observed, some raster transformers such as RasterDEMGenerator, NumericeRasterizer etc. generate/overwrite "fme_basename" with the transformer name. It seems to be the correct behavior, though I don't know why Safe's developers designed like that.

A possible workaround is to expose "fme_feature_type" in the LAS reader, and set it to the Group By parameter in the RasterDEMGenerator. You can then set the value of "fme_feature_type" to "fme_basename" with the AttributeCreator or the AttributeManager, if necessary.

This has worked :o)

I guess I had seen fme_basename retain the filename in the past so was expecting it to do so here too.

I've learnt something new now so thank you.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • January 21, 2019
takashi wrote:

As you have observed, some raster transformers such as RasterDEMGenerator, NumericeRasterizer etc. generate/overwrite "fme_basename" with the transformer name. It seems to be the correct behavior, though I don't know why Safe's developers designed like that.

A possible workaround is to expose "fme_feature_type" in the LAS reader, and set it to the Group By parameter in the RasterDEMGenerator. You can then set the value of "fme_feature_type" to "fme_basename" with the AttributeCreator or the AttributeManager, if necessary.

Hi @rclarkenz,

The output of the vector to raster transformers is extremely different from the input, with attributes only on the overall raster rather than the individual pixels, so we felt it was most accurate to discard any attributes that did not apply to the entire raster (ie. those chosen in the Group By).

The fme_basename attribute is a format attribute, and is often used to fan out the output data, so instead of being discarded, it is given the transformer name to signal that a vector to raster conversion has been applied to the data.

This is the reasoning behind the present behavior, but we are always happy to hear of ways that can be changed to improve our user's experience with FME.


Reply


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