• Stars
    star
    99
  • Rank 343,315 (Top 7 %)
  • Language
    C
  • License
    BSD 3-Clause "New...
  • Created about 15 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pure C implementation of the Geohash algorithm.

libgeohash

Derek Smith

A static library used for encoding/decoding geohashes.

To use libgeohash just run make. Link libgeohash.a and include geohash.h into your project.

Encode

char* geohash_encode(double lat, double lng, int precision);

Takes in latitude and longitude with a desired precision and returns the correct hash value. If precision < 0 or precision > 20, a default value of 6 will be used.

Decode

GeoCoord geohash_decode(char* hash);

Produces an allocated GeoCoord structure which contains the latitude and longitude that was decoded from the geohash. A GeoCoord also provides the bounding box for the geohash (north, east, south, west).

Neighbors

char** geohash_neighbors(char* hash);

Uses the bounding box declared at hash and calculates the 8 neighboring boxes. An example is show below.

  • ezefx ezs48 ezs49
  • ezefr ezs42 ezs43
  • ezefp ezs40 ezs41

The value returned is an array of char* with length of 8. The neighboring positions of values are shown below with each box representing the index of the array.

  • 7 0 1
  • 6 * 2
  • 5 4 3

More Repositories

1

polymaps

Polymaps is a free JavaScript library for making dynamic, interactive maps in modern web browsers.
JavaScript
1,601
star
2

SGAREnvironment

A location-based augmented reality environment for the iPhone.
Objective-C
139
star
3

python-simplegeo

A client interface for SimpleGeo's API.
Python
105
star
4

SimpleGeo.framework

Objective-C client library for SimpleGeo
Objective-C
84
star
5

python-geohash

SimpleGeo's fork of python-geohash (w/East-West fixes)
C++
56
star
6

jts

JTS Topology Suite
Java
48
star
7

Services_SimpleGeo

A PEAR package for SimpleGeo's API
PHP
41
star
8

betashapes

Python
41
star
9

java-simplegeo

A Java client library for SimpleGeo's API. Documentation located at https://ci.public.simplegeo.com/job/java-simplegeo/javadoc/
Java
33
star
10

thrift-fb303

Facebook's contrib fb303 library
C++
28
star
11

dream

Hyperminimal WSGI framework
Python
25
star
12

SimpleGeo-iOS

Objective-C
24
star
13

goldengate

Golden Gate is a cloud gateway.
Python
21
star
14

python-simplegeo-shared

Python
19
star
15

simplegeo-android-client

An Android client that interfaces with the SimpleGeo API
Java
18
star
16

python-geojson

A geojson library
Python
16
star
17

pyutil

A collection of functions and data structures that we've found useful over the years.
Python
15
star
18

SGARViewStyles

An example of stylizing and using the AR view included in SimpleGeo's iPhone SDK
C
14
star
19

rtree

Spatial indexing for Python
Python
14
star
20

SimpleGeo-Mac

Objective-C
13
star
21

kgio

kgio provides non-blocking I/O methods for Ruby
Ruby
13
star
22

pygeoip

A pure Python alternative to MaxMind's C-based Python API for binary GeoIP databases.
Python
13
star
23

spatialindex

A general framework for developing spatial indices.
C++
12
star
24

shapely

Geometric objects, predicates, and operations
Python
11
star
25

poster

Streaming HTTP uploads and multipart/form-data encoding
Python
11
star
26

python-simplegeo-places

Python SDK for Places service
Python
11
star
27

python-hbase-thrift

Debianized Egg of the Thrift client for HBase
Python
10
star
28

erlang

Erlang
9
star
29

simplegeo

NodeJS module for SimpleGeo
JavaScript
9
star
30

setproctitle

A setproctitle implementation for Python
C
9
star
31

django-simplegeo-demos

A demo Django application showing how to use SimpleGeo Context with Flickr's Panda API
Python
9
star
32

txoauth-OLD

oauth for Twisted
Python
9
star
33

