I have created a model that converts .gpx's to shapefiles and changes the projection. Each shapefile has the same output as the .gpx's input. Instead of deleting the original shapefile and renaming the projected file, my model is deleting the very last shapefile it creates. All other files in the folder are converted, projected and renamed correctly though. How can I fix this issue?
1 Answer
Without knowing the content/function of the Calculate Value
tools and how you use their outputs in your model, I suggest two solutions:
Direct solution: As long as one instance of your model runs at a time (not having the risk of overwriting interim output unintentionally or write access conflicts), you can change the value of GPX to Feature
to something like "interim.shp" and change the value of the output of Project
tool to %Name%.shp
. Therefore the model will delete interim.shp for each iteration and you do not need to worry about renaming at the end, which I think is the problematic part.
Alternative solution: Assuming you are going to use the same output coordinate system for your outputs, you can change the "Output Coordinate System" value of Environments setting of your model (Model>Model Properties>Environments tab) to what you want to use ("As specified below" option). This will enforce conversion by using default transformation, if defined any by default. This will save you from dealing with Project and Rename bits.