<?php
require_once "../../config/settings.inc.php";
define("IEM_APPID", 35);
require_once "../../include/myview.php";
$t = new MyView();
$t->title = "Open GIS Consortium Web Services";
$t->content = <<<EOM

<h3>OGC Web Services</h3>

<p>
The <a href="https://ogc.org">Open Geospatial Consortium, Inc</a> (OGC)
is a standards organization leading the development of geospatial and
location based services.  The OGC has adopted a number of specifications,
some of which are used by the IEM.  This page lists these services.
</p>

<h4>Some items of note:</h4>
<ol>
 <li>Not all TMS services are documented here as some of them are not directly
 usuable without loading up parameters into the layer name.</li>
 <li>All of these services are available via https:// connections.</li>
 <li>There are four DNS aliases for the website to allow web browers to make
    many simultaneous requests against these services.<br />
  <ol>
    <li>mesonet1.agron.iastate.edu</li>
    <li>mesonet2.agron.iastate.edu</li>
    <li>mesonet3.agron.iastate.edu</li>
    <li>www.mesonet.agron.iastate.edu</li>
   </ol>
   </li>
</ol>

<h3>Tile Map Service (TMS)</h3>

<p>The IEM has two base endpoints for its TMS services. They are partitioned
by their cache header settings.</p>

<table class="table table-striped table-sm">
<thead><tr><th>Endpoint</th><th>Cache Header</th></tr></thead>
<tbody>
<tr><td><a href="/c/tile.py/1.0.0">/c/tile.py/1.0.0</a></td><td>14 days</td></tr>
<tr><td><a href="/cache/tile.py/1.0.0">/cache/tile.py/1.0.0</a></td><td>5 minutes</td></tr>
</tbody>
</table>

<p>
The IEM also runs a customized version of
<a href="https://github.com/akrherz/TileCache">TileCache</a>
that allows some argument loading into the service layer name.  For example,
including timestamp information in the layer name.
</p>

<p>Here are working examples using IEM TMS services within various Javascript
libraries.</p>

<div class="row">
<div class="col-md-3">
<div class="card card-body">
<h4>Bing Maps</h4>

<p>The Microsoft Bing Maps group kindly provided these two examples.</p>

<p><strong>Single Tile Layer:</strong>
<a href="https://www.bing.com/api/maps/sdk/mapcontrol/isdk#tileLayerPublicXYZoom+JS">example</a></p>

<p><strong>Animated Tile Layer:</strong>
<a href="https://www.bing.com/api/maps/sdk/mapcontrol/isdk#weatherRadarMap+JS">example</a></p>
</div>
</div>

<div class="col-md-3">
<div class="card card-body">
<h4>ESRI JS API</h4>
<p>Here is an <a href="arcgis_wtms.html">example</a> using the ESRI JS API. This
was contributed by Derek Swingley.
</div>
</div>

<div class="col-md-3">
<div class="card card-body">
<h4>Google Maps</h4>
<p>Here is <a href="googlemaps_v3.html">an example for Google Maps v3</a>.
</div>
</div>

<div class="col-md-3">
<div class="card card-body">
<h4>OpenLayers</h4>
<p><a href="openlayers_example.html">Example</a> for OpenLayers v2.</p>

<p><a href="ol3_example.html">Example</a> for OpenLayers v3 and higher.</p>
</div>
</div>

</div><!-- ./row -->

<br />

<div class="card border-primary">
<div class="card-header">Tile Map Services at both <code>/c/tile.py/1.0.0/</code>
and <code>/cache/tile.py/1.0.0/</code></div>
<div class="card-body">

<p><strong>Why both?</strong> If you are using stable layer names (ie with a
umabiguous timestamp), you likely want to use the <code>/c/</code> service so to
have better client side caching.</p>

<table class="table table-striped table-sm">
<thead class="sticky">
<tr><th>Layer Name</th><th>Description</th><th>Legend</th></tr>
</thead>

<tbody>

