Skip to content

Commit

Permalink
issue #45: Finishing touches on site densities
Browse files Browse the repository at this point in the history
  • Loading branch information
lbross committed Nov 22, 2023
1 parent 6c15b96 commit 639dd68
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions bagis-pro/AnalysisTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5664,12 +5664,6 @@ await QueuedTask.Run(() =>
private static async Task<double> CalculateBufferedSiteAreaSqM(Aoi oAoi, string strBufferDistance)
{
double dblSiteArea = -1;
if (string.IsNullOrEmpty(strBufferDistance))
{
string strDistance = (string)Module1.Current.BatchToolSettings.SnotelBufferDistance;
string strUnits = (string)Module1.Current.BatchToolSettings.SnotelBufferUnits;
strBufferDistance = $@"{strDistance} {strUnits}";
}
string aoiFcPath = $@"{GeodatabaseTools.GetGeodatabasePath(oAoi.FilePath, GeodatabaseNames.Aoi, true)}{Constants.FILE_AOI_VECTOR}";
string outputGdb = GeodatabaseTools.GetGeodatabasePath(oAoi.FilePath, GeodatabaseNames.Analysis);
string strTempBuffer = "tmpSitesBuffer";
Expand Down Expand Up @@ -6404,8 +6398,15 @@ await CalculateZonalAreaPercentages(oAoi.FilePath, elevZonesPath, Constants.FIEL
lngScosSitesCount = lngScosSitesCount + lngCount;
}
double dblAutoSitesAreaSqMi = -1;
string strDistance = (string)Module1.Current.BatchToolSettings.SnotelBufferDistance;
string strUnits = (string)Module1.Current.BatchToolSettings.SnotelBufferUnits;
string strDefaultSitesBuffer = $@"{strDistance} {strUnits}";
if (lngAutoSitesCount > 0)
{
if (string.IsNullOrEmpty(strAutoSitesBuffer))
{
strAutoSitesBuffer = strDefaultSitesBuffer;
}
double dblAutoSitesArea = await CalculateBufferedSiteAreaSqM(oAoi, strAutoSitesBuffer);
if (dblAutoSitesArea > 0)
{
Expand All @@ -6425,6 +6426,10 @@ await CalculateZonalAreaPercentages(oAoi.FilePath, elevZonesPath, Constants.FIEL
double dblScosSitesAreaSqMi = -1;
if (lngScosSitesCount > 0)
{
if (string.IsNullOrEmpty(strScosSitesBuffer))
{
strScosSitesBuffer = strDefaultSitesBuffer;
}
if (strAutoSitesBuffer.Equals(strScosSitesBuffer))
{
if (dblAutoSitesAreaSqMi > 0)
Expand Down

0 comments on commit 639dd68

Please sign in to comment.