-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filtering available for timeseries with predefined regions
- Loading branch information
1 parent
4afc36c
commit c49f6ec
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
17 changes: 17 additions & 0 deletions
17
...ts-common/imports/startup/server/matsMiddle/sqlTemplates/tmpl_get_stations_for_region.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
SELECT RAW s.name | ||
FROM {{vxDBTARGET}} s | ||
JOIN {{vxDBTARGET}} bb ON | ||
(s.geo[0].lat BETWEEN bb.geo.bottom_right.lat AND bb.geo.top_left.lat) AND | ||
(CASE WHEN bb.geo.top_left.lon < bb.geo.bottom_right.lon THEN | ||
s.geo[0].lon BETWEEN bb.geo.top_left.lon AND bb.geo.bottom_right.lon ELSE | ||
s.geo[0].lon > bb.geo.top_left.lon OR s.geo[0].lon < bb.geo.bottom_right.lon END) | ||
WHERE bb.type="MD" | ||
AND bb.docType="region" | ||
AND bb.subset='COMMON' | ||
AND bb.version='V01' | ||
AND bb.name="{{vxREGION}}" | ||
AND s.type="MD" | ||
AND s.docType="station" | ||
AND s.subset='METAR' | ||
AND s.version='V01' | ||
ORDER BY s.name |
This file contains 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