Question

Delete jpeg files in folder outside a polygon

  • 11 March 2015
  • 2 replies
  • 4 views

Hi,

 

 

I have a folder with jpeg images and a txt with latitude and longitude for each image name.

 

I would like to delete all files in the folder, that are located outside a polygon.

 

Can somebody help me getting started? (e.g. How to delete files in a folder, ...)

 

 

Best,

 

J.

2 replies

Userlevel 4
Hi,

 

 

you could use a SpatialFilter to isolate the jpegs that are outside your polygon. Then send them to a PythonCaller for deletion:

 

 

import os

 

import fmeobjects

 

def FeatureProcessor(feature):

 

    os.remove(feature.getAttribute('fme_dataset'))

 

 

David
Thank you David!

Reply