0

I have the following code which displays a Layer in my Leaflet map from some remote GeoJSON:

// Create Layer: Airspace
var featuresUTMAirspace= L.geoJson(dataGuardianUTM, {
    filter: FuncAirspace,
    style: setStyle,
    pointToLayer: function (feature, latlng) {
        if (feature.properties.category === "airport") {
            // Add a Radius around an Airport
            return L.circle(latlng, { radius: feature.properties.radius })
        } else {
            // Not an Airport
            return L.marker(latlng, { icon: L.icon({ radius: 3000, iconUrl: feature.properties.iconUrl, iconSize: [25, 25], }),
            })
        }
    },
});

The code calls a function FuncAirspace to determine which elements of the GeoJSON I want to include in the layer.

The FuncAirspace contains a series of and/or operators:

function FuncAirspace(feature) {
    if (
        (feature.properties.category === "airspace" || feature.properties.category === "airport")
        && feature.properties.detailedCategory !== "uk:frz"
        && feature.properties.detailedCategory !== "type:tra"
        && feature.properties.airspaceType !== "CTA"
        && feature.properties.airspaceType !== "TMA"
        ) return true
}

I wish to also now exclude any GeoJSON elements which contain a feature.properties.altitudeFloor.feet element value of 400 or higher.

(Note there is an extra depth to the elments at this point)

Sample GeoJSON:

{
  "isCompleteData": false,
  "excludedData": [
    {
      "message": "Request must include a bounding rectangle under 20,000,000 square meters.",
      "detail": {
    "name": "Ground Hazards"
      },
      "errorReason": "QueryAreaTooLarge"
    }
  ],
  "countriesInViewport": [],
  "nationalFlightRestrictions": [],
  "features": [
    {
      "geometry": {
    "coordinates": [
      1.216666660012834,
      48.448388329265612
    ],
    "type": "Point"
      },
      "id": "6B848FEF857903BE09D9F26B7F9DA34855935AAA",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#FF0055",
    "strokeColor": "#0025fc",
    "fillOpacity": "0.35",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "class:tfr",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_tfr.png",
    "operationalTo": "2019-11-06T23:59:00Z",
    "altitudeFloor": {
      "datum": "Sps",
      "meters": 3810.0,
      "feet": 12500.0
    },
    "altitudeCeiling": {
      "datum": "Sps",
      "meters": 6553.2000000000007,
      "feet": 21500.0
    },
    "name": "Temporary restricted area",
    "radius": "500040",
    "listOrderHint": "200",
    "category": "airspace",
    "notamId": "LFFA/R0757/19",
    "filters": [
      {
        "name": "Upper Airspace",
        "property": "show",
        "active": false
      },
      {
        "name": "Temporary Flight Restriction",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "Airspace",
      "detailedCategory": "Temporary Flight Restriction",
      "title": "Temporary restricted area",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Altitude",
          "text": "This piece of airspace is in effect above FL125"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": " Temporary Flight Restriction",
          "text": "This is an official 'No Fly Zone' (a Temporary Flight Restriction) and it applies according to the following criteria, in the region indicated by the boundary shown."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Active Now",
          "text": "Active: 00:00 hours on 28 March until 23:59 hours on 6 November 2019 (UTC)"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Full NOTAM Text",
          "text": "Q) LFXX/QRTCA/IV/BO/W/125/215/4824N00113E270\r\n\r\nA) LFRR;LFBB;LFEE;LFFF B) FROM: 19/03/28 00:00 C) TO: 19/11/06 23:59\r\n\r\nE) FLIGHTS OF STATE - AIP SUP 082/19 :\nSUBJECT : CREATION OF 89 TEMPORARY RESTRICTED AND 2 TEMPORARY DANGER \nAREAS.\nTHESE AREAS WILL BE ACTIVATED BY NOTAM.\nTHIS AIP SUP IS AVBL ON WWW.SIA.AVIATION-CIVILE.GOUV.FR.\r\n\r\nLOWER: FL125\r\n\r\nUPPER: FL215"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "NOTAM Id",
          "text": "LFFA/R0757/19"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -5.833333,
          51.016666
        ],
        [
          -5.8,
          51.0
        ],
        [
          -5.683333,
          50.733333
        ],

        [
          -5.833333,
          51.016666
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "C465FE5DED67441C78C71257173A4990392E3C90",
      "properties": {
    "hazardFactor": "20",
    "hazardFactorName": "Information",
    "fillColor": "#0025fc",
    "strokeColor": "#0025fc",
    "fillOpacity": "0.35",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "class:nav_warning",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_nav_warning.png",
    "operationalFrom": "2019-08-20T11:00:00Z",
    "operationalTo": "2019-08-22T16:00:00Z",
    "altitudeFloor": {
      "datum": "Sps",
      "meters": 3048.0,
      "feet": 10000.0
    },
    "altitudeCeiling": {
      "datum": "Sps",
      "meters": 10668.0,
      "feet": 35000.0
    },
    "name": "MULTIPLE FAST JET ACFT WILL OPR FIGHTER CT...",
    "listOrderHint": "800",
    "category": "airspace",
    "notamId": "EGGN/H5117/19",
    "filters": [
      {
        "name": "Upper Airspace",
        "property": "show",
        "active": false
      },
      {
        "name": "Navigation Warning",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "Airspace",
      "detailedCategory": "Navigation Warning",
      "title": "MULTIPLE FAST JET ACFT WILL OPR FIGHTER CT...",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Altitude",
          "text": "This piece of airspace is in effect above FL100"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Navigation Warning",
          "text": "This is a temporary Navigation Warning, it indicates a possible hazard to aerial traffic in the region indicated."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Active in 4 days, 22 hours",
          "text": "Active: 11:00 hours on 20 August until 16:00 hours on 22 August 2019 (UTC)"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Activation Details",
          "text": "Status: 11:00 hours on 20 August until 16:00 hours on 22 August 2019 (UTC)"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Full NOTAM Text",
          "text": "Q) EGTT/QWELW/IV/BO/W/100/350/5100N00433W049\r\n\r\nA) EGTT B) FROM: 19/08/20 11:00 C) TO: 19/08/22 16:00\r\n\r\nE) MULTIPLE FAST JET ACFT WILL OPR FIGHTER CTL TRAINING \nNON-SEGREGATED\nWI 4 AREAS BOUNDED BY:\nAREA 1: 510118N 0043133W - 510100N 0055000W - 512100N 0054100W -\n514000N 0051900W - 514700N 0045800W - 514600N 0043200W -\n510118N 0043133W. \nAREA 2: 510118N 0043133W - 502300N 0043200W - 502000N 0051100W -\n504400N 0054100W - 510000N 0054800W - 510100N 0055000W - \n510118N 0043133W.\nAREA 3: 510118N 0043133W - 514600N 0043200W - 513600N 0034300W -\n510100N 0033700W - 510118N 0043133W.\nAREA 4: 510118N 0043133W - 510100N 0033700W - 502700N 0034300W -\n502300N 0043200W - 510118N 0043133W.  FOR INFO 01935 456196.\n2019-08-0508/OPS2.\r\n\r\nLOWER: FL100\r\n\r\nUPPER: FL350\r\n\r\nSCHEDULE: 1100-1600"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "NOTAM Id",
          "text": "EGGN/H5117/19"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Blue zones are advanced notice of areas that will shortly become either red or yellow, while yellow regions with a blue border are notice of a current flight."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -8.0,
          48.83333
        ],
        [
          -3.16111,
          49.8025
        ],
        [
          -3.6275,
          50.3825
        ],
        [
          -8.0,
          51.0
        ],
        [
          -8.0,
          48.83333
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "CF2CD80AE8D4504350B276FCE30A2F879A82B94B",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#ffffff",
    "strokeColor": "#ffffff",
    "fillOpacity": "0.2",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:tra",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_tra.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Sps",
      "meters": 5943.5999909657285,
      "feet": 19499.99997036
    },
    "altitudeCeiling": {
      "datum": "Sps",
      "meters": 7467.5999886492482,
      "feet": 24499.99996276
    },
    "name": "TRA 001",
    "listOrderHint": "1000",
    "category": "airspace",
    "designator": "EGTRA001",
    "airspaceType": "TRA",
    "filters": [
      {
        "name": "Upper Airspace",
        "property": "show",
        "active": false
      },
      {
        "name": "Type TRA",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Type TRA",
      "title": "TRA 001",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Altitude",
          "text": "This piece of airspace is in effect above FL194.9999997036"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Temporary reserved area",
          "text": "Airspace of pre-defined dimensions within which activities require the reservation of airspace during a predetermined period of time."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Regulated Airspace",
          "text": "This airspace has a specific classification which applies to manned aviation, and may have implications on operations depending on local laws and regulations governing use.\r\n\r\nRegulations governing the flight of vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your. Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -6.12222,
          52.01361
        ],
        [
          -6.07528,
          51.87611
        ],
        [
          -5.0525,
          51.91111
        ],
        [
          -3.40889,
          51.66278
        ],
        [
          -6.12222,
          52.01361
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "A14EE2043362B87B982CF4B11AA15B4F0205B14A",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#ffffff",
    "strokeColor": "#ffffff",
    "fillOpacity": "0.2",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:cta",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_cta.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Sps",
      "meters": 5943.5999909657285,
      "feet": 19499.99997036
    },
    "altitudeCeiling": {
      "datum": "Sps",
      "meters": 7467.5999886492482,
      "feet": 24499.99996276
    },
    "name": "WEST CTA",
    "listOrderHint": "1000",
    "category": "airspace",
    "designator": "EGWT",
    "airspaceType": "CTA",
    "filters": [
      {
        "name": "Upper Airspace",
        "property": "show",
        "active": false
      },
      {
        "name": "Type CTA",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Type CTA",
      "title": "WEST CTA",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Altitude",
          "text": "This piece of airspace is in effect above FL194.9999997036"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Control area",
          "text": "A controlled airspace extending upwards from a specified limit above the earth."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Regulated Airspace",
          "text": "This airspace has a specific classification which applies to manned aviation, and may have implications on  operations depending on local laws and regulations governing  use.\r\n\r\nRegulations governing the flight of s vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your . Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -4.09944,
          50.62972
        ],
        [
          -4.07889,
          50.59722
        ],
        [
          -4.02667,
          50.62389
        ],
        [
          -4.01694,
          50.62472
        ],
        [
          -4.06139,
          50.67194
        ],
        [
          -4.09944,
          50.62972
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "F85DA14E77583024D1B43C56626AF15F1473B13C",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#FF0055",
    "strokeColor": "#BF0442",
    "fillOpacity": "0.35",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:d",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_d.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Agl",
      "meters": 0.0,
      "feet": 0.0
    },
    "altitudeCeiling": {
      "datum": "Msl",
      "meters": 1371.5999979151679,
      "feet": 4499.99999316
    },
    "name": "WILLSWORTHY",
    "listOrderHint": "500",
    "category": "airspace",
    "designator": "EGD011B",
    "airspaceType": "D",
    "filters": [
      {
        "name": "Airspace",
        "property": "show",
        "active": true
      },
      {
        "name": "Danger Area",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Danger Area",
      "title": "WILLSWORTHY",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Danger Area",
          "text": "Activities within this area dangerous to the flight of aircraft may exist at specified times. Notes attached to this area provide additional information. Danger, Prohibited and Restricted Areas are defined according to ICAO International Standards. Regulations governing the flight of s vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your  in this area. Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -3.6275,
          50.3825
        ],
        [
          -3.36,
          50.41444
        ],
        [
          -3.30611,
          50.72667
        ],
        [
          -3.56694,
          50.74472
        ],
        [
          -3.6275,
          50.3825
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "D374AC96517B3BB6B1FB32E0C2FF0566014AE866",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#ffffff",
    "strokeColor": "#ffffff",
    "fillOpacity": "0.2",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:cta",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_cta.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Sps",
      "meters": 1981.199996988576,
      "feet": 6499.99999012
    },
    "altitudeCeiling": {
      "datum": "Sps",
      "meters": 5943.5999909657285,
      "feet": 19499.99997036
    },
    "name": "BERRY HEAD CTA 3",
    "listOrderHint": "1000",
    "category": "airspace",
    "designator": "EGTE3",
    "airspaceType": "CTA",
    "filters": [
      {
        "name": "Upper Airspace",
        "property": "show",
        "active": false
      },
      {
        "name": "Type CTA",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Type CTA",
      "title": "BERRY HEAD CTA 3",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Altitude",
          "text": "This piece of airspace is in effect above FL64.9999999012"
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Control area",
          "text": "A controlled airspace extending upwards from a specified limit above the earth."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Regulated Airspace",
          "text": "This airspace has a specific classification which applies to manned aviation, and may have implications on  operations depending on local laws and regulations governing  use.\r\n\r\nRegulations governing the flight of s vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your . Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -4.06139,
          50.67194
        ],
        [
          -4.01694,
          50.62472
        ],
        [
          -3.96694,
          50.62889
        ],
        [
          -4.02944,
          50.70722
        ],
        [
          -4.06139,
          50.67194
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "7DF22209F9845913C095265075BDD5AC1F1D7BBF",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#FF0055",
    "strokeColor": "#BF0442",
    "fillOpacity": "0.35",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:d",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_d.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Agl",
      "meters": 0.0,
      "feet": 0.0
    },
    "altitudeCeiling": {
      "datum": "Msl",
      "meters": 3047.99999536704,
      "feet": 9999.9999847999989
    },
    "name": "OKEHAMPTON",
    "listOrderHint": "500",
    "category": "airspace",
    "designator": "EGD011A",
    "airspaceType": "D",
    "filters": [
      {
        "name": "Airspace",
        "property": "show",
        "active": true
      },
      {
        "name": "Danger Area",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Danger Area",
      "title": "OKEHAMPTON",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Danger Area",
          "text": "Activities within this area dangerous to the flight of aircraft may exist at specified times. Notes attached to this area provide additional information. Danger, Prohibited and Restricted Areas are defined according to ICAO International Standards. Regulations governing the flight of s vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your  in this area. Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "coordinates": [
      [
        [
          -4.07889,
          50.59722
        ],
        [
          -4.06,
          50.56722
        ],
        [
          -3.97556,
          50.57389
        ],
        [
          -3.95333,
          50.62361
        ],
        [
          -3.96694,
          50.62889
        ],
        [
          -4.02667,
          50.62389
        ],
        [
          -4.07889,
          50.59722
        ]
      ]
    ],
    "type": "Polygon"
      },
      "id": "597388F5D89C3EFC8FE8FE3907B1E41A01B6EBA6",
      "properties": {
    "hazardFactor": "60",
    "hazardFactorName": "Danger",
    "fillColor": "#FF0055",
    "strokeColor": "#BF0442",
    "fillOpacity": "0.35",
    "strokeWidth": "1",
    "strokeOpacity": "0.8",
    "detailedCategory": "type:d",
    "iconUrl": "https://example.com//v1/map/icon?icon=class_type_d.png",
    "airac": {
      "to": "2019-08-15",
      "from": "2019-07-18"
    },
    "altitudeFloor": {
      "datum": "Agl",
      "meters": 0.0,
      "feet": 0.0
    },
    "altitudeCeiling": {
      "datum": "Msl",
      "meters": 3047.99999536704,
      "feet": 9999.9999847999989
    },
    "name": "MERRIVALE",
    "listOrderHint": "500",
    "category": "airspace",
    "designator": "EGD011C",
    "airspaceType": "D",
    "filters": [
      {
        "name": "Airspace",
        "property": "show",
        "active": true
      },
      {
        "name": "Danger Area",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "airspace",
      "detailedCategory": "Danger Area",
      "title": "MERRIVALE",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Danger Area",
          "text": "Activities within this area dangerous to the flight of aircraft may exist at specified times. Notes attached to this area provide additional information. Danger, Prohibited and Restricted Areas are defined according to ICAO International Standards. Regulations governing the flight of s vary from country-to-country, therefore these areas are included for your information. It is your responsibility to check the applicability of any local, state and/or national laws and regulations which may permit or otherwise restrict the operation of your  in this area. Unless regulations in your region explicitly permit the operation of your  in this area, we recommend you do not operate your  here."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Summary",
          "text": "Red zones are regulated high-risk areas."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    },
    {
      "geometry": {
    "type": "Point",
    "coordinates": [
      -3.7320278426122124,
      50.514325635148261
    ]
      },
      "id": "f02008c4-257d-4cbd-9a1c-4811d4e54a8c",
      "properties": {
    "detailedCategory": "user:flight_report",
    "description": null,
    "fromUtc": "2019-08-15T12:01:01Z",
    "toUtc": "2019-08-15T13:01:01Z",
    "fromLocal": "2019-08-15T13:01:01",
    "toLocal": "2019-08-15T14:01:01",
    "timeZone": "Europe/London",
    "flightType": "rec",
    "radiusMeters": 500,
    "isOwner": false,
    "alertSummary": null,
    "name": "Scenery ",
    "state": "Approved",
    "dczNotes": null,
    "isTestMode": null,
    "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
    "hazardFactor": "40",
    "hazardFactorName": "Warning",
    "fillColor": "#b71695",
    "strokeColor": "#b71695",
    "fillOpacity": "0.35",
    "strokeOpacity": "0.8",
    "strokeWidth": "1",
    "category": "flightReport",
    "radius": "500",
    "filters": [
      {
        "name": "Flight Reports",
        "property": "show",
        "active": true
      }
    ],
    "display": {
      "category": "Flight Report",
      "detailedCategory": "User reported",
      "title": "Scenery ",
      "sections": [
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "Flight report",
          "text": "This is a user submitted flight report. A  flight is planned to take place here between Thu 15 Aug 2019 at 13:01 and Thu 15 Aug 2019 at 14:01 in Europe/London. This flight is tagged as recreational."
        },
        {
          "iconUrl": "https://example.com//v1/map/icon?icon=warning.png",
          "title": "About flight reports",
          "text": "Flight reports allow users to tell other members of the aviation community about your planned aerial activity to help improve safety and optionally activate Airspace Alerts."
        }
      ],
      "actions": []
    }
      },
      "type": "Feature"
    }
  ],
  "bbox": [
    -4.374,
    50.4557,
    -3.6117,
    50.7174
  ],
  "type": "FeatureCollection"
}

However, when I try editing the function and include a line containing feature.properties.altitudeFloor.feet, I get an error.

function FuncAirspace(feature) {
    if (
        (feature.properties.category === "airspace" || feature.properties.category === "airport")
        && feature.properties.detailedCategory !== "uk:frz"
        && feature.properties.detailedCategory !== "type:tra"
        && feature.properties.airspaceType !== "CTA"
        && feature.properties.airspaceType !== "TMA"
        && feature.properties.altitudeFloor.feet > 399
        ) return true
}

The error is:

TypeError: feature.properties.altitudeFloor is undefined

I appear to be able to filter any value to the feature.properties.X element range, but as soon as I try to filter to the next level down (eg. feature.properties.X.Y) I'm getting an error.

How do I successfully add a filter of feature.properties.altitudeFloor.feet > 399 to my existing Function?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.