<tr>
<td>Template: ridge::XXX-XXX-0</td>
<td>Latest individual/mosaic RADAR XXX data for product XXX. For example,
<code>ridge::BMX-N0B-0</code> (latest BMX N0B) and
<code>ridge::USCOMP-N0Q-0</code> (latest mosaic N0Q (downscaled N0B)).
 <a href="/GIS/ridge.phtml">more info</a>
 </td>
 <td><a href="/GIS/ridge.phtml">more info</a></td>
 </tr>
<tr>
<td>Template: ridge::XXX-XXX-YYYYMMDDHHMI</td>
<td>Archived (UTC Timestamp) individual/mosaic RADAR XXX data for product XXX.
For the single site imagery, this must be an exact UTC timestamp that the
archive has data. For mosaic, this is a constant availability at minute
modulo 5. For example, <code>ridge::BMX-N0B-202501270002</code> (BMX N0B at
27 Jan 2025 at 00:02 UTC) and
<code>ridge::USCOMP-N0Q-202501272305</code> (mosaic N0Q (downscaled N0B) at 27 Jan 2025 at 23:05 UTC).
<a href="/GIS/ridge.phtml">more info</a>
</td>
<td><a href="/GIS/ridge.phtml">more info</a></td>
</tr>

</tbody>
</table>

</div><!-- ./card-body -->
</div><!-- ./card -->

<br />

<div class="card border-primary">
<div class="card-header">Tile Map Services only at <code>/c/tile.py/1.0.0/</code></div>
<div class="card-body">

<table class="table table-striped table-sm">
<thead class="sticky">
<tr><th>Layer Name</th><th>Description</th><th>Legend</th></tr>
</thead>

<tbody>
<tr><td>depmask</td><td><a href="https://dailyerosion.org/">Daily Erosion Project</a> mask
for HUC12s that are not modelled.</td><td></td></tr>
<tr><td>uscounties</td><td>US County Borders</td><td></td></tr>
<tr><td>usstates</td><td>US State Borders</td><td></td></tr>
</tbody>
</table>

</div><!-- ./card-body -->
</div><!-- ./card -->

<br />

<div class="card border-primary">
<div class="card-header">Tile Map Services only at <code>/cache/tile.py/1.0.0/</code></div>
<div class="card-body">

<table class="table table-striped table-sm">
<thead class="sticky">
<tr><th>Layer Name</th><th>Description</th><th>Legend</th></tr>
</thead>

<tbody>

<tr class="info"><th colspan="3">GOES Satellite Imagery</th></tr>

<tr>
<td>goes-vis-1km
<br />goes-ir-4km
<br />goes-wv-4km
<br />conus-goes-vis-1km
<br />conus-goes-ir-4km
<br />conus-goes-wv-4km</td>
<td>
These are legacy service names that all pointing at the same GOES East products.
Channel 02 for visible, channel 13 for IR, and channel 09 for WV.  The conus
here is poorly named as it is only just GOES east. These layers update in
near realtime and you can find <a href="/data/gis/images/GOES/conus/channel02/GOES-16_C02.json">JSON metadata</a>
files for each channel that denote the valid time.
</td>
<td><a href="/GIS/goes.phtml">more info</a></td>
</tr>

</tr>
<tr>
<td>Template: goes_<i>bird</i>_<i>sector</i>_ch<i>channel</i><br />
Example: goes_east_conus_ch02
</td>
<td>Current GOES R/S Imagery. Where: <br />
 <i>bird</i> is "east" or "west"<br />
 <i>sector</i> is "fulldisk", "alaska" (west only), "conus",
 "mesoscale-1", "mesoscale-2", "puertorico" (east only)<br />
 <i>channel</i> is two-digit, zero padded 01-16</td>
 <td><a href="/GIS/goes.phtml">more info</a></td>
 </tr>

<tr class="info"><th colspan="3">HRRR Weather Forecast Model</th></tr>

