用于与geohash交互的python库。

libgeohash的Python项目详细描述


libgeohash

用于与geohashes交互的python库。

库分为3个模块:

  • geohash\u base:用于与geohash交互的基函数,例如encodedecodeneighborsbbox等。
  • 距离度量:与距离相关的函数,例如distancedimensions等。
  • geometry:将多边形转换为geohash列表的函数,反之亦然。例如polygon_to_geohashgeohash_to_polygon。用地理差近似地理区域是有用的。使用shapely库进行几何计算。

安装

Linux和Mac用户可以通过PIP安装软件包。

$ pip install libgeohash

使用量

>>>importlibgeohashasgh>>>gh.encode(57.64911,10.40744,precision=10)'u4pruydqqv'>>>gh.decode('u4pruydqqv',errors=True)(57.64911264181137,10.407437682151794,2.682209014892578e-06,5.364418029785156e-06)>>>gh.neighbors('u4pruydqqv'){'ne':'u4pruydqrn','e':'u4pruydqrj','n':'u4pruydqqy','se':'u4pruydqrh','w':'u4pruydqqt','sw':'u4pruydqqs','nw':'u4pruydqqw','s':'u4pruydqqu'}# Returns dimensions of the bounding box referred by the geohash in meters. (width, height)>>>gh.dimensions('u4pruyd')(152.9,152.4)# Returns the great circle distance (Haversine) between two geohashes or coordinates. >>>gh.distance('u4pruyd','u4pruyg')173.19066702376304
  • 有关更多函数及其用法,请参阅doc字符串。

已知问题

如果您碰巧发现任何其他bug,请在问题部分报告它们。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何在java中调用Paint组件方法   多层次POM中的java覆盖依赖项/插件管理   java模式识别   JavaSpringMVC+Log4j2定义了Log4j2。未标识非类路径位置中的属性文件   java我们如何将IntelliJ IDEA中的maven和gradle项目与源代码浏览支持集成?   Maven mvn exec:java在Windows上工作,但不是Ubuntu 20   java在Jaxb2Marshaller上使用带有packagesToScan属性的JAXBElement时没有端点适配器   java删除方法和节点   java如何为某些场景创建正则表达式模式   java如何通过gridView中的intent()传递ArrayList数据。setOnItemClickListener()   java UnsupportedClassVersionError 1.7/1.5   java为什么JVM参数是http。tomcat servlet没有使用proxyHost?   java将ArrayList从字母顺序排序到最频繁/最不频繁   java动态字段列表迭代   java如何将字节转换为位?   hadoop java。mapreduce作业中的lang.NullPointerException   javasocketIO无法与Android中的LocationListener一起使用   java在卸载时清除内部存储   java池回收错误2个精灵同时碰撞到一个精灵