Skip to main content
Question

Is there a performance trick to using the SharedItemSetter


virtualcitymatt
Celebrity
Forum|alt.badge.img+34

I have a workspace which takes point features and assigns them models essentially this workflow:

 

https://community.safe.com/s/article/creating-and-using-geometry-instances

 

But I'm finding that the performance is quite bad. Is there anything I need to be aware of when using this kind of workflow? The idea of using a geometry definition was supposed to speed things up - heh.

 

I know with raster datasets there is some little tricks that FME does in the background to speed things up by not reading bits until it needs to. Perhaps there are some transformers I should avoid?

6 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • January 14, 2022

Hi @virtualcitymatt​,

If you arrange the readers so that the model is read first, you can set the FeatureMerger to the Suppliers First mode, which should improve the performance merging the instance ids. Please also ensure that the output format supports shared models - if not, then the models will be instanced before writing, which can also take a lot of time. Also check that Enable Feature Caching is disabled.


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
daveatsafe wrote:

Hi @virtualcitymatt​,

If you arrange the readers so that the model is read first, you can set the FeatureMerger to the Suppliers First mode, which should improve the performance merging the instance ids. Please also ensure that the output format supports shared models - if not, then the models will be instanced before writing, which can also take a lot of time. Also check that Enable Feature Caching is disabled.

@daveatsafe​  - Great that these is perhaps some way to control this!

It does seem like the models are getting instanced before writing - I'm writing out to CityGML and before output I'm using an aggregator and a GeometryProperySetter. My guess is that one (or both) of these are causing the models to get instantiated. The aggregator is used to provide multiple LOD's to the same feature and the GeometryPropertySetter is providing a transformation matrix. I will experiment to see if there is a way I can work around these or figure out what is going on.

Do you know if the CityGML writer supports geometry definitions? I couldn't see anything in the doc about GeometryDefinitions being supported or not.


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • January 17, 2022

Hi @virtualcitymatt​,

The GeometryPropertySetter is most likely the culprit - try using the 3DAffiner instead to add a matrix.


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
daveatsafe wrote:

Hi @virtualcitymatt​,

The GeometryPropertySetter is most likely the culprit - try using the 3DAffiner instead to add a matrix.

After testing it is pretty clear that this is where performance it taking the hit. Great to see the 3DAffiner works well here as an alternative, however, I'm struggling to also set a citygml_lod_name on the feature without the GeometryProperySetter. 😤


virtualcitymatt
Celebrity
Forum|alt.badge.img+34
virtualcitymatt wrote:

After testing it is pretty clear that this is where performance it taking the hit. Great to see the 3DAffiner works well here as an alternative, however, I'm struggling to also set a citygml_lod_name on the feature without the GeometryProperySetter. 😤

Tried a lot of different things yesterday @daveatsafe​ but no luck. Geometries don't seem to be getting instanced when using the GeoemtryPropertySetter but it does seems to really slow things down. Seems I might need a more creative solution. But perhaps I'm just missing something.


virtualcitymatt
Celebrity
Forum|alt.badge.img+34

If anyone finds this - I found that using a PythonCaller to add the traits gave a huge boost to the performance over the GeometryPropertySetter. 
 

def input(self, feature: fmeobjects.FMEFeature):
    #get geom
    geom=feature.getGeometry()

    #set variables 
    lodName=feature.getAttribute('citygml_lod_name')
    matrix=feature.getAttribute('citygml_transformation_matrix')
    
    #apply traits
    geom.setTrait("citygml_lod_name",lodName) 
    geom.setTrait("citygml_transformation_matrix",matrix)
    
    #update geometry
    feature.setGeometry(geom)
    
    self.pyoutput(feature)

 


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