<tr><td>Template: hrrr::REFD-FXXXX-0</td>
<td>Latest HRRR Reflectivity Forecasts, FXXXX is the forecast minute
<a href="/GIS/model.phtml">more info</a></td></tr>
<tr><td>Template: hrrr::REFD-FXXXX-YYYYMMDDHHMI</td>
<td>Archived HRRR Reflectivity Forecasts, FXXXX is the forecast minute
<a href="/GIS/model.phtml">more info</a></td></tr>

<tr><td>Template: hrrr::REFP-FXXXX-0</td>
<td>Latest HRRR Reflectivity (with Precip Type) Forecasts, FXXXX is the forecast minute
<a href="/GIS/model.phtml">more info</a></td></tr>
<tr><td>Template: hrrr::REFP-FXXXX-YYYYMMDDHHMI</td>
<td>Archived HRRR Reflectivity (with Precip Type) Forecasts, FXXXX is the forecast minute
<a href="/GIS/model.phtml">more info</a></td></tr>


<tr class="info"><th colspan="3">NEXRAD Mosaics</th></tr>

<tr><td>nexrad-n0q</td><td>NEXRAD Base Reflectivity current</td></tr>
<tr><td>nexrad-n0q-mXXm</td><td>... where <code>XX</code> is a zero padded number modulo 5 between
05 and 55 minutes old.</td></tr>

<tr><td>nexrad-eet</td><td>NEXRAD Echo Tops EET current</td></tr>
<tr><td>nexrad-eet-mXXm</td><td>... where <code>XX</code> is a zero padded number module 5 between
05 and 55 minutes old.</td></tr>

<tr class="info"><th colspan="3">MRMS Products</th></tr>

<tr><td>q2-n1p</td>
  <td>MRMS 1 Hour Precipitation</td>
  <td><img src="/images/mrms_q3_p1h.png"></td>
  </tr>
<tr><td>q2-p24h</td>
  <td>MRMS 24 Hour Precipitation</td>
  <td><img src="/images/mrms_q3_p24h.png"></td>
  </tr>
<tr><td>q2-p48h</td>
  <td>MRMS 48 Hour Precipitation</td>
  <td><img src="/images/mrms_q3_p24h.png"></td>
  </tr>
<tr><td>q2-p72h</td>
  <td>MRMS 72 Hour Precipitation</td>
  <td><img src="/images/mrms_q3_p24h.png"></td>
  </tr>

<tr>
  <td>q2-hsr</td>
  <td>MRMS Hybrid-Scan Reflectivity Composite (SeamlessHSR).</td>
  <td><img src="/images/mrms_lcref.png"></td>
  </tr>

<tr>
  <td>mrms::a2m-YYYYMMDDHHMI</td>
  <td>Archived MRMS PrecipRate product. An archived raster should be available
  for each minute modulo 2 since early 2015.</td>
  <td><img src="/images/mrms_a2m.png"></td>
  </tr>

<tr>
  <td>mrms::lcref-YYYYMMDDHHMI</td>
  <td>Archived MRMS SeamlessHSR product. An archived raster should be available
  for each minute modulo 2 since early 2015.</td>
  <td><img src="/images/mrms_lcref.png"></td>
  </tr>

<tr>
  <td>mrms::p{1,24,48,72}h-YYYYMMDDHHMI</td>
  <td>Archived MRMS precipitation estimate over given backwards looking
  hourly interval. Note that the 1 hourly value is not zero padded with the
  URI.  Rasters are only available at the top of each hour since early 2015!</td>
  <td>See Above for Ramps</td>
  </tr>


</tbody>
</table>

</div><!-- ./card-body -->
</div><!-- ./card -->

<h4>Web Map Service (WMS)</h4>

<p>A WMS defines a protocol for web based retrieval of geodata in raster map format. If you are interested in the capabilities XML file, simply add "VERSION=1.1.1&REQUEST=GetCapabilities&SERVICE=WMS&" to the URI string.</p>

