Skip to main content
Question

Create a list of filenames based on an attribute value, then assign list to new field

  • August 8, 2017
  • 1 reply
  • 11 views

Hello, I have a folder of photos with filenames that contain pointid's (e.g. 123456_photo1.jpg). Each point may have more than one photo associated with it. So there may be many photos containing the same point id in their name. I'd like to create a list of photos per point and assign the list to a field and write to geojson.

I tried using the tester and feature merger but I can't seem to get it to work.

I basically want for every point id, check if the filename contains the point id, add photo file name to list, then assign list to field called 'photos'.

Thanks!

1 reply

erik_jan
Contributor
Forum|alt.badge.img+17
  • Contributor
  • August 8, 2017

I would start by using the "Directory and File Path" reader.

That reader returns the file names (not the file contents).

Then use the AttributeSplitter (split on _) to get the point_id.

Then the Aggregator (on point_id), using a list to get all file names per point and if needed a ListConcatenator to create the comma separated list of photo's).

Or the Sorter to sort by point ID before outputting to whatever you want.


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