【发布时间】:2016-03-20 03:44:48
【问题描述】:
我从 OpenStreetMap 下载了一些兴趣点数据,结果发现这些位置以 HEXEWKB 格式编码:
CSV fields
==============================================
1 : Node type; N|W|R (in upper case), wheter it is a Node, Way or Relation in the openstreetmap model
2 : id; The openstreetmap id
3 : name; The default name of the city
4 : countrycode; The iso3166-2 country code (2 letters)
5 : alternatenames; the names of the POI in other languages
6 : location; The middle location of the POI in HEXEWKB
7 : tags; the POI tags : amenity,aeroway,building,craft,historic,leisure,man_made,office,railway,tourism,shop,sport,landuse,highway separated by '___'
我需要将这些转换为经度/纬度值。之前针对 Java 语言 (How to convert HEXEWKB to Latitude, Longitude (in java)?) 提出了同样的问题,但是我需要 Python 解决方案。
到目前为止,我的尝试一直集中在尝试使用 GeoDjango 的 GEOS 模块 (https://docs.djangoproject.com/en/1.8/ref/contrib/gis/geos/#creating-a-geometry),但由于我没有在我的应用程序中使用 Django,这感觉有点像过冲。有没有更简单的方法?
【问题讨论】:
-
规范简介en.wikipedia.org/wiki/Well-known_text#Well-known_binary 包括指向 PyGeoIf pypi.python.org/pypi/pygeoif 的链接
-
休,谢谢你的建议。不幸的是,pygeoif 似乎只能处理众所周知的文本格式的位置,而我的数据似乎是 HEXadecimal Extended Well-Known Binary (HEXEWKB)。
标签: python gis openstreetmap latitude-longitude