automate export and zipping features

138
1
03-15-2024 11:31 AM
Labels (1)
CraigHauer
New Contributor

Hi!

I deal with an agency that recently implemented a new data transfer system.  The new system requires a single feature/shape file be uploaded as a zip file.  we use geodatabases and typically have 30 to a couple hundred features in the feature class which will need to be split, exported, and zipped. 

Is there a way to have a model that will export individual features of a feature class to shapefiles and then zip the shapefile using a model with minimal/no code?

0 Kudos
1 Reply
BobBooth1
Esri Contributor

You can definitely automate the export part. 

In Model Builder, add your feature layer, add the Iterate Feature Selection (https://pro.arcgis.com/en/pro-app/latest/tool-reference/modelbuilder-toolbox/iterate-feature-selecti...) Iterator tool. Choose to group by Object ID (or whatever unique value). Connect the output features to Export Features tool. Export to a folder, specify a base shapefile name, insert "_%Value%" just before the shapefile .shp extension (this is called inline variable substitution).

export_feature_by_feature.png

Run the tool.

 You'll get something like this in your output folder.

sample_output.png

I don't see a Zip GP tool, but you could create a quick PY script and set it up as a script tool, then add that to the model.

0 Kudos