# libgeohash **Repository Path**: ticpas/libgeohash ## Basic Information - **Project Name**: libgeohash - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-29 - **Last Updated**: 2021-07-29 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ======================================================================= INSTALL ======================================================================= 1. cd build 2. cmake .. -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release parameters - BUILD_SHARED_LIBS (ON|OFF) - CMAKE_BUILD_TYPE (Debug|Release) - CMAKE_INSTALL_PREFIX (/usr/local) 3. make 4. make test 5. make install Or just simply, perl ./scripts/install ======================================================================= USAGE ======================================================================= #include /* Get Hash */ char *hash; hash = GEOHASH_encode(latitude, longitude, length); ... free(hash); /* Get Area by Hash */ GEOHASH_area *area; area = GEOHASH_decode("dqcw5"); /* You can get the range of both latitude and longitude area->latitude.max; area->latitude.min; area->longitude.max; area->longitude.min; */ GEOHASH_free_area(area); /* Get Adjacent Hash by Origin's Hash and Direction*/ char *adjacent_hash; /* You can choose direction from GEOHASH_NORTH, GEOHASH_SOUTH, GEOHASH_EAST, and GEOHASH_WEST */ adjacent_hash = GEOHASH_get_adjacent("dqcw5", GEOHASH_NORTH); ... free(adjacent_hash); /* Get Neighbors' Hash by Origin's Hash */ GEOHASH *neighbors; neighbors = GEOHASH_get_neighbors("dqcw5"); /* You can get hashes of each direction's neighbor neighbors->north; neighbors->north_east; neighbors->north_west; neighbors->south; neighbors->south_east; neighbors->south_west; neighbors->east; neighbors->west; */ GEOHASH_free_neighbors(neighbors);