Skip to content

Commit

Permalink
Added Comments
Browse files Browse the repository at this point in the history
#151 - Sounds like the source file coords are reversed. just from looking at the output file from FE buddy. I would need the source file before I am comfortable writing code to fix this issue.

Additional comments to prepare for adding defaults to the geojson output.
  • Loading branch information
Nikolai558 committed Aug 11, 2023
1 parent 171ab12 commit e7ed203
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions FeBuddyLibrary/DataAccess/GeoJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,13 +1120,17 @@ public void WriteCombinedGeoMapGeoJson(string dirPath, GeoMapSet geo)
case "Symbol":
{
var featureToBeAdded = CreateSymbolFeature(element);
// Add defaults to feature if they exist

if (featureToBeAdded != null) { FileFeatures[elementFilePath].features.Add(featureToBeAdded); }
else { _errorLog.AppendLine($"{geoMap.Name} {geoMapObject.Description} SYMBOL {element.Lat} {element.Lon}: \n\t- Was not added to geojson because <SymbolDefaults> was not found for this map.\n\n\n"); }
break;
}
case "Text":
{
var featureToBeAdded = CreateTextFeature(element);
// Add defaults to feature if they exist

if (featureToBeAdded != null) { FileFeatures[elementFilePath].features.Add(featureToBeAdded); }
else { _errorLog.AppendLine($"{geoMap.Name} {geoMapObject.Description} TEXT {element.Lat} {element.Lon}: \n\t- Was not added to geojson because <TextDefaults> was not found for this map.\n\n\n"); }
break;
Expand Down Expand Up @@ -1376,6 +1380,9 @@ private List<Feature> CreateLineFeature(List<Element> elements)
}
else
{
// BUG #151: Possible fix for this issue, check the reverse. ex. End coords do not match Start coords of previous element.


// If start coords do NOT match end coords of previous element
if ((LatLonHelpers.CorrectIlleagleLon(element.StartLon).ToString() + " " + element.StartLat.ToString() != LatLonHelpers.CorrectIlleagleLon(prevElement.EndLon).ToString() + " " + prevElement.EndLat.ToString())
|| (LatLonHelpers.CorrectIlleagleLon(element.EndLon).ToString() + " " + element.EndLat.ToString() != LatLonHelpers.CorrectIlleagleLon(prevElement.StartLon).ToString() + " " + prevElement.StartLat.ToString()))
Expand Down

0 comments on commit e7ed203

Please sign in to comment.