Not insulting here! It's just that this is the ONLY thing that would work for me due to me needing to creating CUSTOM projection files. If I could have used out-of-the-box projections, then utilizing the WKID would have been ideal. But, you're right, it is a major pain!
I have it more "programmatic" than just a giant string of text, though. Each of the changing variables in that string (like units, projection, scale factor, etc.) is a variable that I created earlier in the script that programmatically accesses user input so then the string looks more like this:
- projString = ('PROJCS["' + str(PIN) + '_' + ProjName +
- '",GEOGCS[' + GeoCS +
- '],PROJECTION["' + ProjectionName +
- '"],PARAMETER["False_Easting",' + str(FalseEasting) +
- '],PARAMETER["False_Northing",' + str(FalseNorthing) +
- '],PARAMETER["Central_Meridian",' + str(CentralMeridian) +
- '],PARAMETER["Standard_Parallel_1",' + str(StandardParallel1) +
- '],PARAMETER["Standard_Parallel_2",' + str(StandardParallel2) +
- '],PARAMETER["Scale_Factor",' + str(ScaleFactor) +
- '],PARAMETER["Latitude_Of_Origin",' + str(LatOfOrigin) +
- '],UNIT["' + LinearUnit + '",' + str(MetersPerFoot) + ']]')
But, then again, this works for me and may not be the best choice for your dataset.