<?php 
require_once "../../../config/settings.inc.php";
define("IEM_APPID", 134);
require_once "../../../include/myview.php";
require_once "../../../include/forms.php";
require_once "../../../include/request_gis.php";
$t = new MyView();
$t->title = "Download Aviation Weather Center SIGMETs Shapefile/KML";
$content = <<<EOM
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="/nws/">NWS Mainpage</a></li>
<li class="breadcrumb-item active" aria-current="page">AWC SIGMETs Download</li>
</ol>
</nav>

<header class="mb-4">
  <h1 class="h3 mb-3">Download Aviation Weather Center SIGMETs</h1>
  <p class="mb-0">Download archived AWC SIGMET polygons as shapefile, KML, CSV, or Excel based on issuance time in UTC.</p>
</header>
EOM;

$content .= aviation_request_related_links("awc_sigmets.phtml");

$content .= <<<EOM

<p><a href="/cgi-bin/request/gis/sigmets.py?help"><i class="bi bi-file-text" aria-hidden="true"></i> Backend documentation</a>
for those wishing to script against this download portal.</p>

<form method="GET" action="/cgi-bin/request/gis/sigmets.py">
<table class="table">
<thead><tr><th colspan="6">Time Interval for SIGMET Issuance TIme (UTC)</th></tr></thead>
<tr>
    <td></td><th>Year</th><th>Month</th><th>Day</th>
    <th>Hour</th><th>Minute</th>
</tr>

<tr>
EOM;
$content .= "<th>Start:</th>
    <td>
     ". yearSelect(2005, date("Y"), "year1") ."
    </td>
    <td>
     ". monthSelect(0,"month1") ."
    </td>
    <td>
     ". daySelect(0, "day1") ."
    </td>
    <td>
     ". gmtHourSelect(0, "hour1") ."
    </td>
    <td>
     ". minuteSelect(0, "minute1") ."
    </td>
  </tr>

  <tr>
    <th>End:</th>
    <td>
     ". yearSelect(2005, date("Y"), "year2") ."
    </td>
    <td>
     ". monthSelect(date("m"), "month2") ."
    </td>
    <td>
     ". daySelect(date("d"), "day2") ."
    </td>
    <td>
     ". gmtHourSelect(0, "hour2") ."
    </td>
    <td>
     ". minuteSelect(0, "minute2") ."
    </td>
  </tr>
</table>";

$content .= <<<EOM

<p><strong>Format:</strong><br />
<input type="radio" name="format" value="shp" checked="checked" id="shp" />
<label for="shp">Shapefile</label>
<input type="radio" name="format" value="kml" id="kml" />
<label for="kml">KML</label>
<input type="radio" name="format" value="csv" id="csv" />
<label for="csv">CSV</label>
<input type="radio" name="format" value="excel" id="excel" />
<label for="excel">Excel</label>

<p><input type="submit" value="Giveme data right now!"></p>
</form>

<h4>Shapefile DBF schema:</h4>
<pre>
Field 0: Type=C/String, Title='NAME' Combination of label and type fields
Field 1: Type=C/String, Title='LABEL' SIGMET label
Field 2: Type=C/String, Title='TYPE', One Character SIGMET type, always `C` at
         this time.
Field 3: Type=C/String, Title='ISSUE', Issuance UTC Time
Field 4: Type=C/String, Title='EXPIRE', Expiration UTC Time
Field 5: Type=C/String, Title='PROD_ID', IEM NWS Text Product Identifier, which
	 can be used against the /api/1/nwstext/&lt;PROD_ID&gt; service.
Field 6: Type=C/String, Title='TEXT', The SIGMET raw text
</pre>

<h4>Archive / Usage Notes:</h4>
<ol>
  <li><strong>14 May 2025</strong>: A number of location processing fixes were implemented
  with archive corrections made. Tthe archive was backfilled to the start of 2005 as well.</li>
</ol>
</form>
EOM;

$t->content = $content;
$t->render('single.phtml');
