Skip to content

Commit

Permalink
Merge pull request #96 from Nikolai558/development
Browse files Browse the repository at this point in the history
releasing v2.3.2
  • Loading branch information
Nikolai558 authored Aug 11, 2022
2 parents 6e44fae + dfc9c30 commit b99d4fd
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG

---
- ## Version 2.3.2
- #95: Elements inside a ASDEX VideoMap that are not a xsi:type of "Path" will not be included in the geojson output
(CRC will not render anything other than Polygon's / Paths inside of an ASDEX file)


- ## Version 2.3.1
- #92: Corrected ASDEX properties in the geojson output files
- #93: Default property settings are not included in "feature-level" properties
Expand Down
62 changes: 60 additions & 2 deletions FeBuddyLibrary/DataAccess/GeoJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void WriteVideoMapGeoJson(string dirPath, VideoMaps videoMaps, string vid
if (videoMapObject.ShortName.Contains(" ASDEX"))
{
// Create Asdex stuff.
allFeatures = CreateAsdexVideoMap(videoMapObject.Elements.Element, colors);
allFeatures = CreateAsdexVideoMap(videoMapObject.Elements.Element, colors, file.FullName);
}
else
{
Expand Down Expand Up @@ -212,11 +212,12 @@ public Dictionary<string, List<string>> ValidateAsdexProperties(VideoMaps videoM
return output;
}

private List<Feature> CreateAsdexVideoMap(List<vmElement> vmElements, Dictionary<string, string> colors)
private List<Feature> CreateAsdexVideoMap(List<vmElement> vmElements, Dictionary<string, string> colors, string fileName)
{
// TODO - Create GUI for unrecognized "colors"

List<Feature> allFeatures = new List<Feature>();
//List<vmElement> otherElementsNotPaths = new List<vmElement>();

// use color def to figure out asdex type.
// runway = [runway, rway, rwy]
Expand All @@ -228,6 +229,13 @@ private List<Feature> CreateAsdexVideoMap(List<vmElement> vmElements, Dictionary

foreach (var elementItem in vmElements)
{
if (elementItem.XsiType != "Path")
{
// Per Ross, Ignore XSI:Types inside an ASDEX File that does not = Path
//otherElementsNotPaths.Add(elementItem);
continue;
}

Feature currentFeature = new Feature()
{
properties = new Properties()
Expand Down Expand Up @@ -283,6 +291,56 @@ private List<Feature> CreateAsdexVideoMap(List<vmElement> vmElements, Dictionary
allFeatures.Add(currentFeature);
}


// ---------------------------------------------------------------------------------------------------------
// PER ROSS, Ignore elements that are not Path's for ASDEX VM
//
// If we decide to change our mind about this the following code would create a seperate geojson file
// next to the asdex in the output location. This is incomplete and would need work but it is started.
//
// ---------------------------------------------------------------------------------------------------------
//if (otherElementsNotPaths.Count() > 0)
//{
// FeatureCollection asdexOtherFeatureCollection = new FeatureCollection();
// var otherFeatures = new List<Feature>();

// foreach (vmElement vmItem in otherElementsNotPaths)
// {
// switch (vmItem.XsiType.ToLower())
// {
// case "label":
// {
// Feature feature = new Feature()
// {
// properties = new Properties()
// {
// text = new List<string>() { vmItem.Text}, Would need to create XML Attribute for .Text in the XmlGeoJsonVideoMapModel.cs File
// color = colors[vmItem.Color],
// },
// geometry = new Geometry()
// {
// type = "Point",
// coordinates = new List<dynamic>() { new List<double>() { vmItem.Lon, vmItem.Lat } } Would need to create XML Attribute for .Lat and .Lon in the XmlGeoJsonVideoMapModel.cs File
// }
// };
// otherFeatures.Add(feature);
// break;
// }
// case "line":
// {
// break;
// }
// default:
// break;
// }
// }

// asdexOtherFeatureCollection.features.AddRange(otherFeatures);
// string jsonString = JsonConvert.SerializeObject(asdexOtherFeatureCollection, new JsonSerializerSettings { Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore });
// string fullFilePath = fileName.Split('.')[0] + "-OtherFeatures.geojson";
// File.WriteAllText(fullFilePath, jsonString);
//}

return allFeatures;
}

Expand Down
2 changes: 1 addition & 1 deletion FeBuddyWinFormUI/FeBuddyWinFormUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFramework>net6.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<AssemblyName>FE-BUDDY</AssemblyName>
<Version>2.3.1</Version>
<Version>2.3.2</Version>
<Copyright>Copyright © 2022 Nikolas Boling, Kyle Sanders</Copyright>
<UseWindowsForms>true</UseWindowsForms>
<ApplicationIcon>FE_BUDDY_icon.ico</ApplicationIcon>
Expand Down

0 comments on commit b99d4fd

Please sign in to comment.