Skip to content

Methods

Alex-Kent edited this page Apr 6, 2019 · 13 revisions

Click on any method name for more details.

Indexing

$index = Geo::Index->new();
Create a new empty index using default options:
Radius and circumferences are those of Earth, levels is set to 20 (~40 m index resolution).

$index = Geo::Index->new( \@points );
Create a new index using default options and populate it with the given points.

$index = Geo::Index->new( \%options );
Create a new empty index using specified options.

$index = Geo::Index->new( \@points, \%options );
Create a new index using specified options and populate it with the given points.

$index->IndexPoints( \@points );
Add points in list to the index

$index->Index( \%point );
$index->Index( \@point );
Add a single point to the index

$index->DeletePointIndex( \%point );
Delete specified point from index

Searching

@results = $index->Search( \%point, \%options );
$results_ref = $index->Search( \%point, \%options );
Search index for points near a given point

@results = $index->SearchByBounds( \@bounds, \%options );
@results = $index->SearchByBounds( \%bounds, \%options );
$results = $index->SearchByBounds( \@bounds, \%options );
$results = $index->SearchByBounds( \%bounds, \%options );
Search index for points within a given bounding box

@results = $index->Closest( \%point );
$results = $index->Closest( \%point );
@results = $index->Closest( \%point, \%options );
$results = $index->Closest( \%point, \%options );
@results = $index->Closest( \%point, $number_of_points_desired );
$results = $index->Closest( \%point, $number_of_points_desired );
@results = $index->Closest( \%point, $number_of_points_desired, \%options );
$results = $index->Closest( \%point, $number_of_points_desired, \%options );
Find the point or points closest to a given point

@results = $index->Farthest( \%point );
$results = $index->Farthest( \%point );
@results = $index->Farthest( \%point, \%options );
$results = $index->Farthest( \%point, \%options );
@results = $index->Farthest( \%point, $number_of_points_desired );
$results = $index->Farthest( \%point, $number_of_points_desired );
@results = $index->Farthest( \%point, $number_of_points_desired, \%options );
$results = $index->Farthest( \%point, $number_of_points_desired, \%options );
Find the point or points farthest from a given point

@all_points = $index->AllPoints( );
$all_points = $index->AllPoints( );
Returns all points currently in index

Distance and measurement

$meters = $index->Distance( \%point_1, \%point_2 );
$meters = $index->Distance( \@point_1, \@point_2 );
$meters = $index->Distance( \%point_1, \@point_2 );
$meters = $index->Distance( \@point_1, \%point_2 );
Returns the distance in meters between two points

$meters = $index->DistanceFrom( \%point_1 );
$meters = $index->DistanceFrom( \@point_1 );
Set an initial point to measure distances from

$meters = $index->DistanceTo( \%point_2 );
$meters = $index->DistanceTo( \@point_2 );
Returns the distance in meters between the specified point and the one set earlier with DistanceFrom(...).

( $meters_ns, $meters_ew ) = $index->OneDegreeInMeters( $latitude_radians );
Returns length in meters of one degree (N/S and E/W) at given latitude

( $degrees_ns, $degrees_ew ) = $index->OneMeterInDegrees( $latitude_radians );
Returns length in degrees of one meter (N/S and E/W) at given latitude

Metadata

%configuation = $index->GetConfiguration( );
Returns the running configuration of the Geo::Index object.

@stats = $index->GetStatistics( );
Returns statistics regarding the Geo::Index object.

Miscellaneous

$index->Sweep( );
$index->Sweep( \%point );
$index->Sweep( \@points );
Remove data generated by searches from some or all points

$index->Vacuum( );
$index->Vacuum( \%point );
$index->Vacuum( \@points );
Remove all data generated by Geo::Index from some or all points

$count = $index->PointCount( );
Returns the number of points currently in index

Clone this wiki locally