Skip to main content
Question

FeatureReader - Read all SHP within ZIP file (Subfolder)


galigis
Enthusiast
Forum|alt.badge.img+20

Hi All,

I’m having a bit of headache to read all the SHP included within a ZIP through the FeatureReader transformer, I’m getting the following error Shapefile and cannot be read for some reason. I can reader it with the normal SHP reader but can’t get it to work on FeatureReader, here is a screenshot of the settings:

 

What am I doing wrong?

 

4 replies

galigis
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • May 10, 2024

 I have been able to read the folders within the ZIP file but now the second FeatureReader fails because can’t find the temp files? Why is it going to temp files? screenshot below:

 


jkr_wrk
Influencer
Forum|alt.badge.img+29
  • May 10, 2024

Reading directly from a ZIP file means FME extracts the data from the ZIP file to a temporary folder to be able to read the contents.

It could be that the temp file extraction is removed after the first reader is read into cache. Have you tried reading the contents of the zip without featureCaching?


galigis
Enthusiast
Forum|alt.badge.img+20
  • Author
  • Enthusiast
  • May 13, 2024

Thanks @jkr_wrk I think I was able to achieve what I wanted by adding the expression [**\*.shp] in the dataset and modifying the published parameters to files. The expression allows to search through the ZIP file and find the extension .shp. 

Below a screenshot for completeness: 

 


hkingsbury
Celebrity
Forum|alt.badge.img+56
  • Celebrity
  • May 13, 2024

@galigis Thats the correct approach. FME treats ZIP files as folders, so the path to open a shp in a zip will always need to end with *.shp but can include a *.zip as a parent


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