2018年9月21日金曜日

Rust & Neusiedlersee

ノイジードル湖というハンガリーとの国境にある湖に行ってきました。
最寄りの町の一つがRustというのですが、ワインで有名です。
Hauptbanhofから200番のバスで直通(途中Eisenstadtで285番に変わる)か、Eisenstadtで乗り換えです(285, 286)。
200番のバスが町中を走るような普通のバスなので、2時間かかることを考えるとちょっとシンドイ。
我々は帰りはEisenstadtで電車に乗り換えました。

Rustは街としては小さくて30分もあれば全部歩き回れるようなところですが、教会に登ったりワイナリーを巡ったりで一日時間を潰せます。
次回は是非泊まりたい。

レストランはワイナリー併設でホテルも経営してるらしい、Peter Schandlがイチオシ
(トリップアドバイザー)




Laplace's method

https://en.m.wikipedia.org/wiki/Laplace%27s_method

メモ。

2018年9月13日木曜日

xiaomi mi a1 + insta 360air

3Kビデオがコマ落ちするので、Samsung の良いSDカード買ってみたけど、どうも本体の性能(CPU?)が足りてないみたいで結局コマ落ちした。2.5Kで我慢。

Samsung EVO Plus Micro SDXC 128GB bis zu 100MB/s, Class 10 U3 Speicherkarte (inkl. SD Adapter) rot/weiß
by A-MONTAIN
Learn more: https://www.amazon.de/dp/B06XFHQGB9/ref=cm_sw_em_r_mt_dp_U_ptPMBbC1M0D7A

defaultdict

pythonで、list = [(a,1.0),(a,2.0),(b,3.0),(c,4.0)] のようなデータがあったときに、

a = [1.0, 2.0]
b = [3.0]
c = [4.0]
と整形したい。

from collections import defaultdict を使うときれいにかけて、

dict = defaultdic(list)
for i in list:
   dict[i[0]].append(i[1])

とやると、a, b, cがkeyになった辞書ができあがる。
naiveにやると二重ループになってlistが巨大なときに大変だし予めソートかけておくのも回りくどいので。




2018年9月10日月曜日

ヴァッハウ渓谷(メルク修道院+デュルンシュタイン)

日曜日に、ヴァッハウ渓谷に行ってきました。

westbanhofのカウンターでrail tours Wachau ticket (59 EUR)を購入。
Melk修道院のチケットと、MelkからKremsまでの船のチケット込。
9時20分発のREX1908でMelkまで行き、修道院+庭を散策。
13:50分の船でデュルンシュタインに向かう(途中下船)。
デュルンシュタインでは、城跡まで登る。(2つ登山口があって、我々はきつい方から登って、ゆるい方から降りてきた。ゆるい方なら割と整備はされているが、靴はしっかりしたものが必要。ゆっくり歩いて片道30分ぐらいが目安)
会社の同僚とばったり遭遇した。子供を遊ばせているんだと言っていたが、子連れで来て楽しい場所なのかな?という疑問はある。

17:50分の船でデュルンシュタインからクレムスに向かうが、船がかなり遅れた上、クレムスの船着き場から駅までがかなり遠いので狙っていた18:20の電車は逃す。
(バスで多分停留所2個分。ヘロヘロになってたとは言え10~20分ぐらいは歩いてたと思う)
結局19:14の電車でSt. Poeltenに行って乗り換えてWestbanhof到着。
Vapianoで夕食にして帰宅。


メルク修道院付属の庭。奥の建物でお茶をするべき。向かって右の部屋まで行くのが良い。

デュルンシュタインのお城跡で全方位カメラの撮影。
Google photoで閲覧

2018年9月3日月曜日

Miniconda(python2.7) + mod_wsgi on Centos6

Because the default python on Centos6 is too old, I need to use python2.7 for mapproxy.
so, I install miniconda2.
Mapproxy should work with apache, but using mod_wsgi with miniconda2 is a bit complicated.

I am describing a rough procedure:

% cd /opt/mapproxy
%  wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
% sh Miniconda2-latest-Linux-x86_64.sh
(answer questions, “yes”, “/opt/mapproxy/miniconda2”, “no”)
% miniconda2/bin/pip install mod_wsgi
% miniconda2/bin/pip install mapproxy
% miniconda2/bin/mod_wsgi-express install-module
% vi /etc/httpd/conf/httpd.conf
LoadModule wsgi_module modules/mod_wsgi-py27.so

% chmod –R 755 /opt/mapproxy/miniconda2/

Some other configs:
WSGIScriptAlias /mapproxy /opt/mapproxy/config.py
WSGIPythonHome /opt/mapproxy/miniconda2/
WSGIApplicationGroup %{GLOBAL}
WSGISocketPrefix /var/run/wsgi
WSGIDaemonProcess mysite python-path=/opt/mapproxy/miniconda2/lib/python2.7/site-packages

cache elevation data of world wind java using mapproxy

I finally find a way to cache the elevation data of world wind java with mapproxy.
Old version of mapproxy did not handle tiff 16bit, and mapproxy-1.11 with pillow-5.2 do.

Keypoints:
1. get elevation tiles in image/tiff
2. store the tiles in image/png, mode I
3. deliver the tiles in image/ppm

==mapproxy.yaml==
layers:
  - name: Elev
    title: NASA_SRTM30_900m_Tiled in TIFF
    sources: [Elev_cache]

caches:
  Elev_cache:
    sources: [Elev_wms]
    format: png16
    request_format: image/tiff
    grids: ['Elev_grid']
    image:
      resampling_method: bicubic
    cache:
       type: sqlite
       directory: /opt/mapproxy/cache/elev


sources:
   Elev_wms:
      type: wms
      supported_srs: ['EPSG:4326']
      wms_opts:
        version: 1.3.0
      req:
         url: https://worldwind26.arc.nasa.gov/elev
         layers: NASA_SRTM30_900m_Tiled

grids:
  Elev_grid:
    srs: EPSG:4326
    num_levels: 12
    origin: nw

globals:
  # image/transformation options
  image:
      paletted: False
      formats:
         png16:
            format: image/png
            mode: I
==end mapproxy.yaml==

And EarthElevations2.xml  can be used with the changes:
        <ImageFormat>image/ppm</ImageFormat>
        <DataType type="Int16" byteOrder="LittleEndian"/> 
        <FormatSuffix>.ppm</FormatSuffix>