<div>
<strong>Services</strong>
<ul>
<li>Iowa Precipitation
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/iowa/rainfall.cgi?</code></li>
<li>MRMS Q3 Precipitation (Missing data is grey)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/us/mrms.cgi?</code>
 <br /><i>Layer:</i> <strong>mrms_p72h</strong> 72 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p48h</strong> 48 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p24h</strong> 24 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p1h</strong> One Hour Precipitation
 </li>
<li>MRMS Q3 Precipitation (Missing data is transparent)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/us/mrms_nn.cgi?</code>
 <br /><i>Layer:</i> <strong>mrms_p72h</strong> 72 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p48h</strong> 48 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p24h</strong> 24 Hour Precipitation
 <br /><i>Layer:</i> <strong>mrms_p1h</strong> One Hour Precipitation
 </li>
</ul>

<hr />
<div class="row">
<div class="col-md-6">
<ul>
<li>GOES East Imagery (All Sectors, All 16 Channels)
<br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/goes_east.cgi?</code>
<br /><i>Layer Template:</i> <strong>sector_chchannel</strong> ie conus_ch02</li>

<li>GOES West Imagery (All Sectors, All 16 Channels)
<br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/goes_west.cgi?</code>
<br /><i>Layer Template:</i> <strong>sector_chchannel</strong></li>
</ul>
</div>
<div class="col-md-3">
<p><strong>Channel 1</strong>
<br /><img src="/images/goes_c01.png" alt="Channel 1 Color Ramp"></p>
<p><strong>Channel 2</strong>
<br /><img src="/images/goes_c02.png" alt="Channel 2 Color Ramp"></p>
<p><strong>Channel 3</strong>
<br /><img src="/images/goes_c03.png" alt="Channel 3 Color Ramp"></p>
<p><strong>Channel 4</strong>
<br /><img src="/images/goes_c04.png" alt="Channel 4 Color Ramp"></p>
<p><strong>Channel 5</strong>
<br /><img src="/images/goes_c05.png" alt="Channel 5 Color Ramp"></p>
<p><strong>Channel 6</strong>
<br /><img src="/images/goes_c06.png" alt="Channel 6 Color Ramp"></p>
<p><strong>Channel 7</strong>
<br /><img src="/images/goes_c07.png" alt="Channel 7 Color Ramp"></p>
<p><strong>Channel 8</strong>
<br /><img src="/images/goes_c08.png" alt="Channel 8 Color Ramp"></p>
</div>
<div class="col-md-3">
<p><strong>Channel 9</strong>
<br /><img src="/images/goes_c09.png" alt="Channel 9 Color Ramp"></p>
<p><strong>Channel 10</strong>
<br /><img src="/images/goes_c10.png" alt="Channel 10 Color Ramp"></p>
<p><strong>Channel 11</strong>
<br /><img src="/images/goes_c11.png" alt="Channel 11 Color Ramp"></p>
<p><strong>Channel 12</strong>
<br /><img src="/images/goes_c12.png" alt="Channel 12 Color Ramp"></p>
<p><strong>Channel 13</strong>
<br /><img src="/images/goes_c13.png" alt="Channel 13 Color Ramp"></p>
<p><strong>Channel 14</strong>
<br /><img src="/images/goes_c14.png" alt="Channel 14 Color Ramp"></p>
<p><strong>Channel 15</strong>
<br /><img src="/images/goes_c15.png" alt="Channel 15 Color Ramp"></p>
<p><strong>Channel 16</strong>
<br /><img src="/images/goes_c16.png" alt="Channel 16 Color Ramp"></p>

</div>
</div>
<hr />
<ul>
<li>CONUS NEXRAD Base Reflectivity (n0q)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/n0q.cgi?</code></li>
<li>Historical CONUS NEXRAD Base Reflectivity [WMS-T] (n0q)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/n0q-t.cgi?</code></li>
 <li>Historical CONUS NEXRAD Base Reflectivity [WMS-T] (n0r)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/n0r-t.cgi?</code></li>
