github.com/PDOK/gokoala@v0.50.6/internal/ogc/common/geospatial/templates/collection.go.html (about)

     1  {{- /*gotype: github.com/PDOK/gokoala/internal/engine.TemplateData*/ -}}
     2  {{define "content"}}
     3  <hgroup>
     4      <h1 class="title h2" id="title">{{ .Config.Title }} - {{ if and .Params.Metadata .Params.Metadata.Title }}{{ .Params.Metadata.Title }}{{ else }}{{ .Params.ID }}{{ end }}</h1>
     5  </hgroup>
     6  
     7  <section class="row py-3">
     8      <div class="col-md-8 col-sm-12">
     9          <div class="card h-100">
    10              <h2 class="card-header h5">
    11                  {{ if and .Params.Metadata .Params.Metadata.Title }}
    12                      {{ .Params.Metadata.Title }}
    13                  {{ else }}
    14                      {{ .Params.ID }}
    15                  {{ end }}
    16              </h2>
    17              <div class="card-body">
    18                  {{ if and .Params.Metadata .Params.Metadata.Description }}
    19                      {{ markdown .Params.Metadata.Description }}
    20                  {{ end }}
    21              </div>
    22  
    23              <!-- start specific part per OGC spec -->
    24              <ul class="list-group list-group-flush">
    25                  {{ if and .Config.OgcAPI.GeoVolumes .Config.OgcAPI.GeoVolumes.Collections }}
    26                      {{ if .Config.OgcAPI.GeoVolumes.Collections.ContainsID .Params.ID }}
    27                      <li class="list-group-item">
    28                          <h3 class="card-title h5">3D GeoVolumes</h3>
    29                          <ul>
    30                              {{ if and .Params.GeoVolumes .Params.GeoVolumes.Has3DTiles }}
    31                                  <li>{{ i18n "GoTo" }} <a href="{{ .Config.BaseURL }}/collections/{{ .Params.ID }}/3dtiles" aria-label="{{ i18n "GoTo"}} 3D Tiles">3D Tiles</a></li>
    32                              {{ end }}
    33                              {{ if and .Params.GeoVolumes .Params.GeoVolumes.HasDTM }}
    34                                  <li>{{ i18n "GoTo" }} <a href="{{ .Config.BaseURL }}/collections/{{ .Params.ID }}/quantized-mesh" aria-label="{{ i18n "GoTo"}} Quantized Mesh DTM">Quantized Mesh DTM</a></li>
    35                              {{ end }}
    36                              {{ if and .Params.GeoVolumes .Params.GeoVolumes.URL3DViewer }}
    37                              <li>{{ i18n "ViewIn" }} <a href="{{ .Params.GeoVolumes.URL3DViewer }}" target="_blank" aria-label="{{ i18n "ViewIn" }} 3D Viewer">3D Viewer</a></li>
    38                              {{ end }}
    39                          </ul>
    40                      </li>
    41                      {{ end }}
    42                  {{ end }}
    43  
    44                  {{ if and .Config.OgcAPI.Tiles .Config.OgcAPI.Tiles.Collections }}
    45                      {{ if .Config.OgcAPI.Tiles.Collections.ContainsID .Params.ID }}
    46                      <li class="list-group-item">
    47                          <h3 class="card-title h5">Tiles</h3>
    48                          <ul>
    49                              <li>TODO (placeholder)</li>
    50                          </ul>
    51                      </li>
    52                      {{ end }}
    53                  {{ end }}
    54  
    55                  {{ if and .Config.OgcAPI.Features .Config.OgcAPI.Features.Collections }}
    56                      {{ if .Config.OgcAPI.Features.Collections.ContainsID .Params.ID }}
    57                      <li class="list-group-item">
    58                          <h3 class="card-title h5">Features</h3>
    59                          <ul>
    60                              <li><strong>{{ i18n "Browse" }} <a href="{{ .Config.BaseURL }}/collections/{{ .Params.ID }}/items" aria-label="{{ i18n "Browse" }} Features">Features</a></strong></li>
    61                              <li>{{ i18n "GoTo" }} features in WGS84 {{ i18n "As" }} <a href="{{ .Config.BaseURL }}/collections/{{ .Params.ID }}/items?f=json" aria-label="Features in WGS84 {{ i18n "As" }} GeoJSON">GeoJSON</a></li>
    62                              {{ range $index, $srs := .Config.OgcAPI.Features.ProjectionsForCollection .Params.ID }}
    63                                  {{ range $formatKey, $formatName := $.AvailableFormatsFeatures }}
    64                                      {{ $crs := printf "http://www.opengis.net/def/crs/EPSG/0/%s" (trimPrefix "EPSG:" $srs) }}
    65                                      <li>{{ i18n "GoTo" }} features in {{ $srs }} {{ i18n "As" }} <a href="{{ $.Config.BaseURL }}/collections/{{ $.Params.ID }}/items?f={{ $formatKey }}&crs={{ $crs }}"
    66                                                                                                      aria-label="Features in {{ $srs}} {{ i18n "As" }} {{ $formatName }}">{{ $formatName }}</a></li>
    67                                  {{ end }}
    68                              {{ end }}
    69                              {{/* TODO offer download link to GeoPackage, for example <li>Download {{ i18n "As" }} <a href="#" onclick="alert('TODO')">GeoPackage</a></li>*/}}
    70                          </ul>
    71                          <br/>
    72                          <div class="alert alert-primary" role="alert">
    73                              {{ i18n "FeaturesExplanation" }}
    74                          </div>
    75                      </li>
    76  
    77                      {{ end }}
    78                  {{ end }}
    79              </ul>
    80              <!-- end specific part per OGC spec -->
    81  
    82              <ul class="list-group list-group-flush">
    83                  {{ if and .Params.Metadata .Params.Metadata.Keywords }}
    84                      <li class="list-group-item">
    85                          <strong>{{ i18n "Keywords" }}</strong>: {{ .Params.Metadata.Keywords | join ", " }}
    86                      </li>
    87                  {{ end }}
    88                  {{/* <li class="list-group-item"><strong>Schema</strong>: TODO link to collection schema</li> */}}
    89                  {{ if and .Params.Metadata .Params.Metadata.LastUpdated }}
    90                      <li class="list-group-item">
    91                          <strong>{{ i18n "LastUpdated" }}</strong>:
    92                          {{ toDate "2006-01-02T15:04:05Z07:00" .Params.Metadata.LastUpdated | date "2006-01-02" }}
    93                      </li>
    94                  {{ end }}
    95                  {{ if and .Params.Metadata .Params.Metadata.Extent }}
    96  					<li class="list-group-item">
    97                          <strong>{{ i18n "GeographicExtent" }}</strong>
    98                          {{ if .Params.Metadata.Extent.Srs }}
    99                          (<a href="http://www.opengis.net/def/crs/EPSG/0/{{ trimPrefix "EPSG:" .Params.Metadata.Extent.Srs }}" target="_blank"
   100                              aria-label="{{ i18n "To" }} {{ .Params.Metadata.Extent.Srs }} {{ i18n "Definition" }}">{{ .Params.Metadata.Extent.Srs }}</a>):
   101                          {{ else }}
   102                          (<a href="http://www.opengis.net/def/crs/OGC/1.3/CRS84" target="_blank"
   103                              aria-label="{{ i18n "To" }} CRS84 {{ i18n "Definition" }}">CRS84</a>):
   104                          {{ end }}
   105                          {{ .Params.Metadata.Extent.Bbox | join ", " }}
   106                      </li>
   107                  {{ end }}
   108                  {{ if and .Params.Metadata .Params.Metadata.Extent .Params.Metadata.Extent.Interval }}
   109                  <li class="list-group-item">
   110                      <strong>{{ i18n "TemporalExtent" }}</strong>
   111                      (<a href="http://www.opengis.net/def/uom/ISO-8601/0/Gregorian" target="_blank" aria-label="{{ i18n "To" }} ISO-8601 {{ i18n "Definition" }}">ISO-8601</a>):
   112                      {{ toDate "2006-01-02T15:04:05Z" ((first .Params.Metadata.Extent.Interval) | replace "\"" "") | date "2006-01-02" }} /
   113                      {{ if not (contains "null" (last .Params.Metadata.Extent.Interval)) }}{{ toDate "2006-01-02T15:04:05Z" ((last .Params.Metadata.Extent.Interval) | replace "\"" "") | date "2006-01-02" }}{{ else }}..{{ end }}
   114                  </li>
   115                  {{ end }}
   116              </ul>
   117          </div>
   118      </div>
   119  </section>
   120  {{end}}