Skip to main content
Solved

Compress multiple shapefiles with on writer


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

View original
Did this help you find an answer to your question?

2 replies

andreaatsafe
Safer
Forum|alt.badge.img+12
  • 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


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