geo_python package

Submodules

geo_python.exc module

exception geo_python.exc.InvalidPointError[source]

Bases: exceptions.Exception

Generic error class

geo_python.geo_python module

class geo_python.geo_python.MetaPoint[source]

Bases: type

The metaclass of Point

redis_store = StrictRedis<ConnectionPool<Connection<host=localhost,port=6379,db=0>>>
class geo_python.geo_python.Point(longitude, latitude, member)[source]

Bases: object

classmethod create(longitude, latitude, member)[source]

Create a new Point instance

Args:

longitude(float): the point’s longitude

latitude(float): the point’s latitude

member(string): member

delete()[source]

Delete this point

classmethod dist(point1, point2)[source]

Calculate the distance between point1 and point2

Args:

point1(subclass of Point): a point.

point2(subclass of Point): another point.

geo_hash()[source]

The hash of this point, can be view on http://geohash.org/<geohash-string>

classmethod get_by_member(member)[source]

Get a Point instance by its member

Args:

member(string): member
classmethod query_by_member(member, dist=100, unit='m')[source]

Query points by member

Args:

member(string): the point’s member

dist(float): the radius of the circle

unit(string): m, km or other, the unit of the dist

classmethod query_by_pos(longitude, latitude, dist=100, unit='m')[source]

Query points by position

Args:

longitude(float): the center’s longitude

latitude(float): the center’s latitude

dist(float): the radius of the circle

unit(string): m, km or other, the unit of the dist

update(**kwargs)[source]

Update this point

Args:

longitude(float): the point’s longitude

latitude(float): the point’s latitude

member(string): member

Module contents