Skip to main content
Question

Delete jpeg files in folder outside a polygon


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

david_r
Evangelist
  • March 11, 2015
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

  • Author
  • March 16, 2015
Thank you David!

Reply


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