Skip to content

Commit

Permalink
#159 - Filters = "" issue
Browse files Browse the repository at this point in the history
I am going to recant my previous statement and will not be placing the filter value based on BCG values.

The reasoning behind this is there might be quite a few facilities where the BCG value is not supose to match the filter value. Also, in vERAM things that do not have a filter at all are not displayed (same thing happens in CRC). If I were to automatically place the bcg into the filter in the geojson, these facilities would have a bunch of things populate on screen that were never there before.

I personally don't know of a valid reason to set filters="" but I do know that some facilities do it.

Therefore, FEB will create the defaults in geojson with filters = [] and a message will be placed in the log so that users can quickly find what default filters dont have any filters in it. Then they can choose weather or not they want to add filters manually in the geojson. This result should be the same in CRC as it is in vERAM. (i.e. no filters = no display)
  • Loading branch information
Nikolai558 committed Sep 12, 2023
1 parent 9dc0dbf commit 51dfa9d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions FeBuddyLibrary/DataAccess/GeoJson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ public void WriteGeoMapGeoJson(string dirPath, GeoMapSet geo)

if (AllLinesDefaults.properties.filters.Count() == 0 && AllLinesDefaults.properties.bcg != null)
{
AllLinesDefaults.properties.filters = new int[] { (int)AllLinesDefaults.properties.bcg };
geoMapObjectLog.AppendLine($"\t\t\t WARNING: Line Defaults are missing fillters. If the features in this file do NOT have overriding filter properties, the object will NOT be displayed in CRC.");
}

foreach (Element element in geoMapObject.Elements.Element)
Expand Down Expand Up @@ -1363,7 +1363,7 @@ public void WriteGeoMapGeoJson(string dirPath, GeoMapSet geo)

if (defaultFeature.properties.filters.Count() == 0 && defaultFeature.properties.bcg != null)
{
defaultFeature.properties.filters = new int[] { (int)defaultFeature.properties.bcg };
geoMapObjectLog.AppendLine($"\t\t\t WARNING: Symbol Defaults are missing fillters. If the features in this file do NOT have overriding filter properties, the object will NOT be displayed in CRC.");
}

geojson.features.Add(defaultFeature);
Expand Down Expand Up @@ -1403,7 +1403,7 @@ public void WriteGeoMapGeoJson(string dirPath, GeoMapSet geo)

if (defaultFeature.properties.filters.Count() == 0 && defaultFeature.properties.bcg != null)
{
defaultFeature.properties.filters = new int[] { (int)defaultFeature.properties.bcg };
geoMapObjectLog.AppendLine($"\t\t\t WARNING: Text Defaults are missing fillters. If the features in this file do NOT have overriding filter properties, the object will NOT be displayed in CRC.");
}

geojson.features.Add(defaultFeature);
Expand Down

0 comments on commit 51dfa9d

Please sign in to comment.