アーカイブ

2009 年 5 月 22 日 のアーカイブ

WebMapServiceでGIS

2009 年 5 月 22 日
コメントは受け付けていません。

GoogleMapのような地図のレンダリング機能が欲しくなりました。

しかもPythonで。

検索するとすぐ発見。

OwsLib。

インストールも簡単

sudo easy_install OWSLib

ちなみに、easy_installが使えない人は、先に以下のコマンドを実行。(Ubuntuでの話)

sudo apt-get install python-setuptools

さて、OWSLibの公式サイトに書いてあるスクリプトをチョロッと改造して、

東京近辺の地図を出してみました。

nasaが持っている地図から取得。

#!/usr/bin/env python
# -*- coding:UTF-8 -*-

from owslib.wms import WebMapService
wms = WebMapService("http://wms.jpl.nasa.gov/wms.cgi", version="1.1.1")
img = wms.getmap(       layers=['global_mosaic'],
                        styles=['visual_bright'],
                        srs='EPSG:4326',
                        bbox=(139.25, 35.25, 140.25, 36.25),
                        size=(640, 640),
                        format='image/jpeg',
                        transparent=True
                        )
out = open('tokyo_1.jpg', 'wb')
out.write(img.read())
out.close()

実行すると、tokyo_2.jpgファイルが作成されます。

こんな感じ。

tokyo_1

簡単ですね。

WMSのサイトを変えて、日本の国土地理院の行政区画の区分地図を取得。

#!/usr/bin/env python
# -*- coding:UTF-8 -*-

from owslib.wms import WebMapService
wms = WebMapService("http://www.finds.jp/ws/kiban25000wms.cgi", version="1.1.1")
img = wms.getmap(       layers=['AdmArea'],
                        srs='EPSG:4326',
                        bbox=(139.25, 35.25, 140.25, 36.25),
                        size=(640, 640),
                        format='image/jpeg',
                        transparent=True
                        )
out = open('tokyo_2.jpg', 'wb')
out.write(img.read())
out.close()

tokyo_2

これも簡単。

admin python, プログラム小技

テキサス お弁当

2009 年 5 月 22 日
コメントは受け付けていません。

西新宿は新宿野村ビルのB2にある「テキサス」というステーキハウスで、土曜の夜は肉食べ放題もやってます。
店舗情報はこちらステーキ弁当

お弁当はお昼時しかやってません。無くなり次第終了です。

ステーキ弁当、しょうが焼き弁当、牛カルビ弁当があります。
どれでも500円です。

ステーキ屋さんだけあってさすがに肉は美味しい。
時間あるならお店で暖かいランチ500円~をどうぞ

 

写真はステーキ弁当

新宿野村ビルの地下2階です。

東京都新宿区西新宿1丁目26−2

水奉行 西新宿弁当マップ