hadoop-hbase

Java
8
star
34

simplegeo-dotnet

A .NET client for SimpleGeo
Visual Basic
8
star
35

simplegeo.js

JavaScript client for SimpleGeo
JavaScript
8
star
36

python-simplegeo-context

Python
7
star
37

sqlalchemy

Python
7
star
38

scribe

SimpleGeo Debian build of Scribe
C++
7
star
39

tillicum

Python
7
star
40

nginx

C
7
star
41

simplegeo-places-import

Python
6
star
42

greenlet

Lightweight in-process concurrent programming
C
6
star
43

clusto-sgext

SimpleGeo Clusto Extensions
Python
6
star
44

simplegeo-java-client

A Java HTTP client that accesses the SimpleGeo API
Java
6
star
45

zbase32

An alternate base32 encoder (not RFC 3548 compliant)
Python
6
star
46

thrift

A software framework for scalable cross-language services development.
C++
6
star
47

metartg

An rrdtool frontend for ganglia that doesn't suck
Python
5
star
48

rdialog

RDialog handles the interface between ruby scripts and dialog’s command-line interface.
Ruby
5
star
49

simplegeo-test-server

Ruby
5
star
50

SGObjCHTTP

Objective-C
4
star
51

fastercsv

A complete replacement for the standard Ruby CSV library
Ruby
4
star
52

yjpagent

Debianized YourKit Profiling Agent
4
star
53

hadoop

Java
4
star
54

puppet-postgresql

A Puppet module for managing postgres
Shell
4
star
55

authorize

A python library for interacting with authorize.net
Python
4
star
56

hadoop-pig

Java
4
star
57

trialcoverage

A plugin to integrate Twisted trial with Ned Batchelder's coverage.py
Python
4
star
58

django-storages

This is a clone of django-storages on bitbucket. DO NOT SUBMIT CODE FIXES/ISSUES HERE. Instead visit https://bitbucket.org/david/django-storages/issues?status=new&status=open
Python
4
star
59

setuptools-trial

Python
3
star
60

rabbitmq-server

Erlang
3
star
61

harrison

SimpleGeo's offline task system
JavaScript
3
star
62

ganglia

C
3
star
63

pylibmc

Ubuntuized pylibmc
C
3
star
64

webob

WebOb provides objects for HTTP requests and responses.
Python
3
star
65

nose

nose extends unittest to make testing easier
Python
3
star
66

ipaddr

Python
3
star
67

libmemcached

An open source C/C++ client library and tools for the memcached server
C
3
star
68

simplejson

Updated Debian packaging for simplejson
Python
3
star
69

simplegeo-blackberry-playbook-checkin

A sample checkin app using SimpleGeo on the Blackberry Playbook
ActionScript
2
star
70

elasticsearch-deb

ElasticSearch package for Debian/Ubuntu
Shell
2
star
71

django-south

Intelligent schema migrations for django apps
Python
2
star
72

decoroute

Pattern-matching based WSGI-compliant URL routing tool
Python
2
star
73

barker

Clive is a hive mind for your clusters.
Python
2
star
74

zbase62

Python
2
star
75

python-metar

2
star
76

wadl-library

Collection of WADL (Web Application Description Language) representations for APIs, extended for Apigee.
1
star
77

simplegeo-keyring

GPG keys for SimpleGeo packages
1
star
78

cobertura

A Java code coverage analysis tool
Java
1
star
79

python-txsimplegeo.shared

Python
1
star
80

lucene-solr-3.1

Java
1
star
81

python-coverage

Python
1
star
82

psycopg2

2.4.1
C
1
star
83

eventlet

Eventlet is a concurrent networking library for Python
Python
1
star
84

yjp-controller-api

1
star
85

importlib

Python
1
star
86

nodejs-pkg-tools

1
star
87

piro

Library and command-line tool for intelligently controlling services.
Python
1
star
88

unicorn

Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections.
Ruby
1
star