Skip to main content

 

 

I have an AttributeFilter that creates multiple Esri shapfiles (filter by an attribute value) that use one esri shapefile writer to write out each shapefile. Is there a way to compress (zip) each of these shapefiles individually? I know there a shapefile compression option to create a .shz, but a .zip file is required.

Hi @billybob,

To write to a zip file you'll simply need to change the extension that you are writing to in your writer.

You'll want to set up a Fanout Dataset on the writer and set the extension to be a .zip extensions. To accomplish this:

 

 

In the Navigator, on the shapefile writer:

  1. Expand the writer parameters
  2. Double click on the Fanout Dataset parameter
  3. Enable the Fanout Dataset Parameter
  4. Click on the Fanout Expression ellipsis or drop down to open the Text Editor
  5. Set the Fanout Expression to @Value(shapefile_name).zip so the zipped folder is named the same as the file it contains then click OK.
  6. Run the workspace

 

Where your output directory would then have a number of zipped shape files:

If you would like to learn more about different types of fanouts, you can read this article here.

 

Hope this information is helpful!

- Andrea


Andrea,

Thanks so much! That worked perfectly!

Best regards,

Frank


Reply