我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用google.appengine.ext.db.GeoPt()。
def safe_geopoint(geo_str): ''' geo_str as lat,lon returns a db.GeoPt if possible and if not None ''' gp = None if geo_str is None: return None try: gp = db.GeoPt(geo_str) except Exception, e: pass logging.error(str(e)) if gp and gp.lat == 0.0 and gp.lon == 0.0: gp = None return gp