Hello!
I have been tasked with taking a large number of shapefiles (over 10,000) that have no coordinate system and adding one so that they can be used in ArcMap and then convert them to polygons as they are currently polylines. I can write small python scripts but I have never taken on something of this magnitude before. Can anyone direct me to a place where I can find sample scripts to look at? I'll never learn if I just ask someone else to do it for me.
Thanks
Tara
Solved! Go to Solution.
Tara, you can also do this with ModelBuilder fairly easily. It's ideal for once-off tasks like this, even if you know Python. (In fact a little bit of Python skill makes Model Builder much more powerful!)
The approach I use is I build a model and test it for one dataset, once that is working, I add an iterator to the model and go home while it runs.
You could use either arcpy walk or os.walk to cycle through different workspaces. If all the shapefiles are in one workspace you could just set your environment workspace and iterate through a list of features. For each feature in the list define projection and then you could run feature to polygon .
Each link above has example codes if you scroll to the bottom of the page as well as proper syntax and parameter input types. Let us know if you need help setting up the basic code structure.
Tara, you can also do this with ModelBuilder fairly easily. It's ideal for once-off tasks like this, even if you know Python. (In fact a little bit of Python skill makes Model Builder much more powerful!)
The approach I use is I build a model and test it for one dataset, once that is working, I add an iterator to the model and go home while it runs.
I did end up using model builder. Just in case anyone else could use it I inserted an iterator for Feature Class and then used the Define Projection tool under Data Management Tools > Projections and Transformations > Define Projection.
Something like:
Idk... just an idea to explore.