@Bryan_Fleming
here is “quick, down & dirty” calculation that gives you the coordinates of the biggest rectangle that contains all points within the seven coordinates I looked at above.
there’s likely a better way to get the values but this works for anywhere in the western and northern quadrant of the globe (I think…)
it’s not pretty but it might get you started tho.
{% set value_json = {
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"@vocab": "https://api.weather.gov/ontology#"
}
],
"type": "FeatureCollection",
"features": [
{
"id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.d0d7637a2a18ffaa2e1b40d360b251c5c1a52df9.002.1",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-92.230000000000004,
33.109999999999999
],
[
-92.359999999999999,
33.229999900000003
],
[
-92.609999999999999,
33.290000000000006
],
[
-92.469999999999999,
33.38000000000001
],
[
-92.260000000000005,
33.330000000000013
],
[
-92.120000000000005,
33.220000000000013
],
[
-92.230000000000004,
33.109999999999999
]
]
]
},
"properties": {
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.d0d7637a2a18ffaa2e1b40d360b251c5c1a52df9.002.1",
"@type": "wx:Alert",
"id": "urn:oid:2.49.0.1.840.0.d0d7637a2a18ffaa2e1b40d360b251c5c1a52df9.002.1",
"areaDesc": "Bradley, AR; Calhoun, AR; Union, AR",
"geocode": {
"SAME": [
"005011",
"005013",
"005139"
],
"UGC": [
"ARC011",
"ARC013",
"ARC139"
]
},
"affectedZones": [
"https://api.weather.gov/zones/county/ARC011",
"https://api.weather.gov/zones/county/ARC013",
"https://api.weather.gov/zones/county/ARC139"
],
"references": [
{
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.6408665bffc8280c98409bb0ed67ea326aa18bba.002.1",
"identifier": "urn:oid:2.49.0.1.840.0.6408665bffc8280c98409bb0ed67ea326aa18bba.002.1",
"sender": "[email protected]",
"sent": "2023-02-16T20:17:00-06:00"
},
{
"@id": "https://api.weather.gov/alerts/urn:oid:2.49.0.1.840.0.70f1cca3596fc52bf6bd0f913cb9aa023de468dd.002.1",
"identifier": "urn:oid:2.49.0.1.840.0.70f1cca3596fc52bf6bd0f913cb9aa023de468dd.002.1",
"sender": "[email protected]",
"sent": "2023-02-17T10:06:00-06:00"
}
],
"sent": "2023-02-17T19:53:00-06:00",
"effective": "2023-02-17T19:53:00-06:00",
"onset": "2023-02-17T19:53:00-06:00",
"expires": "2023-02-18T20:00:00-06:00",
"ends": null,
"status": "Actual",
"messageType": "Update",
"category": "Met",
"severity": "Severe",
"certainty": "Observed",
"urgency": "Immediate",
"event": "Flood Warning",
"sender": "[email protected]",
"senderName": "NWS Little Rock AR",
"headline": "Flood Warning issued February 17 at 7:53PM CST by NWS Little Rock AR",
"description": "* WHAT...Minor flooding is occurring and minor flooding is forecast.\n\n* WHERE...Ouachita River At Thatcher L&D.\n\n* WHEN...Until further notice.\n\n* IMPACTS...At 85.0 feet, There may be some County roads along the\nriver flooded, requiring lengthy detours. River is high and swift,\nboaters should be very cautious. Access to many oil and gas rigs\nwill be by boat only. Levee gates should be closed.\n\n* ADDITIONAL DETAILS...\n- At 6:30 PM CST Friday the stage was 85.2 feet.\n- Forecast...The river is expected to remain steady above flood\nstage near 85.3 feet.\n- Flood stage is 79.0 feet.",
"instruction": null,
"response": "Avoid",
"parameters": {
"AWIPSidentifier": [
"FLSLZK"
],
"WMOidentifier": [
"WGUS84 KLZK 180153"
],
"NWSheadline": [
"FLOOD WARNING REMAINS IN EFFECT UNTIL FURTHER NOTICE"
],
"BLOCKCHANNEL": [
"EAS",
"NWEM",
"CMAS"
],
"EAS-ORG": [
"WXR"
],
"VTEC": [
"/O.CON.KLZK.FL.W.0007.000000T0000Z-000000T0000Z/"
],
"expiredReferences": [
"[email protected],urn:oid:2.49.0.1.840.0.ba700134310724e57ee2d9397471fa2452c43e8e.002.1,2023-02-16T09:41:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.d8c62a3f2b29eb0282c703088d2cfca662ad9d6f.002.1,2023-02-15T19:28:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.37cc15c7f0137626a10c6addef72bd4abc596fd0.002.1,2023-02-15T09:55:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.48f7780ef458137fad37925cd209f5231319f218.002.1,2023-02-14T19:48:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.df832a10a4dd0ff45cf6447850bd2d3cc3540746.001.1,2023-02-14T10:21:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.0d2bdbb0ec0f64b145b8bdf4373273f435755879.002.1,2023-02-13T19:31:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.428cccd084de5486bc2b3338dc03210ecf807fef.002.1,2023-02-13T08:42:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.13d770c03458f64239302f53ee9e309bc6603ca3.002.1,2023-02-12T20:18:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.0e60c245573fac0f82489cdfd81116b07f93f683.002.1,2023-02-12T08:31:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.e31761e0187f85956f86d982d39fe2b32b67d9a3.002.1,2023-02-11T20:02:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.274539bb18fb8bd4b4be76e247b57fe05f03be05.002.1,2023-02-11T10:10:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.f7e1c08393738070ed17706cd08062429fa931cd.002.1,2023-02-10T20:13:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.993142d07695622b609ba2d672746366b125f9fb.001.1,2023-02-10T09:46:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.02bb3a18b7e78d6a65972b2c992a76c05bea536b.003.1,2023-02-09T21:11:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.0426c8a4bb332490ac5d6ca9708f59ba9eef9ac3.003.1,2023-02-09T09:16:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.ef1ce521bd7d5457e9b97fa9cfcd8edf384a4d16.001.1,2023-02-08T20:59:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.5d533ae8b493f5ada7d705ab13343b92c72d7bfa.001.1,2023-02-08T10:41:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.8a729ccf42b3068d6b2c3e83ba423dbf6e60141e.002.1,2023-02-07T20:15:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.efe0849340c91eadfcc822bba0617f71998c3b93.002.1,2023-02-07T10:20:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.1c9277319286d771b641518b20cd49fa7eba3174.002.1,2023-02-06T19:14:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.bd1835aa36bedf1a385ee62b4a22b2a99b9d4e4e.005.1,2023-02-06T10:24:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.fbfb4e049c8df6655e6a70ed80082b581e8f11d0.002.1,2023-02-05T19:06:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.64825d6c61f6065d366efb84d8163436d7bb89f0.004.1,2023-02-05T10:00:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.29b18fe6a08464454e99c1d2d373e25b89ebd9e8.002.1,2023-02-04T18:54:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.3432d837720b4dabbeccbd3fb886de07d2365b3d.005.1,2023-02-04T10:15:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.4f033dfd3dd11ef33ae02adf37c4206bda5e5ea9.002.1,2023-02-03T19:39:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.0cbafba69c2815784e4584ed60d02e8529d5d652.002.1,2023-02-03T10:54:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.7d91eeb0d113868e3e70232adf848c7bebc072a1.002.1,2023-02-02T19:27:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.b8f88e1637601783277912c72b56a3968c37301c.002.1,2023-02-02T10:21:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.3242e52709b72537c012652fd31bf35f04d6c0cc.002.1,2023-02-01T18:42:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.d7c86b096924e754ae65dad3aa852af0495b75d1.002.1,2023-02-01T10:37:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.b767065d0994bf37bed0fa212a1e3ba3587baeac.002.1,2023-01-31T21:06:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.79f09b4cdad685fedeecaaab00e8326ec9ba14bb.001.1,2023-01-31T09:58:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.21bbb43a15039f5497d150c38c0dce46fe432824.001.1,2023-01-30T18:36:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.903d42c1d2e58528b29f9da5494281be199284d8.001.1,2023-01-30T09:46:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.fc5c7c83ef415c690156226131149a276334a673.003.1,2023-01-29T19:43:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.69afca5bff9ed317aedf2dc47722585bc8276b71.001.1,2023-01-29T10:33:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.ea9d9b0bc94c69fd48c2c28638e6ef9b15417ff0.001.1,2023-01-28T19:31:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.b4b31fc28b6c637d3fa52289cec99f1f09807bef.001.1,2023-01-28T10:48:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.e198b8f375f8d8cb4627f9420f0cb4fd90ad411f.001.1,2023-01-27T19:56:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.9417b1ee9b56465964c440cceea0ef171c94ab11.001.1,2023-01-27T10:35:00-06:00 [email protected],urn:oid:2.49.0.1.840.0.8dc03dd3144476844337a367e894a8b576a76b54.001.1,2023-01-27T10:27:00-06:00"
]
}
}
}
],
"title": "Current watches, warnings, and advisories for Bradley County (ARC011) AR",
"updated": "2023-02-18T02:30:00+00:00"
}
%}
{{ value_json.features[0].geometry.coordinates[0] | length }}
{% set coords = value_json.features[0].geometry.coordinates[0] %}
{{coords}}
{% set items = coords | length %}
{% set ns = namespace(max_lat=90) %}
{% for i in range(items) %}
{% set val = coords[i][1] %}
{% set ns.max_lat = val if val < ns.max_lat else ns.max_lat %}
{% endfor %}
{% set max_lat = ns.max_lat %}
{% set ns = namespace(min_lat=0) %}
{% for i in range(items) %}
{% set val = coords[i][1] %}
{% set ns.min_lat = val if val > ns.min_lat else ns.min_lat %}
{% endfor %}
{% set min_lat = ns.min_lat %}
{% set ns = namespace(max_lon=-180) %}
{% for i in range(items) %}
{% set val = coords[i][0] %}
{% set ns.max_lon = val if val > ns.max_lon else ns.max_lon %}
{% endfor %}
{% set max_lon = ns.max_lon %}
{% set ns = namespace(min_lon=0) %}
{% for i in range(items) %}
{% set val = coords[i][0] %}
{% set ns.min_lon = val if val < ns.min_lon else ns.min_lon %}
{% endfor %}
{% set min_lon = ns.min_lon %}
{{max_lon, max_lat}}
{{max_lon, min_lat}}
{{min_lon, max_lat}}
{{min_lon, min_lat}}