Skip to main content

 

Hi all

I have a simple IFC file which has just 8 IFCWalls and 2 IFCSpaces. When I run a simple query for retrieving all records for IFCSpace elements ( select * from "public"."IfcSpace"; ) , SQLExecutor duplicates all records. For instance, I have 2 records for IFCSpace but after running the query, I'll get 4 records. How can I avoid duplication? (I use PostGIS)

The SQLExecutor has 2 features as input, so he transformer runs two times. That's why you have double the results.

 

Add a Sampler before the SQLExecuttor to get just one feature.


Thank you @oscard for your response, but I reckon you meant adding sampler after SQLExecutor, am I right? Anyway, it worked! Thanks.


Thank you @oscard for your response, but I reckon you meant adding sampler after SQLExecutor, am I right? Anyway, it worked! Thanks.

It would work both ways, but adding the sampler before the SQLExecutor would mean less work for the database and less data to be processed by FME.


Thank you @oscard for your response, but I reckon you meant adding sampler after SQLExecutor, am I right? Anyway, it worked! Thanks.

Can you please explain how do you do that? I mean I don't have duplication before SQLExecutor so, it would be again 2 records after using Sampler and then result would be 4 records.


Can you please explain how do you do that? I mean I don't have duplication before SQLExecutor so, it would be again 2 records after using Sampler and then result would be 4 records.

Your SQL sentence in the SQLExecutor has zero dependency on attributes from the input (three is no where clause, for example); so the output is going to be always the same no matter the input.

 

 

You have 2 features that enter the SQLExecutor, so the SELECT sentence is executed twice. What you should do is filter the input to keep just one. That could be achieved using a Sampler (it is not a DuplicateRemover). To keep just the first feature:


Reply