<li>CONUS NEXRAD 8-bit Net Echo Tops (eet)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/eet.cgi?</code></li>
<li>CONUS NEXRAD 1 Hour Precipitation (daa)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/daa.cgi?</code></li>
<li>CONUS NEXRAD Net Echo Tops (net)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/net.cgi?</code></li>
<li>CONUS NEXRAD Storm Total Precipitation (dta)
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/dta.cgi?</code></li>
<li>RIDGE Single NEXRAD Imagery
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/ridge.cgi?sector=XXX&amp;prod=XXX&amp;</code>
  <br />You also need to provide two CGI variables for the NEXRAD identifier
  and level III product you want. For example, sector=DMX&amp;prod=N0Q
  <br />
  <br /><i>Layer:</i> <strong>single</strong> Most recent image for the given
        RADAR identifier and Level III product.  A simple JSON metadata file
        exists for each RADAR and Level III product combination, for example
        <a href="/data/gis/images/4326/ridge/DMX/N0Q_0.json">DMX N0Q</a>.
  <br />
  <br /><i>Layer:</i> <strong>single-archive</strong> This allows request of
        a specific volume scan time from IEM's archive of imagery.  You need
        to specify the prod and sector like with the "single" layer, but also
        need to include a year, month, day and time.  All of these values are
        in UTC.  Here's an <a href="{$EXTERNAL_BASEURL}/cgi-bin/wms/nexrad/ridge.cgi?service=wms&version=1.1.1&request=GetMap&format=png&TRANSPARENT=TRUE&bgcolor=0xCCCCFE&BBOX=-14215828.6745634,5401834.631799334,-13166501.150410566,6006604.399507464&SRS=EPSG:3857&width=1716&height=989&sector=RTX&prod=N0Q&layers=single-archive&year=2015&month=01&day=27&time=2303">example request</a>
        that gets NEXRAD RTX N0Q product for 27 Jan 2015 at 23:03 UTC.  You
        must know the volume scan times prior to making the request.  There
        are <a href="/json/">JSON</a> services that can help you out.
        Unfortunately, this service <strong>does not support WMS-T</strong>
        due to complications with how I serve this information out, sorry.
 </li>

 <hr />
 <li>NWS Current Warnings
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/us/wwa.cgi?</code>
</li>
<li>Iowa Rainfall Estimates
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/iowa/rainfall.cgi?</code></li>
<li>Iowa Winter Road Conditions
 <br /><code>{$EXTERNAL_BASEURL}/cgi-bin/wms/iowa/roadcond.cgi?</code>
 <br /><i>Layer:</i> <strong>roadcond-noninterstate</strong> Non Interstate Road Conditions
 <br /><i>Layer:</i> <strong>roadcond-interstate</strong> Interstate Road Conditions
</li>


</ul>
</div>

<h4>Web Feature Service (WFS)</h4>

<p>A WFS is a service that provides geodata as simple features in Geography Markup Language (GML).</p>

<div>
<strong>Services</strong>
<ul>

<!-- No worky at the moment
<li>Iowa Rainfall Estimates
 <br /><code>{$EXTERNAL_BASEURL}/wfs/rainfall.php?</code></li>
-->

<li>National Weather Service Warnings Current
 <br /><code>{$EXTERNAL_BASEURL}/wfs/ww.php?</code></li>

<li>National Weather Service Warnings Archive For UTC Date (since 11 Jul 2002)
 <br /><code>{$EXTERNAL_BASEURL}/wfs/ww.php?date=YYYY-MM-DD&amp;</code></li>

<li>National Weather Service Warnings Archive At Given UTC Time(since 11 Jul 2002)
 <br /><code>{$EXTERNAL_BASEURL}/wfs/ww.php?date=YYYY-MM-DD&amp;time=HH:MI&amp;</code></li>


</ul>
</div>
EOM;
$t->render('single.phtml');
