objc-geohash

by lyokato

lyokato / objc-geohash

Objective-C GeoHash Library

130 Stars 24 Forks Last release: Not found MIT License 29 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

=======================================================================

INSTALL

Copy all files under 'Classes/ARC' or 'Classes/NonARC' directory into your project.

=======================================================================

USAGE

import "GeoHash.h"

/* Get GetHash by latitude, longitude, and hash-length */

NSString *hash = [GeoHash hashForLatitude:35.6894875 longitude:139.6917064 length:13];

/* hash equals to @"xn774c06kdtve" */

/* Decode GeoHash and get an area which the hash indicates */

GHArea *area = [GeoHash areaForHash:@"c216ne"];

area.latitude.max area.latitude.min area.longitude.max area.longitude.min

/* Adjacent / NSString *adjacentHash = [GeoHash adjacentForHash:@"dqcjq" direction:GHDirectionNorth]; / @"dqcjw" */

GHNeighbors *neighbors = [GeoHash neighborsForHash:@"dqcw5"];

neighbors.north neighbors.south neighbors.east neighbors.west neighbors.northEast neighbors.northWest neighbors.southEast neighbors.southWest

/* check invalid hash */ if (![GeoHash verifyHash:@"[email protected]"]) { ... }

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.