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