谢谢!
解决方法 我对geomodel有同样的问题.为了更正,我使用4的分辨率,我使用 python排序和过滤器.
SEARCHED_LOCATION = db.GeoPt("48.8566667,2.3509871") # Location of Paris.disTANCE = 50000 #Between 10000 and 150000.MAX_RESulTS = 300# Resolution '4' is about 150 kilometers i suppose it's a good compromise. bBox = geocell.compute_Box(geocell.compute(SEARCHED_LOCATION,resolution=4))cell = geocell.best_bBox_search_cells(bBox,geomodel.default_cost_function)query.filter('location_geocells IN',cell)# Python filtersdef _func(x): """Private method used to set the distance of the model to the searched location and return this distance. """ x.dist = geomath.distance(SEARCHED_LOCATION,x.location) return x.distresults = sorted(query.fetch(MAX_RESulTS),key=_func) # Order the result by distanceresults = [x for x in results if x.dist <= disTANCE] # Filter the result总结
以上是内存溢出为你收集整理的Python GeoModel替代方案全部内容,希望文章能够帮你解决Python GeoModel替代方案所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)