geo_python package¶
Submodules¶
geo_python.exc module¶
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
-
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