public static bool MakeOutputProjFile(string sourceProjectionFilename, string destShapefilename)
{
try
{
string prjFileName = Path.Combine(
Path.GetDirectoryName(destShapefilename),
Path.GetFileNameWithoutExtension(destShapefilename)) + ".prj";
if (File.Exists(prjFileName))
{
_log.DebugFormat("The file already exists: {0}", prjFileName);
}
if (File.Exists(sourceProjectionFilename))
{
File.Copy(sourceProjectionFilename, prjFileName, true);
}
else
{
var wkt = Utilities.GetCoordinateSystemWKTByID(sourceProjectionFilename);
if (!string.IsNullOrEmpty(wkt))
{
File.WriteAllText(prjFileName, wkt);
}
}
}
catch (Exception ex)
{
_log.Error("There was an error trying to write a .prj file for your export.", ex);
}
return true;
}