jacky

A technique blog for jacky

here are my artitles about work(embeded system develop, docker, etc.) and life(cook, hiking)


How to convert hgt to osm

#how to convert hgt from SRTM to osm

tools used:phyghtmap homePage manPage

###environment reference:ubuntu16.04+python3.5

Download

At the moment, you have the choice between two different distribution types:

Dependencies

I tested the installation process under Windows. If you want to install phyghtmap on a Windows machine, go down to the Windows installation section.

The installation process requires python3 and a working python3 setuptools installation.

  • python3-setuptools, if you want to install from the source distribution (on Debian-like systems, say apt-get install python3-setuptools, but I guess you want to use the Debian package instead. For other operating systems, have a look here)

The program itself should run with python >= 3.0 (Windows users, take a look here). Some additional dependencies have to be installed on your system in order to run phyghtmap:

  • python3-matplotlib (on Debian-like systems, say apt-get install python3-matplotlib; Windows users, have a look here)
  • python3-bs4 (on Debian-like systems, say apt-get install python3-bs4
  • python3-numpy (on Debian-like systems, say apt-get install python3-numpy; Windows users, have a look here)
  • python3-gdal (since version 1.70; if you don’t want to use GeoTiff input files, you may be happy withput python-gdal; on Debian-like systems, say apt-get install python3-gdal).

Installation

Source Distribution

If you are not running a Debian-like system, you will want to have the source distribution. This is especially true, if you want to use phyghtmap on a Windows machine. If so, go down to the seperate Windows installation section.

To install phyghtmap, unpack the source file, chdir to the unpacked source directory and then say

sudo python3 setup.py install

which will install the stuff on your system.

If you are not a Windows user and have no sudo installed, I guess you know what to do.

If you don’t have the permissions to globally install phyghtmap but want to use it anyway, you may want to set up a virtual python environment and install phyghtmap there. If so, take a look here.

usages:

i.e. convert a folder of hgt files to one osm file

phyghtmap -s 5 --start-node-id=NODE-ID --start-way-id=WAY-ID --max-nodes-per-tile=0 <your hgt files>

start-node-id = $((1 « 33))

start-way-id = $((1 « 33))

最近的文章

How to import contour line to libosmscout

how to import contour line to libosmscoutreferencePageflag:elevationContourwhen we get .osm file from hgt, then we can import osm with *.osm.pbf to libosmscout../Import --typefile ../../stylesheets/map.ost --destinationDirectory \ ../../maps/demCh...…

继续阅读
更早的文章

使用zonedetect获取当前位置的时区

使用zoneDetect获取当前位置的时区获取时区的方案分为在线版和离线版,在嵌入式设备上一般使用离线版本。参考信息如下:Time Zone Location Web Services Google Maps Time Zone API Microsoft Azure Maps Time Zone API GeoNames Time Zone API TimeZoneDB API AskGeo - commercial (but arguably more accurate th...…

继续阅读