Skip to main content
Question

Delete jpeg files in folder outside a polygon

  • March 11, 2015
  • 2 replies
  • 13 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.
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • 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!