2024,江端さんの忘備録

以前、後輩から「システム論に関する輪講をするので、教本を紹介して下さい」と言われたことがありました。

A junior asked me to introduce a textbook for a round-robin reading about system theory.

UNIXの概念というと、ファイルであろうが、メッセージであろうが、ソケットであろうが、『結局は「出口」と「入口」だけだろう?』 という、あの哲学に触れた時には、震撼しましたねぇ。「美しい」と思いました。たぶん、哲学とはそういうものなのだろう、と思います。

「輪講(りんこう)」とは、主に大学や研究機関で行われる共同学習の形式の一つで、特定の書籍や論文などの資料を参加者が順番に担当し、他の参加者に向けて発表しながら解説するスタイルの講義やセミナーです。

"Round-robin reading" is a form of collaborative learning mainly carried out at universities and research institutions. It is a style of lecture or seminar in which participants take turns presenting and explaining specific books, papers, or other materials to the other participants.

私は「輪講」を否定するものではありませんが、私は、常日頃から『本を読むだけに時間を費やすのは、どうなのかなぁ』と思っています。

I'm not against “round-robin reading,” but I always wonder whether spending all your time reading books is a good idea.

-----

私なら、『ラズパイで自宅の監視システムを作ってこい』とだけ言って、そのまま3ヶ月ほど放置します(「監視システム」でなくても、「DBサーバシステム」でも、「自動応答サーバ」でも「なんちゃってTwitter」でも何でもいい)。

