-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOGR_TZCheck.tcl
More file actions
47 lines (39 loc) · 1.08 KB
/
Copy pathOGR_TZCheck.tcl
File metadata and controls
47 lines (39 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
# the next line restarts using tclsh \
exec $SPI_PATH/tclsh "$0" "$@"
#============================================================================
# Environnement Canada
# Centre Meteorologique Canadien
# 2100 Trans-Canadienne
# Dorval, Quebec
#
# Projet : Exemple de scripts.
# Fichier : OGR_TZCheck.tcl
# Creation : Mars 2006 - J.P. Gauthier - CMC/CMOE
# Description: Determiner le TimeZone d'une coordonee
#
# Parametres :
#
# Retour:
#
# Remarques :
#
#============================================================================
package require TclData
#package require TclGeoEER
package require Logger
Log::Start [info script] 0.1
proc TimeZoneCheck { Lat Lon } {
set tz 999
if { [llength [set idx [ogrlayer pick TZ [list $Lat $Lon]]]] } {
set tz [ogrlayer define TZ -feature $idx ZONE]
}
return $tz
}
#----- Open the TZ file
set layer [ogrfile open OGRFILE read $env(CI_DATA_IN)/timezone.shp]
eval ogrlayer read TZ [lindex $layer 0]
ogrfile close OGRFILE
#----- Get the TZ for a latlon
Log::Print INFO "TimeZone is: [TimeZoneCheck 65.10 -123.3]"
Log::End