Skip to content

Commit

Permalink
Added base closure
Browse files Browse the repository at this point in the history
  • Loading branch information
tlaceby committed Dec 13, 2022
0 parents commit b782ce7
Show file tree
Hide file tree
Showing 8 changed files with 479 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"deno.enable": true,
"deno.unstable": true
}
97 changes: 97 additions & 0 deletions @types/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
export interface NOAACordinate {
id: string;
type: string;
geometry: Geometry;
properties: NOAACordinateProperties;
}

export interface Geometry {
type: string;
coordinates: number[];
}

export interface NOAACordinateProperties {
"@id": string;
"@type": string;
cwa: string;
forecastOffice: string;
gridId: string;
gridX: number;
gridY: number;
forecast: string;
forecastHourly: string;
forecastGridData: string;
observationStations: string;
relativeLocation: RelativeLocation;
forecastZone: string;
county: string;
fireWeatherZone: string;
timeZone: string;
radarStation: string;
}

export interface RelativeLocation {
type: string;
geometry: Geometry;
properties: RelativeLocationProperties;
}

export interface RelativeLocationProperties {
city: string;
state: string;
distance: DistanceClass;
bearing: DistanceClass;
}

export interface DistanceClass {
unitCode: string;
value: number;
}

export interface NOAAForecast {
type: string;
geometry: ForecastGeometry;
properties: Properties;
}

export interface ForecastGeometry {
type: string;
coordinates: Array<Array<number[]>>;
}

export interface Properties {
updated: string;
units: string;
forecastGenerator: string;
generatedAt: string;
updateTime: string;
validTimes: string;
elevation: Elevation;
periods: Period[];
}

export interface Elevation {
unitCode: string;
value: number;
}

export interface Period {
number: number;
name: string;
startTime: string;
endTime: string;
isDaytime: boolean;
temperature: number;
temperatureUnit: TemperatureUnit;
temperatureTrend: null | string;
windSpeed: string;
windDirection: string;
icon: string;
shortForecast: string;
detailedForecast: string;
}

export enum TemperatureUnit {
F = "F",
C = "C",
}
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/tlaceby/weather

go 1.19
55 changes: 55 additions & 0 deletions json/api.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"@context": [
"https://geojson.org/geojson-ld/geojson-context.jsonld",
{
"@version": "1.1",
"wx": "https://api.weather.gov/ontology#",
"s": "https://schema.org/",
"geo": "http://www.opengis.net/ont/geosparql#",
"unit": "http://codes.wmo.int/common/unit/",
"@vocab": "https://api.weather.gov/ontology#",
"geometry": { "@id": "s:GeoCoordinates", "@type": "geo:wktLiteral" },
"city": "s:addressLocality",
"state": "s:addressRegion",
"distance": { "@id": "s:Distance", "@type": "s:QuantitativeValue" },
"bearing": { "@type": "s:QuantitativeValue" },
"value": { "@id": "s:value" },
"unitCode": { "@id": "s:unitCode", "@type": "@id" },
"forecastOffice": { "@type": "@id" },
"forecastGridData": { "@type": "@id" },
"publicZone": { "@type": "@id" },
"county": { "@type": "@id" }
}
],
"id": "https://api.weather.gov/points/42.8,-106.298",
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-106.298, 42.8] },
"properties": {
"@id": "https://api.weather.gov/points/42.8,-106.298",
"@type": "wx:Point",
"cwa": "RIW",
"forecastOffice": "https://api.weather.gov/offices/RIW",
"gridId": "RIW",
"gridX": 187,
"gridY": 92,
"forecast": "https://api.weather.gov/gridpoints/RIW/187,92/forecast",
"forecastHourly": "https://api.weather.gov/gridpoints/RIW/187,92/forecast/hourly",
"forecastGridData": "https://api.weather.gov/gridpoints/RIW/187,92",
"observationStations": "https://api.weather.gov/gridpoints/RIW/187,92/stations",
"relativeLocation": {
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [-106.32058, 42.8436499] },
"properties": {
"city": "Casper",
"state": "WY",
"distance": { "unitCode": "wmoUnit:m", "value": 5191.2816909879 },
"bearing": { "unitCode": "wmoUnit:degree_(angle)", "value": 159 }
}
},
"forecastZone": "https://api.weather.gov/zones/forecast/WYZ020",
"county": "https://api.weather.gov/zones/county/WYC025",
"fireWeatherZone": "https://api.weather.gov/zones/fire/WYZ280",
"timeZone": "America/Denver",
"radarStation": "KRIW"
}
}
Loading

0 comments on commit b782ce7

Please sign in to comment.