Skip to main content

Hi!

I am fairly new to FME. I am trying to develop a tool which creates a bounding box around features in the database. I've managed to create the bounding box as well as all my features into a .CSV file. What I want to do is make the writer use the coordinates found by the bounding box when saving the file name for each file. I have tried using @Value(<attr name>) however this just tells me my schema isn't set. I have also tried using a fan out feature on the writer, doing this allows me to save the file with the coordinates, however this then just leaves me with a blank file whereas I need a table with all the features and their added bits with it. Any help or advice on where to look would be appreciated!

If I read you correctly you want a CSV file per feature with the coordinates of the bounding box as the filename.

You can do this as follows:

  1. Use a BoundsExtractor your features box. This will store the min and max x and y coordinates in a set of attributes (_xmin, _ymin, _xmax and _ymax by default, you can change those names if you want to)
  2. Set up the CSV File name in the output feature type properties to be a concatenation of those attrbitues.

Keep in mind though that this will generate really unwieldy filenames.


@redgeographics thanks for the reply, I apologise for the unclear question it was written on a very tired Friday morning! I want one file with all the features inside the bounding box in the file with the filename set as the X&Y; Max & Min values. I have tried using @Value(_xmin) etc. however when I run this it returns

"Features With No Schema defined

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

371

342240 1

==============================================================================

Total Features NOT Written 372"


Hi Phil (@phil_peters)

I've created an example workspace that I think does what you need. It's for FME 2016 and you can find it (as a template with data) here: https://www.dropbox.com/s/s7y4nyq7s2kia0j/CSVBoundsFilename.fmwt?dl=0

Hope this helps

Mark

 


Hi Phil (@phil_peters)

I've created an example workspace that I think does what you need. It's for FME 2016 and you can find it (as a template with data) here: https://www.dropbox.com/s/s7y4nyq7s2kia0j/CSVBoundsFilename.fmwt?dl=0

Hope this helps

Mark

 

Hi Mark, thanks for this. I am however using FME 2014 so am unable to see most of the transformers.

Thanks though!


I guess that you have set Dynamic properties to the writer feature type. If so, there could be a wrong setting in the options (e.g. schema definition name).

The user interface for dynamic properties setting has been changed drastically in FME 2015.1, I forgot the interface of FME 2014. If you post some screenshots illustrating your settings for the feature type properties and dynamic properties options, it might help us to find what is wrong.


Hi Mark, thanks for this. I am however using FME 2014 so am unable to see most of the transformers.

Thanks though!

OK, try this: https://www.dropbox.com/s/761ikonn97len9y/CSVBoundsFilename2014.fmwt?dl=0


Brilliant thanks so much Mark, I now have this working after some tweeking getting it into my project!


Reply