Last active
January 30, 2026 03:44
-
-
Save ksonda/d31b3876987151e8e3540295ac22d2fc to your computer and use it in GitHub Desktop.
usgs-monitoringlocaiton-jinja
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {# | |
| USGS Monitoring Location JSON-LD Template | |
| Expected context variables: | |
| - site: dict with site metadata (from monitoring-locations API) | |
| - time_series: list of time series metadata (from time-series-metadata API) | |
| - field_measurements: list of field measurement parameters (from field-measurements API) | |
| - wq_summary: list of water quality observed properties (from samples-data summary) | |
| - hivis_camera: dict with HIVIS camera info (optional, from HIVIS API) | |
| API endpoints used: | |
| - https://api.waterdata.usgs.gov/ogcapi/v0/collections/monitoring-locations/items/{site_id} | |
| - https://api.waterdata.usgs.gov/ogcapi/v0/collections/time-series-metadata/items?monitoringLocationId=USGS-{site_id} | |
| - https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?monitoringLocationId=USGS-{site_id} | |
| - https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?monitoringLocationId=USGS-{site_id} | |
| - https://api.waterdata.usgs.gov/samples-data/summary/USGS-{site_id} | |
| - https://apps.usgs.gov/hivis/api/cameras?siteNumber={site_id} | |
| #} | |
| {%- macro param_metadata(code) -%} | |
| {#- Returns metadata for common USGS parameter codes -#} | |
| {%- set params = { | |
| ‘00060’: { | |
| ‘name’: ‘discharge’, | |
| ‘description’: ‘Discharge (streamflow) in cubic feet per second’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q8737769’, | |
| ‘wikipedia’: ‘https://en.wikipedia.org/wiki/Discharge_(hydrology)’, | |
| ‘unitText’: ‘cubic feet per second’, | |
| ‘quantityKind’: ‘qudt-quantkinds:VolumeFlowRate’, | |
| ‘unitCode’: ‘qudt-units:FT3-PER-SEC’, | |
| ‘methodUrl’: ‘https://doi.org/10.3133/tm3A8’, | |
| ‘methodName’: ‘Discharge Measurements at Gaging Stations’ | |
| }, | |
| ‘00065’: { | |
| ‘name’: ‘gage height’, | |
| ‘description’: ‘Gage height (stage) in feet’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q1199743’, | |
| ‘wikipedia’: ‘https://en.wikipedia.org/wiki/Stage_(hydrology)’, | |
| ‘unitText’: ‘feet’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Length’, | |
| ‘unitCode’: ‘qudt-units:FT’, | |
| ‘methodUrl’: ‘https://doi.org/10.3133/tm3A7’, | |
| ‘methodName’: ‘Stage Measurement at Gaging Stations’ | |
| }, | |
| ‘00010’: { | |
| ‘name’: ‘water temperature’, | |
| ‘description’: ‘Water temperature in degrees Celsius’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q11466’, | |
| ‘unitText’: ‘degrees Celsius’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Temperature’, | |
| ‘unitCode’: ‘qudt-units:DEG_C’ | |
| }, | |
| ‘00045’: { | |
| ‘name’: ‘precipitation’, | |
| ‘description’: ‘Precipitation in inches’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q25257’, | |
| ‘unitText’: ‘inches’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Length’, | |
| ‘unitCode’: ‘qudt-units:IN’ | |
| }, | |
| ‘00095’: { | |
| ‘name’: ‘specific conductance’, | |
| ‘description’: ‘Specific conductance at 25 degrees Celsius in microsiemens per centimeter’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q898703’, | |
| ‘unitText’: ‘microsiemens per centimeter’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Conductivity’, | |
| ‘unitCode’: ‘qudt-units:MicroS-PER-CM’ | |
| }, | |
| ‘00300’: { | |
| ‘name’: ‘dissolved oxygen’, | |
| ‘description’: ‘Dissolved oxygen in milligrams per liter’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q1154831’, | |
| ‘unitText’: ‘milligrams per liter’, | |
| ‘quantityKind’: ‘qudt-quantkinds:MassConcentration’, | |
| ‘unitCode’: ‘qudt-units:MilliGM-PER-L’ | |
| }, | |
| ‘00400’: { | |
| ‘name’: ‘pH’, | |
| ‘description’: ‘pH in standard units’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q169336’, | |
| ‘unitText’: ‘standard units’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Dimensionless’, | |
| ‘unitCode’: ‘qudt-units:UNITLESS’ | |
| }, | |
| ‘63680’: { | |
| ‘name’: ‘turbidity’, | |
| ‘description’: ‘Turbidity in formazin nephelometric units’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q249619’, | |
| ‘unitText’: ‘FNU’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Dimensionless’, | |
| ‘unitCode’: ‘qudt-units:FNU’ | |
| }, | |
| ‘72019’: { | |
| ‘name’: ‘groundwater level’, | |
| ‘description’: ‘Depth to water level below land surface in feet’, | |
| ‘wikidata’: ‘https://www.wikidata.org/wiki/Q161598’, | |
| ‘unitText’: ‘feet below land surface’, | |
| ‘quantityKind’: ‘qudt-quantkinds:Length’, | |
| ‘unitCode’: ‘qudt-units:FT’ | |
| } | |
| } -%} | |
| {{ params.get(code, {‘name’: ‘parameter ’ ~ code, ‘description’: ‘USGS parameter code ’ ~ code}) | tojson }} | |
| {%- endmacro -%} | |
| {%- macro site_type_label(type_code) -%} | |
| {%- set types = { | |
| ‘ST’: ‘stream’, | |
| ‘ST-CA’: ‘stream-canal’, | |
| ‘ST-DCH’: ‘stream-ditch’, | |
| ‘ST-TS’: ‘stream-tidal’, | |
| ‘LK’: ‘lake’, | |
| ‘ES’: ‘estuary’, | |
| ‘OC’: ‘ocean’, | |
| ‘OC-CO’: ‘ocean-coastal’, | |
| ‘AT’: ‘atmosphere’, | |
| ‘WE’: ‘wetland’, | |
| ‘SP’: ‘spring’, | |
| ‘GW’: ‘well’, | |
| ‘GW-MW’: ‘well-monitoring’, | |
| ‘SB’: ‘subsurface’, | |
| ‘SB-CV’: ‘subsurface-cave’, | |
| ‘LA’: ‘land’, | |
| ‘LA-EX’: ‘land-excavation’, | |
| ‘LA-OU’: ‘land-outfall’, | |
| ‘LA-SH’: ‘land-shore’ | |
| } -%} | |
| {{ types.get(type_code, ‘stream’) }} | |
| {%- endmacro -%} | |
| { | |
| “@context”: { | |
| “@vocab”: “https://schema.org/”, | |
| “xsd”: “https://www.w3.org/TR/xmlschema-2/#”, | |
| “rdfs”: “http://www.w3.org/2000/01/rdf-schema#”, | |
| “dc”: “http://purl.org/dc/terms/”, | |
| “dcat”: “https://www.w3.org/ns/dcat#”, | |
| “freq”: “http://purl.org/cld/freq/”, | |
| “qudt”: “http://qudt.org/schema/qudt/”, | |
| “qudt-units”: “http://qudt.org/vocab/unit/”, | |
| “qudt-quantkinds”: “http://qudt.org/vocab/quantitykind/”, | |
| “gsp”: “http://www.opengis.net/ont/geosparql#”, | |
| “locType”: “http://vocabulary.odm2.org/sitetype”, | |
| “odm2var”: “http://vocabulary.odm2.org/variablename/”, | |
| “odm2varType”: “http://vocabulary.odm2.org/variabletype/”, | |
| “hyf”: “https://www.opengis.net/def/schema/hy_features/hyf/”, | |
| “skos”: “https://www.opengis.net/def/schema/hy_features/hyf/HY_HydroLocationType”, | |
| “ssn”: “http://www.w3.org/ns/ssn/”, | |
| “ssn-system”: “http://www.w3.org/ns/ssn/systems/” | |
| }, | |
| “@id”: “https://geoconnex.us/usgs/monitoring-location/{{ site.id }}“, | |
| “@type”: [ | |
| “hyf:HY_HydrometricFeature”, | |
| “hyf:HY_HydroLocation”, | |
| “locType:{{ site_type_label(site.site_type_code) }}” | |
| ], | |
| “hyf:HydroLocationType”: “hydrometric station”, | |
| “identifier”: { | |
| “@type”: “PropertyValue”, | |
| “propertyID”: “USGS site number”, | |
| “value”: “{{ site.id }}” | |
| }, | |
| “name”: “{{ site.name }}“, | |
| “description”: “{{ site.site_type_description | default(‘Monitoring Location’) }}“, | |
| “provider”: { | |
| “url”: “https://waterdata.usgs.gov”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey Water Data for the Nation” | |
| }, | |
| {%- if site.agency_cd and site.agency_cd != ‘USGS’ %} | |
| “contributor”: { | |
| “@type”: “Organization”, | |
| “name”: “{{ site.agency_cd }}” | |
| }, | |
| {%- endif %} | |
| “url”: “https://waterdata.usgs.gov/monitoring-location/{{ site.id }}/“, | |
| “geo”: { | |
| “@type”: “GeoCoordinates”, | |
| “longitude”: {{ site.longitude }}, | |
| “latitude”: {{ site.latitude }} | |
| {%- if site.altitude %}, | |
| “elevation”: { | |
| “@type”: “QuantitativeValue”, | |
| “value”: {{ site.altitude }}, | |
| “unitCode”: “{{ site.altitude_datum | default(‘NAVD88’) }}” | |
| } | |
| {%- endif %} | |
| }, | |
| “gsp:hasGeometry”: { | |
| “@type”: “http://www.opengis.net/ont/sf#Point”, | |
| “gsp:asWKT”: { | |
| “@type”: “http://www.opengis.net/ont/geosparql#wktLiteral”, | |
| “@value”: “POINT ({{ site.longitude }} {{ site.latitude }})” | |
| }, | |
| “gsp:crs”: { | |
| “@id”: “http://www.opengis.net/def/crs/OGC/1.3/CRS84” | |
| } | |
| }, | |
| {%- if site.huc_cd %} | |
| “hyf:referencedPosition”: { | |
| “hyf:HY_IndirectPosition”: { | |
| “hyf:linearElement”: { | |
| “@id”: "https://geoconnex.us/ref/mainstems/{{ site.mainstem_id }}" | |
| } | |
| } | |
| }, | |
| {%- endif %} | |
| {%- if site.drain_area_va %} | |
| “additionalProperty”: [ | |
| { | |
| “@type”: “PropertyValue”, | |
| “propertyID”: “drainage area”, | |
| “value”: {{ site.drain_area_va }}, | |
| “unitText”: “square miles”, | |
| “unitCode”: “qudt-units:MI2” | |
| } | |
| {%- if site.contrib_drain_area_va %}, | |
| { | |
| “@type”: “PropertyValue”, | |
| “propertyID”: “contributing drainage area”, | |
| “value”: {{ site.contrib_drain_area_va }}, | |
| “unitText”: “square miles”, | |
| “unitCode”: “qudt-units:MI2" | |
| } | |
| {%- endif %} | |
| ], | |
| {%- endif %} | |
| “subjectOf”: [ | |
| {#- ============================================================================ | |
| CONTINUOUS (INSTANTANEOUS) TIME SERIES | |
| Source: time-series-metadata API | |
| ============================================================================ -#} | |
| {%- set ns = namespace(first=true) %} | |
| {%- for ts in time_series | selectattr(‘time_series_type’, ‘equalto’, ‘instantaneous’) | list %} | |
| {%- set param = param_metadata(ts.parameter_code) | from_json %} | |
| {{ ‘,’ if not ns.first else ‘’ }} | |
| { | |
| “@type”: “Dataset”, | |
| “name”: “Continuous {{ param.name }} data from USGS Monitoring Location {{ site.id }}“, | |
| “description”: “Continuous (instantaneous) {{ param.description }} from USGS site {{ site.name }}. Values recorded at {{ ts.computation_period_identifier | default(‘15-minute’) }} intervals.“, | |
| “provider”: { | |
| “url”: “https://waterdata.usgs.gov”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey Water Data for the Nation” | |
| }, | |
| “url”: “https://waterdata.usgs.gov/monitoring-location/{{ site.id }}/#parameterCode={{ ts.parameter_code }}“, | |
| “variableMeasured”: { | |
| “@type”: “PropertyValue”, | |
| “name”: “{{ param.name }}“, | |
| “description”: “{{ param.description }}” | |
| {%- if param.wikidata %}, | |
| “propertyID”: “{{ param.wikidata }}” | |
| {%- endif %} | |
| {%- if param.wikipedia %}, | |
| “url”: “{{ param.wikipedia }}” | |
| {%- endif %} | |
| {%- if param.unitText %}, | |
| “unitText”: “{{ param.unitText }}” | |
| {%- endif %} | |
| {%- if param.quantityKind %}, | |
| “qudt:hasQuantityKind”: “{{ param.quantityKind }}” | |
| {%- endif %} | |
| {%- if param.unitCode %}, | |
| “unitCode”: “{{ param.unitCode }}” | |
| {%- endif %}, | |
| “measurementTechnique”: “observation” | |
| {%- if param.methodUrl %}, | |
| “measurementMethod”: { | |
| “name”: “{{ param.methodName }}“, | |
| “publisher”: “U.S. Geological Survey”, | |
| “url”: “{{ param.methodUrl }}” | |
| } | |
| {%- endif %} | |
| }, | |
| “temporalCoverage”: “{{ ts.begin_date | default(ts.start_date) }}/..“, | |
| “dc:accrualPeriodicity”: “freq:continuous”, | |
| “dcat:temporalResolution”: { | |
| “@value”: “{{ ts.computation_period_identifier | default(‘PT15M’) }}“, | |
| “@type”: “xsd:duration” | |
| }, | |
| “distribution”: [ | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Instantaneous Values API (OGC API)“, | |
| “contentUrl”: “https://api.waterdata.usgs.gov/ogcapi/v0/collections/time-series-metadata/items?monitoringLocationId=USGS-{{ site.id }}¶meterCode={{ ts.parameter_code }}“, | |
| “encodingFormat”: [“application/json”, “application/geo+json”], | |
| “dc:conformsTo”: “https://api.waterdata.usgs.gov/ogcapi/v0/” | |
| }, | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Water Services - Instantaneous Values”, | |
| “contentUrl”: “https://waterservices.usgs.gov/nwis/iv/?sites={{ site.id }}¶meterCd={{ ts.parameter_code }}&format=json”, | |
| “encodingFormat”: [“application/json”, “text/tab-separated-values”] | |
| } | |
| ] | |
| } | |
| {%- set ns.first = false %} | |
| {%- endfor %} | |
| {#- ============================================================================ | |
| DAILY STATISTICS | |
| Source: daily API (or derived from time-series-metadata with statistic codes) | |
| ============================================================================ -#} | |
| {%- for ts in time_series | selectattr(‘time_series_type’, ‘equalto’, ‘daily’) | list %} | |
| {%- set param = param_metadata(ts.parameter_code) | from_json %} | |
| {%- set stat_name = {‘00001’: ‘maximum’, ‘00002’: ‘minimum’, ‘00003’: ‘mean’, ‘00006’: ‘sum’, ‘00008’: ‘median’}.get(ts.statistic_code, ‘mean’) %} | |
| , | |
| { | |
| “@type”: “Dataset”, | |
| “name”: “Daily {{ stat_name }} {{ param.name }} data from USGS Monitoring Location {{ site.id }}“, | |
| “description”: “Daily {{ stat_name }} {{ param.description }} from USGS site {{ site.name }}. Derived from continuous data.“, | |
| “provider”: { | |
| “url”: “https://waterdata.usgs.gov”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey Water Data for the Nation” | |
| }, | |
| “url”: “https://waterdata.usgs.gov/monitoring-location/{{ site.id }}/#dataTypeId=daily-{{ ts.parameter_code }}-{{ ts.statistic_code | default(‘00003’) }}“, | |
| “variableMeasured”: { | |
| “@type”: “PropertyValue”, | |
| “name”: “daily {{ stat_name }} {{ param.name }}“, | |
| “description”: “Daily {{ stat_name }} {{ param.description }}” | |
| {%- if param.wikidata %}, | |
| “propertyID”: “{{ param.wikidata }}” | |
| {%- endif %} | |
| {%- if param.unitText %}, | |
| “unitText”: “{{ param.unitText }}” | |
| {%- endif %} | |
| {%- if param.quantityKind %}, | |
| “qudt:hasQuantityKind”: “{{ param.quantityKind }}” | |
| {%- endif %} | |
| {%- if param.unitCode %}, | |
| “unitCode”: “{{ param.unitCode }}” | |
| {%- endif %}, | |
| “measurementTechnique”: “computed”, | |
| “measurementMethod”: { | |
| “name”: “Daily {{ stat_name }} computed from unit values”, | |
| “publisher”: “U.S. Geological Survey” | |
| } | |
| }, | |
| “temporalCoverage”: “{{ ts.begin_date | default(ts.start_date) }}/..“, | |
| “dc:accrualPeriodicity”: “freq:daily”, | |
| “dcat:temporalResolution”: { | |
| “@value”: “P1D”, | |
| “@type”: “xsd:duration” | |
| }, | |
| “distribution”: [ | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Daily Values API (OGC API)“, | |
| “contentUrl”: “https://api.waterdata.usgs.gov/ogcapi/v0/collections/daily/items?monitoringLocationId=USGS-{{ site.id }}¶meterCode={{ ts.parameter_code }}&statisticCode={{ ts.statistic_code | default(‘00003’) }}“, | |
| “encodingFormat”: [“application/json”, “application/geo+json”, “text/csv”], | |
| “dc:conformsTo”: “https://api.waterdata.usgs.gov/ogcapi/v0/” | |
| }, | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Water Services - Daily Values”, | |
| “contentUrl”: “https://waterservices.usgs.gov/nwis/dv/?sites={{ site.id }}¶meterCd={{ ts.parameter_code }}&statCd={{ ts.statistic_code | default(‘00003’) }}&format=json”, | |
| “encodingFormat”: [“application/json”, “text/tab-separated-values”] | |
| } | |
| ] | |
| } | |
| {%- endfor %} | |
| {#- ============================================================================ | |
| FIELD MEASUREMENTS | |
| Source: field-measurements API | |
| ============================================================================ -#} | |
| {%- for fm in field_measurements | groupby(‘parameter_code’) %} | |
| {%- set param = param_metadata(fm.grouper) | from_json %} | |
| {%- set fm_list = fm.list | sort(attribute=‘measurement_dt’) %} | |
| {%- set first_date = fm_list | first %} | |
| {%- set last_date = fm_list | last %} | |
| , | |
| { | |
| “@type”: “Dataset”, | |
| “name”: “Field measurements of {{ param.name }} from USGS Monitoring Location {{ site.id }}“, | |
| “description”: “Discrete field measurements of {{ param.description }} collected during site visits at {{ site.name }}. Used for rating curve calibration and quality assurance. {{ fm_list | length }} measurements on record.“, | |
| “provider”: { | |
| “url”: “https://waterdata.usgs.gov”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey Water Data for the Nation” | |
| }, | |
| “url”: “https://waterdata.usgs.gov/monitoring-location/{{ site.id }}/#dataTypeId=measurements-{{ fm.grouper }}-0”, | |
| “variableMeasured”: { | |
| “@type”: “PropertyValue”, | |
| “name”: “{{ param.name }}“, | |
| “description”: “Discrete field measurement of {{ param.description }}” | |
| {%- if param.wikidata %}, | |
| “propertyID”: “{{ param.wikidata }}” | |
| {%- endif %} | |
| {%- if param.unitText %}, | |
| “unitText”: “{{ param.unitText }}” | |
| {%- endif %} | |
| {%- if param.quantityKind %}, | |
| “qudt:hasQuantityKind”: “{{ param.quantityKind }}” | |
| {%- endif %} | |
| {%- if param.unitCode %}, | |
| “unitCode”: “{{ param.unitCode }}” | |
| {%- endif %}, | |
| “measurementTechnique”: “field measurement” | |
| {%- if param.methodUrl %}, | |
| “measurementMethod”: { | |
| “name”: “{{ param.methodName }}“, | |
| “publisher”: “U.S. Geological Survey”, | |
| “url”: “{{ param.methodUrl }}” | |
| } | |
| {%- endif %} | |
| }, | |
| “temporalCoverage”: “{{ first_date.measurement_dt[:10] }}/{{ last_date.measurement_dt[:10] }}“, | |
| “dc:accrualPeriodicity”: “freq:irregular”, | |
| “distribution”: [ | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Field Measurements API (OGC API)“, | |
| “contentUrl”: “https://api.waterdata.usgs.gov/ogcapi/v0/collections/field-measurements/items?monitoringLocationId=USGS-{{ site.id }}¶meterCode={{ fm.grouper }}“, | |
| “encodingFormat”: [“application/json”, “application/geo+json”, “text/csv”], | |
| “dc:conformsTo”: “https://api.waterdata.usgs.gov/ogcapi/v0/” | |
| } | |
| ] | |
| } | |
| {%- endfor %} | |
| {#- ============================================================================ | |
| WATER QUALITY SAMPLES (DISCRETE) | |
| Source: samples-data summary API | |
| ============================================================================ -#} | |
| {%- for wq in wq_summary | default([]) %} | |
| , | |
| { | |
| “@type”: “Dataset”, | |
| “name”: “{{ wq.observed_property | default(wq.characteristic_name) }} from USGS Monitoring Location {{ site.id }}“, | |
| “description”: “Discrete sample data for {{ wq.observed_property | default(wq.characteristic_name) }} from {{ site.name }}. Characteristic group: {{ wq.characteristic_group | default(‘Unknown’) }}. {{ wq.result_count | default(‘Multiple’) }} results from {{ wq.activity_count | default(‘multiple’) }} sampling activities.“, | |
| “provider”: { | |
| “url”: “https://waterdata.usgs.gov”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey Water Data for the Nation” | |
| }, | |
| “url”: “https://waterdata.usgs.gov/download-samples/#monitoringLocationIdentifier=USGS-{{ site.id }}&dataProfile=fullphyschem&observedProperty={{ wq.observed_property | default(wq.characteristic_name) | urlencode }}“, | |
| “variableMeasured”: { | |
| “@type”: “PropertyValue”, | |
| “name”: “{{ wq.observed_property | default(wq.characteristic_name) }}“, | |
| “description”: “{{ wq.observed_property | default(wq.characteristic_name) }} ({{ wq.characteristic_group | default(‘Unknown’) }})“, | |
| “measurementTechnique”: “{{ ‘field/laboratory analysis’ if wq.characteristic_group == ‘Biological’ else ‘laboratory analysis’ }}” | |
| }, | |
| “temporalCoverage”: “{{ wq.min_date | default(wq.first_result_date) }}/{{ wq.max_date | default(wq.last_result_date) }}“, | |
| “dc:accrualPeriodicity”: “freq:irregular”, | |
| “distribution”: [ | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “USGS Samples Data Download”, | |
| “contentUrl”: “https://waterdata.usgs.gov/download-samples/#monitoringLocationIdentifier=USGS-{{ site.id }}&dataProfile=fullphyschem&observedProperty={{ wq.observed_property | default(wq.characteristic_name) | urlencode }}“, | |
| “encodingFormat”: [“text/csv”] | |
| }, | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “Water Quality Portal”, | |
| “contentUrl”: “https://www.waterqualitydata.us/portal/#siteid=USGS-{{ site.id }}&characteristicName={{ wq.observed_property | default(wq.characteristic_name) | urlencode }}&mimeType=csv”, | |
| “encodingFormat”: [“text/csv”], | |
| “dc:conformsTo”: “https://www.waterqualitydata.us/” | |
| } | |
| ] | |
| } | |
| {%- endfor %} | |
| {#- ============================================================================ | |
| HIVIS CAMERA IMAGERY | |
| Source: HIVIS API | |
| ============================================================================ -#} | |
| {%- if hivis_camera %} | |
| , | |
| { | |
| “@type”: “MediaObject”, | |
| “name”: “Real-time imagery from {{ hivis_camera.name | default(site.name) }}“, | |
| “description”: “Real-time camera imagery and timelapse videos from USGS HIVIS (Hydrologic Imagery Visualization and Information System) at {{ hivis_camera.location_description | default(site.name) }}. Provides visual context for hydrologic conditions at the monitoring location.“, | |
| “identifier”: { | |
| “@type”: “PropertyValue”, | |
| “propertyID”: “HIVIS camera ID”, | |
| “value”: “{{ hivis_camera.camera_id }}” | |
| }, | |
| “provider”: { | |
| “url”: “https://apps.usgs.gov/hivis/”, | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey HIVIS” | |
| }, | |
| “url”: “https://apps.usgs.gov/hivis/camera/{{ hivis_camera.camera_id }}“, | |
| “mainEntityOfPage”: “https://apps.usgs.gov/hivis/camera/{{ hivis_camera.camera_id }}“, | |
| “about”: { | |
| “@type”: “Place”, | |
| “name”: “{{ hivis_camera.location_description | default(site.name) }}” | |
| }, | |
| “hasPart”: [ | |
| { | |
| “@type”: “VideoObject”, | |
| “name”: “Timelapse video of {{ hivis_camera.name | default(site.name) }}“, | |
| “description”: “Automated timelapse video compilation showing recent hydrologic conditions at {{ hivis_camera.location_description | default(site.name) }}. Updated continuously.“, | |
| “contentUrl”: “{{ hivis_camera.timelapse_url | default(‘https://usgs-nims-images.s3.amazonaws.com/timelapse/’ ~ hivis_camera.camera_id ~ ‘/’ ~ hivis_camera.camera_id ~ ‘_720.mp4’) }}“, | |
| “encodingFormat”: “video/mp4", | |
| “thumbnail”: { | |
| “@type”: “ImageObject”, | |
| “contentUrl”: “{{ hivis_camera.latest_image_url | default(‘https://usgs-nims-images.s3.amazonaws.com/images/’ ~ hivis_camera.camera_id ~ ‘/latest.jpg’) }}” | |
| }, | |
| “producer”: { | |
| “@type”: “GovernmentOrganization”, | |
| “name”: “U.S. Geological Survey” | |
| }, | |
| “duration”: “PT24H” | |
| }, | |
| { | |
| “@type”: “ImageObject”, | |
| “name”: “Latest image from {{ hivis_camera.name | default(site.name) }}“, | |
| “description”: “Most recent camera image from {{ hivis_camera.location_description | default(site.name) }}“, | |
| “contentUrl”: “{{ hivis_camera.latest_image_url | default(‘https://usgs-nims-images.s3.amazonaws.com/images/’ ~ hivis_camera.camera_id ~ ‘/latest.jpg’) }}“, | |
| “encodingFormat”: “image/jpeg” | |
| } | |
| ], | |
| “distribution”: [ | |
| { | |
| “@type”: “DataDownload”, | |
| “name”: “HIVIS Camera API”, | |
| “contentUrl”: “{{ hivis_camera.api_url | default(‘https://jj5utwupk5.execute-api.us-east-1.amazonaws.com/prod/cameras/’ ~ hivis_camera.camera_id) }}“, | |
| “encodingFormat”: “application/json”, | |
| “description”: “API endpoint providing camera metadata and image URLs” | |
| } | |
| ], | |
| “potentialAction”: { | |
| “@type”: “ViewAction”, | |
| “name”: “View camera in HIVIS application”, | |
| “target”: { | |
| “@type”: “EntryPoint”, | |
| “urlTemplate”: “https://apps.usgs.gov/hivis/camera/{{ hivis_camera.camera_id }}“, | |
| “actionPlatform”: [ | |
| “http://schema.org/DesktopWebPlatform”, | |
| “http://schema.org/MobileWebPlatform” | |
| ] | |
| } | |
| }, | |
| “temporalCoverage”: “../..“, | |
| “dc:accrualPeriodicity”: “freq:continuous” | |
| } | |
| {%- endif %} | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment