Skip to main content
Solved

Compress multiple shapefiles with on writer

  • June 17, 2019
  • 2 replies
  • 165 views

billybob
Contributor
Forum|alt.badge.img+6

 

 

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.

Best answer by andreaatsafe

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

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

andreaatsafe
Safer
Forum|alt.badge.img+15
  • Safer
  • Best Answer
  • June 17, 2019

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


billybob
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • June 18, 2019

Andrea,

Thanks so much! That worked perfectly!

Best regards,

Frank