If it were me, I would say, “Go and make a home surveillance system using the Raspberry Pi,” and then leave it alone for about three months (it doesn't have to be a “surveillance system” it could be a “database server system,” an “automatic response server,” a “fake Twitter,” or anything else).

「自作するシステムの規模や性能は機能は、自分で勝手に決めて良い」「信頼性もどうでも良い」とします。

They can decide the scale, performance and functions of the system they create themselves, and “reliability is also unimportant”.

完成の条件は『動いていること』であり、完了の条件は『私(江端)に見せる』です。

The condition for completion is 'being in motion', and the condition for completion is 'showing it to me (Ebata)'.

上記の監視システムで必要となる技術は、私が思いつくだけでも、(1)ハードウェア設定技術、(2)カメラ接続技術、(3)ストレージ管理技術、(4)OSセットアップ技術、(5)映像ストリーミング技術、(6)録画管理技術、(7)動体検知技術、(8)画像認識技術、(9)ネットワークカメラ統合技術、(10)ネットワーク構築技術、(11)セキュリティ対策技術、(12)通知システム連携技術、(13)クラウド連携技術、(14)ホームオートメーション統合技術、(15)電源管理技術、そして、(16)プログラミング技術です。

Just thinking of the technologies required for the above monitoring system, I can think of (1) hardware configuration technology, (2) camera connection technology, (3) storage management technology, (4) OS setup technology, (5) video streaming technology, (6) recording management technology, (7) motion detection technology, (8) image recognition technology, (9) network camera integration technology, (10) network construction technology, (11) security countermeasure technology, (12) notification system linkage technology, (13) cloud linkage technology, (14) home automation integration technology, (15) power supply management technology, and (16) programming technology.

その技術(特にラズパイに関するもの)の多くは、ネットワークに大量に資料が転がっています。私なら、『本を読むより、ネットの情報をパクりまくれ』といいます。

There is much information about this technology (mainly Raspberry Pi) on the internet. I would say, “Instead of reading books, just copy the information from the internet.”

システムは動かしてナンボです。教本を100冊読んだって、システムは1mmも動きません。

A system that doesn't move is useless. Even if you read 100 textbooks, the system won't move even 1mm.

-----

それが、全員分終った後なら、私は「輪講」をやってもいいと思います。

If they've finished with everyone, I think doing a “round-robin-reading” style would be okay.

こうすれば、「システム論」の理解は、このプロセスを経ない場合より、100~1000倍ほど理解が深まるはずですから。

This way, their understanding of “systems theory” will be 100 to 1000 times deeper than if they don't go through this process.

-----

まあ、これは私のやり方であって、他の人とは違うかもしれませんが、私の場合

Well, this is my way of doing things, and it may be different from other people's, but in my case

『先ずは、ショボいシステムを、作って動かしてみる』

'First, I'll make a shoddy system and try running it.

が、技術習得の最短距離です。

is the fastest way to learn a skill.

 

 

 

 

 

 

未分類

1. iPhone上で直接削除する方法
写真アプリを開く: iPhoneの「写真」アプリを起動します。

「アルバム」タブに移動する: 下部の「アルバム」タブを選択し、「すべての写真」を開きます。

写真をまとめて選択する: 画面右上の「選択」をタップし、削除したい写真を手動で選択します。 すべての写真を削除する場合、指をスライドさせると多数の写真を一度に選択できます。

削除ボタンを押す: 右下にあるゴミ箱のアイコンをタップして削除を選択します。

「最近削除した項目」から完全に削除する: これだけでは完全に削除されていないので、「アルバム」→「最近削除した項目」に移動し、右上の「選択」→「すべて削除」をタップして完全に削除します。

未分類

私がこれまで行ってきたChatGPTに対する質問の内容から導かれる、私のパーソナリティを客観的に記述して下さい

あなたがこれまで検索・質問してきた内容や興味を持っているトピックから、以下のようなパーソナリティが客観的に導かれます。

1. 技術的な問題解決能力と探求心
- あなたは高度な技術問題に対処しており、特にプログラミング、ネットワーク設定、エージェントシミュレーション、仮想化、ストリーム処理など、幅広い技術分野に関心を持っています。また、RTSPストリーミング、マルチエージェントシミュレーションなどの先進的な技術を実装する際、具体的かつ実践的な解決策を求めています。
- あなたはGo言語やC言語のプログラミング、ネットワークストリーミングなど、専門的な技術分野に深く関わっているため、問題解決に対して非常にロジカルなアプローチを取っていると推測されます。また、実際の動作やパフォーマンス確認を重視していることから、実務的な結果を求めて行動する傾向があります。

2. 論理的思考と効率性重視
- あなたは複雑な問題をシンプルに解決しようとする傾向があり、プログラムの修正や最適化、また文章の簡潔さを常に重視しています。また、情報の過剰な繰り返しを避け、余計な表現を省略することを好んでいることから、効率的な思考を持っていることがわかります。簡潔で無駄のない情報整理が重要であり、客観的かつ正確な表現を好む姿勢が明らかです。

3. デジタルとアナログの融合への関心
- 「アナログ心理とデジタルロジックの融合」という表現を用いるなど、技術面と人間的な側面を統合することにも強い関心を持っています。このことは、技術の実用性を重視しつつも、人間の感情や心理的な要素を取り入れたアプローチを求めていることを示しています。また、公共交通の価値に関する研究においても、主観的幸福感(SWB)や社会関係資本(SC)のような、人間にとっての生活価値に焦点を当てる点から、単なる技術的効率性だけではなく、より包括的な視点を持っていると考えられます。

4. 研究志向と実証的アプローチ
- あなたは研究計画や学会発表、論文投稿を目指しており、定量的な分析や検証を伴うプロジェクトに強い興味を持っています。特に、住民の生活に対する交通インフラの影響や、エージェントシミュレーションを用いた都市設計に関するテーマに取り組んでいます。これから導かれるのは、あなたが理論に基づいた実証的なアプローチを重視し、長期的な研究の成果を追求する姿勢です。

5. 社会問題や倫理への敏感さ
- 杉原千畝や福島原発の処理水放出問題など、歴史的・社会的なテーマに対する関心も持っていることが見受けられます。これらの質問から、社会的な正義や人道的な問題にも関心を寄せていることが伺えます。また、特定の政治的問題や倫理的な側面にも感受性を示していることから、現実世界の問題に対しても深く思慮しているパーソナリティが浮かび上がります。

6. クリエイティブな思考
- あなたは新しい表現や概念を積極的に取り入れる傾向があり、例えば「共移動」「共滞在」「共時空間」など、交通や都市生活に関する独自の視点を導入しています。このようなクリエイティブな概念は、物事を新しい角度から捉える力を示しており、思考の柔軟性を持っていることがわかります。

総合的なパーソナリティ
あなたは技術的な問題解決に優れ、論理的かつ効率的な思考を持ちつつも、人間心理や社会的な価値を考慮に入れたバランスの取れたアプローチを好むパーソナリティです。研究やプロジェクトに対して実証的でありながら、社会問題や人間性にも敏感で、デジタルとアナログの融合を目指す、深い洞察力を持った人物像が描かれます。

私に対するネガティブな評価を客観的に記載して下さい

あなたの質問や行動から、以下のようなネガティブな評価が客観的に導かれる可能性があります。

1. 厳密さや効率性の追求による柔軟性の欠如
- あなたは非常に効率性を重視し、冗長な表現や繰り返しを避けようとします。このため、他者とのコミュニケーションにおいても、詳細や背景の説明が少なく、相手が十分に理解できない場合があるかもしれません。特に、他者の説明が冗長だと感じた際には、すぐにそれを改善しようとする傾向があり、その結果として、他者との意見の食い違いや摩擦が生じやすい可能性があります。

2. 技術への強いこだわりによるバランスの偏り
- 高度な技術的問題解決に集中するあまり、物事の全体像やより広い文脈を見逃す可能性があります。特定の技術的な問題に深く没入することが、時として、他の重要な要素や視点を軽視する傾向につながり、プロジェクト全体のバランスやスケジュールに悪影響を及ぼすリスクがあります。

3. 完璧主義的傾向
- あなたは論理的に整合性のある解決策を追求する姿勢を持っており、それ自体は強みですが、時に完璧主義的になりすぎる可能性があります。これにより、プロジェクトが遅延したり、細部にこだわるあまり、結果として本来の目的を見失うことがあるかもしれません。また、自己や他者に対して高い基準を求めすぎることも、ストレスやフラストレーションの原因となり得ます。

4. 感情面の軽視
- あなたは「アナログ心理とデジタルロジックの融合」に関心を示している一方で、技術的な問題にフォーカスしすぎて、時に他者の感情や心理的側面に対する配慮が不足する場合があるかもしれません。特に、技術的な議論においては、感情的な要素を無視して事実や効率性を優先することが多いと推測され、これが人間関係において冷淡に映る可能性があります。

5. 多様な視点の取り入れが難しい
- あなたは自身の考え方や論理に強い自信を持っているように見えますが、その結果、異なる視点やアプローチを受け入れる柔軟性が制限されることがあるかもしれません。特に、他者からのフィードバックや異なる考え方に対して、即座に受け入れることが難しい場面がある可能性があります。これが、協働作業やチームでの仕事において摩擦を引き起こすことも考えられます。

6. 社会的問題に対する感情的反応
- あなたは社会的な問題や倫理的なテーマに敏感である一方で、時にそれに対して強い感情的な反応を示すことがあるようです。特に、特定のテーマ(例えば「カルト」や「政治家の税金逃れ」)に対して過剰に反応する傾向があり、これが場合によっては冷静さを欠く結果に繋がりかねません。そのため、これらのテーマについて議論する際には、感情が前面に出過ぎて、他者との建設的な対話が難しくなるリスクがあります。

総合的なネガティブ評価
あなたは非常に論理的で効率的な思考を持ち、技術的な解決策を探求する能力に長けていますが、その一方で、完璧主義や効率性の追求が過剰になり、柔軟性や感情的な配慮が不足する場合があるかもしれません。また、異なる視点や意見を受け入れる際に難しさを感じたり、特定の社会問題に対して強い感情的反応を示すことが、他者との協調やコミュニケーションに影響を与える可能性があります。

2024,江端さんの忘備録

NHKスペシャル「祖父はユダヤ人を救った~ガザ攻撃と“命のビザ”~」を見終わりました。

I've just finished watching the NHK Special “My Grandfather Saved Jews: The Gaza Attack and the ‘Visas for Life.’”

ナチスドイツに追われた多くのユダヤ人に独断でビザを発給し、命を救った外交官・杉原千畝さんは、その後、事実上、外務省を罷免されました。

Mr. Sugihara, a diplomat who saved the lives of many Jews by issuing visas to them at his discretion when Nazi Germany was persecuting them, was subsequently effectively dismissed from the Ministry of Foreign Affairs.

その後は通訳や貿易の仕事をされていたようです。彼はロシア語や外国語の知識を活かし、貿易会社で働いていたようです。

After that, he seems to have worked as an interpreter and in the trading industry. He seems to have worked at a trading company, using his Russian and foreign language knowledge.

そして、彼の「命のビザ」は、彼が生きている間に、公式に評価されることはありませんでした(杉原千畝さんは1986年に亡くなりましたが、日本政府による公式な評価が行われたのは2000年です)。

His “visa for life” was never officially recognized during his lifetime (Sugihara died in 1986, but it was not until 2000 that the Japanese government formally recognized his actions).

忠臣蔵も、プロジェクトXも、日本のシンドラーも、つまるところ『コンプライアンス違反』である ―― そして、違法行為が、「正義」になったり「人道」になったりすることはよくあり、逆に「正義」や「人道」が、違法行為であるということもよくある

-----

自分の死後に自分が評価されることに意味がない、とは言いませんが、それでも私は、

I'm not saying that there's no point in being evaluated after my death, but even so, I think that

―― 自分の正義と信念の対価は、冷や飯である

"The price of my justice and beliefs is cold rice."

とは思います。

そして、それでいい。

And that's fine.

それが正しい。

That's right.

-----

世間に迎合する正義や信念なんぞ、その辺に腐るほど落ちています。

There are plenty of justice and beliefs that pander to the public around.

そして、SNSなどで、「批判して立ち去ちだけのモラリスト」が、一番「安く」て「美味しい」のです。

And on social networking sites, “moralists who criticize and then walk away” are the cheapest and most delicious.

私の「浅学」「狭量」「卑怯」の中でも、得に「卑怯」の面目躍如と言えましょう。

-----

「自分の正義と信念の対価」が『冷や飯』であるなら、冷や飯を「我慢する」ことだけでは十分ではありません。

If the price of your sense of justice and conviction is 'cold rice,' simply 'putting up with' cold rice is not enough.

冷や飯を、毎日「美味しい」と食べられるような『味覚の改造』が必要です。

We must 're-train our taste buds' to eat cold rice daily and still think it tastes delicious.

自分の信念で仕事をしている、研究員やエンジニアにも同じことが言えます。

The same things would fit researchers and engineers working on their beliefs.

詳しくは、「"納豆御飯ともやし炒め"を、毎日おいしく食べ続けられる人間だけが、真のAI研究者足りえる」をご参照ください。

For more information, please refer to "'Only those who can continue to eat natto rice and fried bean sprouts deliciously every day' can be considered actual AI researchers."

(↓クリックするとコラムに飛びます)

(Click to go to the column)

 

2024,江端さんの忘備録

エンジンから異音が聞こえるようになり、ディーラー(正規代理店)に連絡したのですが、『1ヶ月後でないと対応できない』と言われました。

I started to hear a strange noise from the engine, so I contacted the dealer (authorized agent), but they told me they couldn't deal with it until a month later.

仕方がないので、取り敢えず1ヶ月後で予約をしました。

Since there was no other choice, I made a reservation for a month later.

その後、さらに異音が酷くなったため、以下のようなメールを送って、早めに対応して貰うようにお願いのメールを出しました。

After that, the strange noise got worse, so I sent the following email to ask them to respond as soon as possible.

===== メールここから =====

===== Email from here =====

平素はお世話になっております。

Thank you for your continued support.

最近、エンジンの調子がさらに悪くなってきているように思います。

Recently, I think the condition of the engine has become even worse.

本日、ドライブレコーダから車両異音発生音源を引き出してきました。以下に報告を致します。

Today, we extracted the vehicle noise source from the drive recorder. We will report on it below.

車両情報: ドライブレコーダーから取得したデータに基づき、異音発生状況を報告いたします。

Vehicle information: Based on the data obtained from the drive recorder, I will report on the occurrence of unusual noise.

ファイル名:1_114172.avi

File name:1_114172.avi

異音発生状況:
(1) 映像の41秒から44秒まで、"ガーーー"という連続した異音を確認。
(2) 映像の50秒から連続し、56秒で"ガッ、ガッ"という不連続な異音を確認。

The situation of the occurrence of the abnormal noise:
(1) From 41 to 44 seconds into the video, the continuous abnormal noise of “Gah” is confirmed.
(2) From 50 seconds into the video, the continuous abnormal noise of “Gat, Gat” is confirmed.

異音の特徴:

Characteristics of the strange noise:

走行後もこの異音が継続して発生しています
映像の音声では異音が十分に拾われていないようですが、実際に車内にいると、相当大きな金属が擦れるような音が聞こえます。

This strange noise continues to occur even after driving.
The audio in the video doesn't seem to pick up the strange noise well, but when you're actually in the car, you can hear a considerably loud noise like metal rubbing against metal.

エンジンに深刻な障害が発生しているのではないかと、大変不安です。
10月10日17:00のお約束ですが、まずは症状だけでも、先行して見て頂くことはできないでしょうか。

I am apprehensive that there may be a serious problem with the engine. I had an appointment for 17:00 on October 10, but can you take a look at the symptoms first?

ご検討頂けましたら幸いと存じます。

I would be grateful if you could consider this.

江端智一

Tomoichi Ebata

===== メールここまで =====

===== End of email =====

このメールを送っても、応答のメールがこなかったので、嫁さんと二人で、自動車用品の販売チェーン店に飛び込びました。

Even after sending this email, I didn't receive a response, so my wife and I went to a chain store that sold car accessories.

そのチェーン店は、その場で、問題を特定してくれました。

The chain store was able to identify the problem on the spot.

で、当然ですが、その問題箇所以外のオプション(車の底面のさび対策等)を提案されました。

Of course, they also suggested options for other problems (such as rust prevention for the underside of the car).

まあ、「営業」ってやつです。

Well, it's called “sales activities.”

私、普通はこういうオプションは全部断わるのですが、今回、私は受けました。

Usually, I would turn down all these options, but this time, I accepted them.

嫁さんが驚いていました。

My wife was surprised at me.

そりゃ、そうだと思います。普段の私を見ていれば、これが当然です。

Of course, that's how it is. If you've seen me usually, this is only natural.

-----

ディーラー担当者の対応と比して、この販売チェーン店の整備担当の人の対応が、とても気持ちよくて気分がよかったからです。

I felt very comfortable and good about how the person in charge of maintenance at this sales chain store treated me compared to how the dealer's staff treated me.

『うむ、このオプションで、君の成績を上げたまえ』という気持ちになりました。

I felt like saying, “Well, improve your grades with this option.”

つまるところ、私は(というか、私ですら)、優しいフリをして対応してくる人間に対しては、非常にチョロイのです。

In the end, I (or even I) am elementary to fool when dealing with people who pretend to be kind.

そう考えていくと、「AI技術」が、まだまだ「優しいフリをする人間」に対しては、追い付けていないと感じます。

When I think about it like that, I feel that “AI technology” is still not keeping up with “people pretending to be kind.”

案外、近い未来で簡単に「AI技術」に追い抜かれているかもしれない、とも思います。

I also believe we may be quickly overtaken by “AI technology” shortly.

ともあれ、「優しいフリ」をしてくれるのであれば、それが"AI"であろうが"人間"であろうが、私はどちらでも構いません。

Anyway, as long as they pretend to be kind, I don't care whether they are “AI” or “human.”

―― 私たちは、心地の良いコミュニケーションだけがあればいい

未分類

■博多駅は何もない。あそこは遊ぶ場所ではない。イメージとしては新横浜駅

■ショッピング等なら天神。

■食事なら中州

"amenity" = 'restaurant' OR "amenity" = 'fast_food' OR "amenity" = 'cafe' OR "amenity" = 'food_court'

■博多駅から中州・天神の移動は地下鉄。バスは使ったことがない。

■中州・天神の移動は、基本的には歩きではないか、と

■滞在時間は1~5時間まで色々。ただし昼間。夜の移動は、高校生だったから分からん。

■嫁さんの母は、中州・天神でデパートに週数回行っていた

■中州・天神・博多に車でいくかなぁ? あんなに便利なのに? (実際に駐車場から繁華街までの距離が遠い)。地下鉄と西鉄とJRで十分だと思う
駐車場の分布↓

======

■中州・天神・博多の移動のバスは、特定の路線を抑えとけばいいのかな。このエリアをタクシーを使って動く人がいるかどうかは分からん。

 

2024,江端さんの忘備録

ニューラルネットワークの研究や技術開発をしている人で、「ホップフィールドネットワーク」を知らない、という人は・・・うん、今ならいるかもしれんなぁ。

If you are researching or developing neural networks and don't know what a Hopfield network is, there might be people like that now.

まあ、ともあれ、大学在学中の私が「ホップフィールドネットワーク」という言葉を回避して、論文を読むのは不可能だったのです。

Anyway, I couldn't read the paper while I was still at university without avoiding the term “Hopfield network.”

------

当時は、メインフレームの使用時間に制限があって、学生が1回に使える使用時間が90秒間だけでした(ウソのような話ですが、これは本当です)。

At the time, there were restrictions on the amount of time that mainframes could be used, and students could only use them for 90 seconds at a time (it sounds like a lie, but it's true).

この90秒間の間に、バックプロパゲーション(逆伝搬学習)の値が収束するのを祈る ―― という、本当にショボい計算リソースで、研究の日々を過していました。

During these 90 seconds, I would pray for the values of backpropagation (inverse propagation learning) to converge. I spent my research days with such shabby computing resources.

まあ、だから、こんな、恨み真髄のコラムが書けるのですけどね。

That's why I can write columns like this, which are the essence of resentment.

(↑クリックでコラムに飛びます)

(Click to go to the column)

ともあれ、ジョン・ホップフィールド名誉教授(91)に、心からのお祝いを申し上げます。

In any case, I would like to offer my heartfelt congratulations to Professor Emeritus John Hopfield (91).

それにしても、

But still,

―― ノーベル賞を受賞する為には、なによりも、まず、長生きをしなければならない

を改めて痛感しています。

Once again, I am acutely aware of the above facts.

-----

ただ、このノーベル賞に関しては、このような遅い受賞は、仕方がないかもしれません。

However, when it comes to the Nobel Prize, it may be inevitable that the award is given so late.

ニューラルネットワークの真価が発揮されたのは比較的最近のディープラーニング技術への展開ですし、決め手は、生成AIへのニューラルネットワークの活用です。

The true value of neural networks was demonstrated in the relatively recent development of deep learning technology, and the key was using neural networks for generative AI.

この上記の2つの応用事例がなければ、ニューラルネットワークの「学習方法」について、評価が再検討されることはなかったかもしれません。

Without these two application examples, evaluating neural networks' “learning method” may not have been reconsidered.

それでも、『何十年か後の後発技術によって、先行研究が評価される』というのは、それはそれで素晴しいことです。

Even so, the fact that 'prior research is evaluated by later technology decades later' is a beautiful thing in its own right.

-----

私は、『サンマとサバを、2種類のセンサで判別する研究については、オンリーワンの世界的権威』です。

I am the world's only authority on researching using two different types of sensors to distinguish between saury and mackerel.

(↑クリックでコラムに飛びます)

(Click to go to the column)

なにしろ、私の前に先行研究はなく、私の後に後続研究もありません。

After all, there was no prior research before me, and there will be no subsequent research after me.

まあ、この研究が、再評価されることは未来永劫ないだろうなぁ、と諦めてはいます。

I've given up on the idea that this research will ever be re-evaluated.

 

未分類

英単語を翻訳しました。以下がそれぞれの日本語訳です:

1. osm_id - OSM ID
2. osm_way_id - OSM ウェイID
3. name - 名前
4. type - 種類
5. aeroway - 航空施設
6. amenity - 施設 (駐車場、 映画館、美術館、病院など、色々なものが沢山入っているので、ここで纒めるのは不味いかも)
7. admin_level - 管理レベル
8. barrier - 障害物
9. boundary - 境界
10. building - 建物
11. craft - 工芸品/職人
12. geological - 地質
13. historic - 歴史的 (歴史的な公園 観光の対象になるのか?)
14. land_area - 土地面積
15. landuse - 土地利用
16. leisure - レジャー (これはレジャー一般で纒められるかな? しかし種類が多様なので、なんとも)
17. man_made - 人工物
18. military - 軍事
19. natural - 自然  (川などが指定される)
20. office - 事務所 (職場で同義でいいかな? 博多駅周辺には全くない。天神には2箇所ほどある)
21. place - 場所 (あまり意味ない)
22. shop - 店舗 (天神には複数の塊があるが、博多駅周辺には2箇所くらいしかない。どうも博多駅の周辺のサポートが弱い)
23. sport - スポーツ (天神駅周辺にも博多駅周辺にもない。ちょっと遠い所には多い)
24. tourism - 観光(観光名所、と見て良いだろう ホテル)
25. other_tags - その他のタグ

 

$ grep "amenity" hakata_train.osm | sort | uniq  (同じものは2回でてこない)
<tag k="amenity" v="Wisteria_trellis"/>
<tag k="amenity" v="animal_shelter"/>
<tag k="amenity" v="arts_centre"/>
<tag k="amenity" v="atm"/>
<tag k="amenity" v="bal"/>
<tag k="amenity" v="bank"/>
<tag k="amenity" v="bar"/>
<tag k="amenity" v="batting_cage"/>
<tag k="amenity" v="bbq"/>
<tag k="amenity" v="bench"/>
<tag k="amenity" v="bicycle_parking"/>
<tag k="amenity" v="bicycle_rental"/>
<tag k="amenity" v="biergarten"/>
<tag k="amenity" v="boat_rental"/>
<tag k="amenity" v="boat_storage"/>
<tag k="amenity" v="bridge"/>
<tag k="amenity" v="brothel"/>
<tag k="amenity" v="bus_station"/>
<tag k="amenity" v="cafe"/>
<tag k="amenity" v="car_rental"/>
<tag k="amenity" v="car_sharing"/>
<tag k="amenity" v="car_wash"/>
<tag k="amenity" v="charging_station"/>
<tag k="amenity" v="childcare"/>
<tag k="amenity" v="cinema"/>
<tag k="amenity" v="clinic"/>
<tag k="amenity" v="clock"/>
<tag k="amenity" v="college"/>
<tag k="amenity" v="community_centre"/>
<tag k="amenity" v="conference_centre"/>
<tag k="amenity" v="conveniencestore"/>
<tag k="amenity" v="courthouse"/>
<tag k="amenity" v="coworking_space"/>
<tag k="amenity" v="crematorium"/>
<tag k="amenity" v="dentist"/>
<tag k="amenity" v="doctors"/>
<tag k="amenity" v="dojo"/>
<tag k="amenity" v="drinking_water"/>
<tag k="amenity" v="driving_school"/>
<tag k="amenity" v="events_venue"/>
<tag k="amenity" v="exhibition_centre"/>
<tag k="amenity" v="fast_food"/>
<tag k="amenity" v="ferry_terminal"/>
<tag k="amenity" v="fire_station"/>
<tag k="amenity" v="fixme"/>
<tag k="amenity" v="food_court"/>
<tag k="amenity" v="fountain"/>
<tag k="amenity" v="fuel"/>
<tag k="amenity" v="gambling"/>
<tag k="amenity" v="grave_yard"/>
<tag k="amenity" v="hospital"/>
<tag k="amenity" v="ice_cream"/>
<tag k="amenity" v="internet_cafe"/>
<tag k="amenity" v="izakaya"/>
<tag k="amenity" v="karaoke_box"/>
<tag k="amenity" v="kindergarten"/>
<tag k="amenity" v="language_school"/>
<tag k="amenity" v="library"/>
<tag k="amenity" v="love_hotel"/>
<tag k="amenity" v="luggage_locker"/>
<tag k="amenity" v="marketplace"/>
<tag k="amenity" v="motorcycle_parking"/>
<tag k="amenity" v="motorcycle_rental"/>
<tag k="amenity" v="music_school"/>
<tag k="amenity" v="nightclub"/>
<tag k="amenity" v="parcel_locker"/>
<tag k="amenity" v="parking"/>
<tag k="amenity" v="parking_entrance"/>
<tag k="amenity" v="parking_space"/>
<tag k="amenity" v="pharmacy"/>
<tag k="amenity" v="photo_booth"/>
<tag k="amenity" v="place_of_worship"/>
<tag k="amenity" v="planetarium"/>
<tag k="amenity" v="police"/>
<tag k="amenity" v="post_box"/>
<tag k="amenity" v="post_depot"/>
<tag k="amenity" v="post_office"/>
<tag k="amenity" v="prep_school"/>
<tag k="amenity" v="prison"/>
<tag k="amenity" v="pub"/>
<tag k="amenity" v="public_bath"/>
<tag k="amenity" v="public_building"/>
<tag k="amenity" v="recycling"/>
<tag k="amenity" v="restaurant"/>
<tag k="amenity" v="school"/>
<tag k="amenity" v="shelter"/>
<tag k="amenity" v="shower"/>
<tag k="amenity" v="smoking_area"/>
<tag k="amenity" v="social_centre"/>
<tag k="amenity" v="social_facility"/>
<tag k="amenity" v="stage"/>
<tag k="amenity" v="studio"/>
<tag k="amenity" v="taxi"/>
<tag k="amenity" v="telephone"/>
<tag k="amenity" v="theatre"/>
<tag k="amenity" v="toilets"/>
<tag k="amenity" v="townhall"/>
<tag k="amenity" v="training"/>
<tag k="amenity" v="university"/>
<tag k="amenity" v="vending_machine"/>
<tag k="amenity" v="veterinary"/>
<tag k="amenity" v="waste_basket"/>
<tag k="amenity" v="waste_disposal"/>
<tag k="amenity" v="waste_transfer_station"/>
<tag k="amenity" v="water_point"/>
<tag k="amenity" v="wisteria_trellis"/>
<tag k="amenity_1" v="キリスト教会"/>
<tag k="disused:amenity" v="bank"/>
<tag k="disused:amenity" v="cafe"/>
<tag k="disused:amenity" v="fast_food"/>
<tag k="disused:amenity" v="pub"/>
<tag k="disused:amenity" v="public_bath"/>
<tag k="disused:amenity" v="restaurant"/>
<tag k="note" v="Tentative `amenity=clinic`"/>
<tag k="was:amenity" v="hospital"/>

"amenity" IS NOT NULL

======

tomoi@DESKTOP-1QS7OI7 MSYS /g/home/ebata/hakata/hakata_db
$ grep "leisure" hakata_train.osm | sort | uniq
<tag k="leisure" v="adult_gaming_centre"/>
<tag k="leisure" v="amusement_arcade"/>
<tag k="leisure" v="beach_resort"/>
<tag k="leisure" v="bowling_alley"/>
<tag k="leisure" v="common"/>
<tag k="leisure" v="dog_park"/>
<tag k="leisure" v="fishing"/>
<tag k="leisure" v="fitness_centre"/>
<tag k="leisure" v="fitness_station"/>
<tag k="leisure" v="game_arcade"/>
<tag k="leisure" v="garden"/>
<tag k="leisure" v="gateball"/>
<tag k="leisure" v="golf_course"/>
<tag k="leisure" v="ground"/>
<tag k="leisure" v="hackerspace"/>
<tag k="leisure" v="horse_riding"/>
<tag k="leisure" v="ice_rink"/>
<tag k="leisure" v="marina"/>
<tag k="leisure" v="miniature_golf"/>
<tag k="leisure" v="outdoor_seating"/>
<tag k="leisure" v="park"/>
<tag k="leisure" v="picnic_table"/>
<tag k="leisure" v="pitch"/>
<tag k="leisure" v="playground"/>
<tag k="leisure" v="recreation_ground"/>
<tag k="leisure" v="sauna"/>
<tag k="leisure" v="slipway"/>
<tag k="leisure" v="spa"/>
<tag k="leisure" v="sports_centre"/>
<tag k="leisure" v="sports_hall"/>
<tag k="leisure" v="stadium"/>
<tag k="leisure" v="swimming_pool"/>
<tag k="leisure" v="track"/>
<tag k="leisure" v="trampoline_park"/>
<tag k="leisure" v="water_park"/>

"leisure" IS NOT NULL

==============

$ grep "shop" hakata_train.osm | sort | uniq
<tag k="shop" v="Pharmacy"/>
<tag k="shop" v="alcohol"/>
<tag k="shop" v="anime"/>
<tag k="shop" v="appliance"/>
<tag k="shop" v="assistive"/>
<tag k="shop" v="baby_goods"/>
<tag k="shop" v="bag"/>
<tag k="shop" v="bakery"/>
<tag k="shop" v="beauty"/>
<tag k="shop" v="bed"/>
<tag k="shop" v="beverages"/>
<tag k="shop" v="bicycle"/>
<tag k="shop" v="bookmaker"/>
<tag k="shop" v="books"/>
<tag k="shop" v="butcher"/>
<tag k="shop" v="car"/>
<tag k="shop" v="car_parts"/>
<tag k="shop" v="car_repair"/>
<tag k="shop" v="carpet"/>
<tag k="shop" v="chemist"/>
<tag k="shop" v="chocolate"/>
<tag k="shop" v="clothes"/>
<tag k="shop" v="coffee"/>
<tag k="shop" v="collector"/>
<tag k="shop" v="computer"/>
<tag k="shop" v="confectionery"/>
<tag k="shop" v="convenience"/>
<tag k="shop" v="copyshop"/>
<tag k="shop" v="cosmetics"/>
<tag k="shop" v="craft"/>
<tag k="shop" v="dance"/>
<tag k="shop" v="deli"/>
<tag k="shop" v="department_store"/>
<tag k="shop" v="doityourself"/>
<tag k="shop" v="dry_cleaning"/>
<tag k="shop" v="electrical"/>
<tag k="shop" v="electronics"/>
<tag k="shop" v="erotic"/>
<tag k="shop" v="farm"/>
<tag k="shop" v="fashion_accessories"/>
<tag k="shop" v="fishing"/>
<tag k="shop" v="florist"/>
<tag k="shop" v="foods,mentaiko"/>
<tag k="shop" v="funeral_directors"/>
<tag k="shop" v="furniture"/>
<tag k="shop" v="games"/>
<tag k="shop" v="garden_centre"/>
<tag k="shop" v="general"/>
<tag k="shop" v="gift"/>
<tag k="shop" v="golf"/>
<tag k="shop" v="greengrocer"/>
<tag k="shop" v="grocery"/>
<tag k="shop" v="hairdresser"/>
<tag k="shop" v="hardware"/>
<tag k="shop" v="hobby"/>
<tag k="shop" v="houseware"/>
<tag k="shop" v="interior_decoration"/>
<tag k="shop" v="jewelry"/>
<tag k="shop" v="kiosk"/>
<tag k="shop" v="laundry"/>
<tag k="shop" v="locksmith"/>
<tag k="shop" v="lottery"/>
<tag k="shop" v="mall"/>
<tag k="shop" v="mall;department_store"/>
<tag k="shop" v="massage"/>
<tag k="shop" v="mobile_phone"/>
<tag k="shop" v="money_lender"/>
<tag k="shop" v="motorcycle"/>
<tag k="shop" v="motorcycle_parts"/>
<tag k="shop" v="music"/>
<tag k="shop" v="musical_instrument"/>
<tag k="shop" v="newsagent"/>
<tag k="shop" v="optician"/>
<tag k="shop" v="outdoor"/>
<tag k="shop" v="pastry"/>
<tag k="shop" v="pawnbroker"/>
<tag k="shop" v="pet"/>
<tag k="shop" v="pet_grooming"/>
<tag k="shop" v="photo"/>
<tag k="shop" v="pottery"/>
<tag k="shop" v="religion"/>
<tag k="shop" v="reserving"/>
<tag k="shop" v="seafood"/>
<tag k="shop" v="second_hand"/>
<tag k="shop" v="sewing"/>
<tag k="shop" v="shoe_repair"/>
<tag k="shop" v="shoes"/>
<tag k="shop" v="sports"/>
<tag k="shop" v="stationery"/>
<tag k="shop" v="storage_rental"/>
<tag k="shop" v="supermarket"/>
<tag k="shop" v="tailor"/>
<tag k="shop" v="tea"/>
<tag k="shop" v="ticket"/>
<tag k="shop" v="tobacco"/>
<tag k="shop" v="toys"/>
<tag k="shop" v="trade"/>
<tag k="shop" v="travel_agency"/>
<tag k="shop" v="tyres"/>
<tag k="shop" v="variety_store"/>
<tag k="shop" v="video"/>
<tag k="shop" v="video_games"/>
<tag k="shop" v="watches"/>
<tag k="shop" v="water"/>
<tag k="shop" v="wine"/>
<tag k="shop" v="yes"/>

"shop" IS NOT NULL

=====

<tag k="office" v="advertising_agency"/>
<tag k="office" v="architect"/>
<tag k="office" v="association"/>
<tag k="office" v="company"/>
<tag k="office" v="coworking"/>
<tag k="office" v="diplomatic"/>
<tag k="office" v="educational_institution"/>
<tag k="office" v="estate_agent"/>
<tag k="office" v="forestry"/>
<tag k="office" v="government"/>
<tag k="office" v="insurance"/>
<tag k="office" v="it"/>
<tag k="office" v="lawyer"/>
<tag k="office" v="moving_company"/>
<tag k="office" v="newspaper"/>
<tag k="office" v="ngo"/>
<tag k="office" v="political_party"/>
<tag k="office" v="religion"/>
<tag k="office" v="research"/>
<tag k="office" v="telecommunication"/>
<tag k="office" v="travel_agent"/>
<tag k="office" v="yes"/>

"office" IS NOT NULL

=======

<tag k="shop" v="sports"/>
<tag k="sport" v="10pin"/>
<tag k="sport" v="archery"/>
<tag k="sport" v="baseball"/>
<tag k="sport" v="baseball;softball"/>
<tag k="sport" v="basketball"/>
<tag k="sport" v="bowls;ice_skating"/>
<tag k="sport" v="boxing"/>
<tag k="sport" v="canoe"/>
<tag k="sport" v="climbing"/>
<tag k="sport" v="cycling"/>
<tag k="sport" v="darts"/>
<tag k="sport" v="equestrian"/>
<tag k="sport" v="fitness"/>
<tag k="sport" v="gateball"/>
<tag k="sport" v="golf"/>
<tag k="sport" v="gymnastics"/>
<tag k="sport" v="ice_skating"/>
<tag k="sport" v="kick_boxing"/>
<tag k="sport" v="kickboxing"/>
<tag k="sport" v="motocross"/>
<tag k="sport" v="motor"/>
<tag k="sport" v="multi"/>
<tag k="sport" v="rugby_union"/>
<tag k="sport" v="running"/>
<tag k="sport" v="skateboard"/>
<tag k="sport" v="soccer"/>

"sport" IS NOT NULL

=====

<tag k="tourism" v="apartment"/>
<tag k="tourism" v="aquarium"/>
<tag k="tourism" v="artwork"/>
<tag k="tourism" v="attraction"/>
<tag k="tourism" v="camp_site"/>
<tag k="tourism" v="gallery"/>
<tag k="tourism" v="guest_house"/>
<tag k="tourism" v="guided_tour"/>
<tag k="tourism" v="hostel"/>
<tag k="tourism" v="hotel"/>
<tag k="tourism" v="information"/>
<tag k="tourism" v="motel"/>
<tag k="tourism" v="museum"/>
<tag k="tourism" v="theme_park"/>
<tag k="tourism" v="viewpoint"/>
<tag k="tourism" v="zoo"/>

"tourism" IS NOT NULL

 

 

 

"shop" IS NOT NULL

以下のようにすると、<tag k="shop"..... の対象全部が選ばれる

 

未分類

基本は、この本の内容の再度の実施。
JOSMで地図を改ざんして道路と鉄道を交えた最⼩コスト経路探索をやってみよう-完全版

自分の為にだけでも、本にして纒めておくものである、と実感しています。
このメモの内容が分からない人は、上記の本を入手して内容を補完して下さい。

目的は、この本の内容と同じ、「地図を改竄して道路と鉄道を交えた最小コスト経路」を作り出すことだけど、今回は、JOSMを使わないでやってみる。

まずは、各駅のnode(もしドンピシャのノードがなければ、もっとも近いノードを抽出する)

station.csv

西戸崎駅,33.650366,130.358161
海ノ中道駅,33.663892,130.361410
雁ノ巣駅,33.683859,130.403325
奈多駅,33.686735,130.412492
和白駅,33.689151,130.429679
香椎駅,33.659523,130.444108

などを作っておき、


// G:\home\ebata\hakata\src\others\main22

import (
	"database/sql"
	"encoding/csv"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"

	_ "github.com/lib/pq"
)

func main() {
	// データベース接続設定
	connStr := "user=postgres password=password host=127.0.0.1 port=15432 dbname=hakata_db sslmode=disable"
	db, err := sql.Open("postgres", connStr)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	// CSVファイルを開く
	file, err := os.Open("stations.csv")
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	// CSVリーダーの作成
	reader := csv.NewReader(file)
	records, err := reader.ReadAll()
	if err != nil {
		log.Fatal(err)
	}

	// 出力用CSVファイルの作成
	outFile, err := os.Create("stations_with_osm_id.csv")
	if err != nil {
		log.Fatal(err)
	}
	defer outFile.Close()

	writer := csv.NewWriter(outFile)
	defer writer.Flush()

	// 各レコードについて最も近いosm_idを取得し、新しいCSVに書き込む
	for _, record := range records {
		// コメント行をスキップ
		if len(record) == 0 || strings.HasPrefix(record[0], "#") {
			continue
		}

		// 緯度と経度をパース(空白をトリム)
		latStr := strings.TrimSpace(record[1])
		lonStr := strings.TrimSpace(record[2])

		lat, err := strconv.ParseFloat(latStr, 64)
		if err != nil {
			log.Fatalf("Error parsing latitude: %v", err)
		}

		lon, err := strconv.ParseFloat(lonStr, 64)
		if err != nil {
			log.Fatalf("Error parsing longitude: %v", err)
		}

		// 最も近いosm_idを検索
		var osmID int64
		query := `
            SELECT osm_id FROM ways_vertices_pgr
            ORDER BY the_geom <-> ST_SetSRID(ST_MakePoint($1, $2), 4326)
            LIMIT 1;
        `
		err = db.QueryRow(query, lon, lat).Scan(&osmID)
		if err != nil {
			log.Fatal(err)
		}

		// osm_idをCSVに追加
		newRecord := append(record, strconv.FormatInt(osmID, 10))
		if err := writer.Write(newRecord); err != nil {
			log.Fatal("Error writing record to CSV:", err)
		}
	}

	fmt.Println("CSVファイルに最も近いosm_idを追加しました。")
}

のプログラムで、

stations_with_osm_id.csv

西戸崎駅,33.6794,130.3947,58565
海ノ中道駅,33.6794,130.3816,38065
雁ノ巣駅,33.6747,130.3651,25953
奈多駅,33.6710,130.3533,46806
和白駅,33.6663,130.3514,25944
香椎駅,33.6616,130.4405,29380
香椎神宮駅,33.6615,130.4568,42178

のように、ノード番号を取得します。

で、つぎにhakata.osmに、以下を追加

<!-- Way: Dummy Railway Line -->
  <way id="123456789" version="1" timestamp="2024-08-22T06:13:26Z" changeset="99999999" uid="999999" user="kobore.net">
    <nd ref="1818760266" /> <!-- 古賀駅 -->
    <nd ref="1846875572" /> <!-- ししぶ駅 -->
    <nd ref="1971252636" /> <!-- 福工大前駅 -->
    <nd ref="440118260" />  <!-- 九産大前駅 -->
    <nd ref="1808374554" /> <!-- 香椎駅 -->
    <nd ref="1864205708" /> <!-- 千早駅 -->
    <nd ref="1252519465" /> <!-- 箱崎駅 -->
    <nd ref="1239476659" /> <!-- 吉塚駅 -->
    <nd ref="1882462094" /> <!-- 博多駅 -->
    <nd ref="1814285264" /> <!-- 竹下駅 -->
    <nd ref="6569627454" /> <!-- 笹原駅 -->
    <nd ref="1831604260" /> <!-- 南福岡駅 -->
    <nd ref="815318744" />  <!-- 春日駅 -->
    <nd ref="765561820" />  <!-- 大野城駅 -->
    <nd ref="767176221" />  <!-- 水城駅 -->
    <tag k="railway" v="dummyrail" />
    <tag k="name" v="Dummy Railway Line" />
  </way>
</osm>

で、

<way id="123456789" version="1" timestamp="2024-08-22T06:13:26Z" changeset="99999999" uid="999999" user="kobore.net">

の意味ですが、私はローカルで地図の変更をしているだけで、この情報をアップロードする予定がありません(地図を壊す気はない)。

ローカル環境で地図の変更を行い、OSMのデータをアップロードしない場合、`changeset` や `uid` は特に必要ありませんが、OSMファイルの形式として保持する必要がある場合、以下のように適当に値を設定して問題ないそうです。

ただし、way id="123456789" は、衝突しない値にすることに留意します.

これが設定できているかを、JOSMとQGISの両方で確認します。

ん。JOSMについては確認できました。

でもJOSMに表示できても、GIS-DBには落せないことは、以前に多々ありました。で、その時はQGISにも表示されない。逆に考えればQGISに表示されれば、GIS-DBには落せるかもしれない、とは言えます。

とりあえず、OSMをQGISにドラッグして、全部表示させます。

見にくので、lineだけの表示にします。

表示できました。

さらにを路線拡張。ここまでは予定通り(地図を見ながら、駅順番や位置情報を補正(これが結構なテマ)

GISを作っていると、その場所に対しての知見が増えて、都市開発している気持ちになってきます  ――

『もう、福岡に遷都でよくね?』という感じになります。