Hello, Would anyone know if there is a way to use the Search Envelope by updating from a choice parameter? For example, I have these certain polygons that delimit the area I want to analyze:
Every time I want to analyze an area I have to change the values of the X,Y parameter (min and max):
To solve the problem, I created a choice that shows the area number on the Display but the values read are the bound coordinates.
And I created hidden parameters called Xmin, Xmax, Ymin, Ymax, These parameters look at this choice in the following way: @GetWord($(Choice),0)
But even if the combination is a number, FME does not accept using this value in the search envelope, as it tries to read the entire written parameter.
Below is the error log:
Invalid search envelope specified: GEOTIFF_1_SEARCH_ENVELOPE keyword must be followed by four numeric values (minX minY maxX maxY). Got '@GetWord(-42 -20 -40.5 -19 454,0) @GetWord(-42 -20 -40.5 -19 454,1) @GetWord(-42 -20 -40.5 -19 454,2) @GetWord(-42 -20 -40.5 -19 454,3)'
However, I understand that it does not accept this as input data, after all, even though it is a number, it is not a number-type parameter
To solve this problem, I tried another approach:
My data is in PostGis so I decided to read it through SQLCreator
But here I think it's not working because (I believe) there's a bug.
I wrote the expression:
FME_SQL_DELIMITER ;
-SELECT trecho_drenagem.* FROM bc250_base.hid_trecho_drenagem_l AS trecho_drenagem, (SELECT ST_MakeEnvelope(split_part($(Choice),' ',1), $(Ymin), $(Xmax), $(Ymax), 4674) AS geom) AS envelope WHERE ST_Intersects(trecho_drenagem.geom, envelope.geom);
But SQLCreator doesn't compute SQL functions over parameters,
for example:
split_part($(Choice),' ',1),
should result in just the first value, but it returns everything, even the native sql function, resulting in:
split_part($(3 -52.5 2 -51),' ',1),
Even simple functions, e.g.
We create the parameter A= 34 23 12 3
and we enter left($(A),2) the result will still be:
left(34 23 12 3,2)
when it should be just 32
even left is written at the end, not computing the functions and not calling the correct coordinate.
Can anyone tell me if I'm the one making a mistake? and where.
Or if this doesn't really work in FME when it comes to parameters?