Public Member Functions | |
| __construct ($inDBObject) | |
| get_tz ( $in_lng, $in_lat) | |
Public Attributes | |
| $db_object | |
Private Member Functions | |
| _find_in_polygons ($candidates, $longitude, $latitude) | |
Static Private Member Functions | |
| static | _wn_PackedPoly ($longitude, $latitude, $polygon) |
This class is a lookup class.
It queries the database, and returns the timezone that corresponds to the provided longitude, latitude pair.
Definition at line 40 of file LGV_TZ_Lookup_Query.class.php.
| LGV_TZ_Lookup_Query::__construct | ( | $inDBObject | ) |
The constructor.
| $inDBObject | An initialized database instance for this handler. |
Definition at line 51 of file LGV_TZ_Lookup_Query.class.php.
|
private |
Fetch compact polygons and stop at the first match, without expanding all candidates into PHP point arrays.
Definition at line 98 of file LGV_TZ_Lookup_Query.class.php.
Referenced by get_tz().
|
staticprivate |
The winding-number algorithm courtesy of San Zhujun (https://gist.github.com/zhujunsan/81d6a2f05d590f618a5ad36f25666fc2), operating on the existing packed native-double format with the same edge/vertex comparisons. Decode 1,024 points at a time: per-point unpack calls are expensive, while unpacking an entire large polygon creates a large PHP hash table. Carry the preceding point across blocks, including the closing edge.
Definition at line 119 of file LGV_TZ_Lookup_Query.class.php.
| LGV_TZ_Lookup_Query::get_tz | ( | $in_lng, | |
| $in_lat ) |
This queries the database, and returns the TZ.
| $in_lng | The longitude |
| $in_lat | The latitude |
Definition at line 62 of file LGV_TZ_Lookup_Query.class.php.
References _find_in_polygons().
| LGV_TZ_Lookup_Query::$db_object |
The database object we're accessing.
Definition at line 45 of file LGV_TZ_Lookup_Query.class.php.