Class Kronolith_Geo_Mysql
Mysql implementation for storing/searching geo location data for events.
Makes use of the GIS extensions available in mySQL 4.1 and later.
Copyright 2009-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
-
Kronolith_Geo_Base
-
Kronolith_Geo_Sql
-
Kronolith_Geo_Mysql
Methods summary
public
|
#
setLocation( string $event_id, array $point )
Set the location of the specified event _id
Set the location of the specified event _id
Parameters
- $event_id
- The event id
- $point
- Hash containing 'lat' and 'lon' coordinates
Throws
See
Kronolith_Geo_Base#setLocation()
Overrides
|
public
array
|
#
getLocation( string $event_id )
Get the location of the provided event_id.
Get the location of the provided event_id.
Parameters
Returns
array A hash containing 'lat' and 'lon'
Throws
See
kronolith/lib/Driver/Kronolith_Driver_Geo#getLocation($event_id)
Overrides
|
public
array
|
#
search( array $criteria )
Search for events "close to" a given point.
Search for events "close to" a given point.
TODO: If all we really use the geodata for is distance, it really doesn't make sense to use the GIS extensions since the distance calculations are done with Euclidian geometry ONLY ... and therefore will give incorrect results when done on a geocentric coordinate system... They might be useful if we eventually want to do searches on MBRs
Parameters
- $criteria
- An array of:
<pre>point - lat/lon <span class="php-keyword2">hash</span>
radius - the radius to search in
limit - limit the number of hits
factor - Conversion factor <span class="php-keyword1">for</span> miles per distance unit [<span class="php-keyword1">default</span> is <span class="php-num">69</span>].</pre>
Returns
array of event ids with locations near the specified criteria.
Throws
See
kronolith/lib/Driver/Kronolith_Driver_Geo#search($criteria)
Overrides
|