2020/08,江端さんの忘備録

COVID-19に関して私が頭の中で持っている数値は、ほとんど、このコラムの中にあります。

Most of the numbers I have in my head regarding COVID-19 are in this column.

ダイアモンド・プリンセス号のデータによれば、

According to data from the Diamond Princess,

■感染の可能性:20%

- Chance of infection: 20%

■感染者が死亡する確率:2%

- Chance of death of an infected person: 2%

ですので、

So,

通常の生活の範囲での、COVID-19による「私」の死亡率は、

I think that my mortality rate from COVID-19, in the normal range of life, is

「0.4%(1000人に4人) + α(年齢を考慮)」

"0.4% (4 in 1,000) + alpha (taking into account age)

と思っています。

一方、

On the other hand,

■インフルエンザによる感染者の死亡率は、(私の年代では)0.01%

- the mortality rate for those infected with influenza is (in my age group) 0.01% (*)

ですので、

So,

「インフルエンザで1人死亡するベースで、COVID-19では20人が死ぬ」

On the basis of one flu death, COVID-19 will kill 20 people.

と、考えても、大きくは外れていないと思います。

And it's not off the mark to think

しかも、急激に容態が激変し、人間に相当に酷い苦痛を与えるという、最低なウイルスです。

Moreover, it is a disgusting virus that can rapidly and drastically change human condition and cause considerable and terrible suffering to humans.

ウイルスは(どんなウイルスであれ)、できるだけ、長期間、人間に酷い苦痛を与えて、可能な限り人(医師、看護師)を集めて治療させることで、感染の拡大を狙うという生存戦略を取るからです。

This is because the virus (any virus) has a survival strategy of trying to spread the infection by inflicting terrible suffering on humans for as long as possible, and by gathering people (doctors, nurses) to treat them as much as possible.

今更ながら「新型コロナウイスル = 殺人ウイルス」であることを、再認識しています。

After all this time, I am reminded that "new corona virus = killer virus".

-----

「新型コロナウイルス疾患(COVID-19)による死亡率 7.5%」 ――

"The mortality rate from novel coronavirus disease (COVID-19) is 7.5%"

このフレーズを新聞で見たときには、真っ青になりました。

When I saw this phrase in the newspaper, I was pale.

■"0.4%(日常生活でも死亡率)"とか"2%(感染後の死亡率)"ではなく、"7.5%"?

- "7.5%" instead of "0.4% (mortality in daily life)" or "2% (mortality after infection)"?

■それって、どういうこと?

- What does that mean?

■母数は何だ? 母数は?

- What's the population size?

■欧米より低いとか、そんな話はどーでもいいよ!

- I don't care if it is lower than the West!

と、正直、狼狽(うろた)えました。

To tell you the truth, I was upset.

■感染して病床についたら、10回のうち1回は、生きて外に出られないの?

- If you're infected and hospitalized, one out of ten times I won't make it out alive?

と。

===== ニュースの記事 ======

===== News article from here =====

国立国際医療研究センターが2020年3月から7月上旬までの入院患者2,638人の経過などを解析したところ、入院時、68.1%にあたる1,796人が軽症や中等症で、31.9%にあたる840人が重症だった。

The National Center for Global Health and Medicine analyzed the course of 2,638 hospitalized patients from March to early July 2020. At the time of admission, 68.1%, or 1,796 people were in mild or moderate condition. 840 people, or 31.9%, were seriously ill.

死亡した入院患者は全体の7.5%となる197人で、死亡率が20%を超えるイギリスやアメリカよりも大幅に少なくなっている。

There were 197 hospital admissions, or 7.5% of all deaths, which is significantly less than in the UK and the US, where the mortality rate is over 20%.

===== ニュースの記事(ここまで) ======

===== News article (to here) =====

197人 ÷ 0.075 = 2626.66 となっていることから、このデータの母数が"入院患者2,638人"を示していることは明らかです。

197 patients ÷ 0.075 = 2,626.66, which clearly indicates that the population of this data represents "2,638 inpatients".

ということは、COVID-19で、「軽症者等に係る宿泊療養」ではなく、「入院患者」となってしまった場合、

So, if the COVID-19 makes you an "inpatient" instead of an "overnight care for minor illnesses",

―― "10人(正確には13人)のうち1人"は、生還できない

"One out of ten (13 to be exact) won't make it out alive."

というのは、事実のようです。

seems to be a fact.

そして、欧米の場合

And in the West.

―― "5人のうち1人"は、生還できない

"One out of five may not make it out alive"

ということです。

「COVID-19は、極めて死亡率の高い病気である」

"COVID-19 is a disease with an extremely high mortality rate"

という事実を、再度認識し、改めて青冷めています。

I reaffirm the fact that, and I am pale once again.

-----

という訳で、僭越ながら、以下、私の私見です。

Here's my personal opinion.

『(無自覚感染の)子どもや自分が老親の実家に帰省する』→『老親が感染、発病、入院する』 → 『高い確率で病院で帰らぬ人となる』

If your child and you with an unconscious infected, are going home to your parents, your old parents infected, sick, hospitalized, and your old parents won't return to the hospital.

という"流れ"が見えます。

I can see the "flow" of this.

"7.5%"

"7.5%"

という数字を見て、このフローチャートが、強く現実味を帯びて感じられるようになってきています。

This number give me a strong sense of that reality.

-----

私は、自分の親を自分の手で殺した当事者ですが ――

I was the one who killed my own parents with my own hands, however,

こんな思いと共に生きなければならない人は、少ない方がいいと思います。

The fewer people who have to live with these sense, the better it is, I think.

江端さんの忘備録

「XXXXをやっている人に悪い人がいない」という言葉が嫌いです。

I hate a saying "there is no evil person who do XXXX".

そして、こちらにも書いていますが、

I wrote about the topic here

=====

『ある特定の行為または職種に、高いモラルが宿る』という考え方自体が、

I think that the thought of "High ethical standards indwell in a special action or type of work" is

無知性で、狭窄視野的で、自己完結的で、

unenlightened, local outlook, self-contained and

論理的、数理的、統計的という考えが1mmも入り込まない

illogical, nonmathmatica, nonstatistical,

ぶっちゃけて言えば「アホの戯言」 ―― と思っています。

I think that it is "stupid shit", if I speaks quietly.

=====

このような「アホの戯言」は、自分の取り組んでいる仕事や研究、その他のアクティビテイ、そして自分の属しているグループや組織についても、見られます。

I can watch this "stupid shit" in work I am working on, research and other activities, as well as the groups and organizations I belong.

それはさておき。

That aside.

------

ご存知の通り、最近、私は、量子コンピュータの勉強をしています。

As you know, I have recently been studying quantum theory.

この量子という微小な物質の振る舞いが、人間という巨視的な物体の振る舞いに投射することで、なんでもかんでも、"量子"に結びつけて考えることができるように思えて ――

It's as if I can relate everything to the quantum. It means that I can understand the behavior of this quantum matter by projecting it into the behavior of a macroscopic object called a human being.

自分で自分を厳重に見張るようにしています。

Hence, I try to keep myself on high alert.

正直「量子」を使って宗教を作れるんじゃないかなぁー、と思っていたのですが、調べてみたら、本当に

I honestly wondered if I could use "quantum" to create a religion. and I really found that

■量子の振舞いを教義の根拠としているカルト宗教

- A cult that bases its doctrine on quantum behavior.

があり

■量子の振舞いから哲学を展開しているライフハックの本

- A book of life hacks that develops a philosophy from the behavior of the quantum

がありました。

-----

昨夜、「やはり俺の青春ラブコメは間違っている完」の第5話を見ていて、

Last night, while I was watching episode 5 of "My youth romantic comedy is wronte, as I expected -- final", I came to think

『なるほど、彼ら彼女らの言っている「本物」とは、「量子状態にある量子ビット」のようなものか』

"I see, the "real thing" they say is like "a qubit in a quantum state."

などと考えてしまい、その時、ハッと気がつきました。

and that hit me.

私は、

I came to think that my thoughts were same as

■「創作物」の内容を、自分で解釈できる都合のよいメソッド(量子力学)を持ち込んで、解釈しようとしている

- by trying to interpret the content of the "creation" by bringing in a convenient method (quantum mechanics) that I can interpret myself.

■これは、上記の低能カルト宗教や、安易ライフハック本と同じ愚行

- the lowly cult and easy life hack books above.

であり、上記の「アホの戯言」と同じものである、と思い至りました。

- the above "stupid shit".

-----

この思考アプローチは、極端なことを言えば、極右として「ファシズム」とか、極左としての「コミュニズム」とか、カルトとしての「原理主義」とかと同じようなモノであり、

This approach to thinking is the same thing in the extreme as "fascism" as the far right, or "communism" as the far left, or "fundamentalism" as a cult

メソッドと結びついた(特に、論理的に整合性があるものや、あるいは物理法則などに結びついた)考え方は、「極」に走りがちであり、それらが権力や大衆と結びついた時 ―― 数百万から数千万もの人々を殺害してしまう

Ideas tied to methods (especially those that are logically consistent or tied to physical laws, etc.) tend to run to the "extreme", and when that ideas are associated with power and the masses -- it will kill millions to tens of millions of people.

このことを、私は忘れてはならない

I must not forget it,

―― と、いうようなことを、

「やはり俺の青春ラブコメは間違っている完」の第5話を見ながら、考えていました。

I was thinking about this, and so on, while watching episode 5 of "My Youth Romantic Comedy is Wrong, I expexted -- final"

2020/08,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

ところが、直接話しかけなくても、COCOAアプリのインストールを調べる方法はあります。

However there is a way to know whether a person has installed COCOA app, without talking. It is to make

―― 「自分の目の前にいる人が『COCOAアプリをインストールしているか』を確認するアプリ」

"An app that checks to see if the person in front of you has the COCOA app installed"

を作れば良いのです(このアプリを便宜的に「COCOA'」と称呼します)。

(I will call this app COCOA' for convenience)

ポイントは、COCOAアプリが、オープンソースで公開されている点にあります。

The point is that the COCOA app is open source and publicly available.

これは、つまり、「時間」と「能力」と「スキル」と「気力」のある人間であれば、COCOAの派生アプリケーションである、COCOA'を自由に開発できる可能性がある、ということです。

This means that anyone with the time, ability, skills and energy can develop COCOA's derivative application, COCOA'.

ただ、正確に言うと、上記の「自分の目の前にいる人」のスマホを検知することはできません。

However, to be precise, this app cannot detect the contents of the phone of the "person in front of you" mentioned above.

COCOA'は、

The COCOA' can only detect

■あなたのスマホから、約半径10メートルの範囲内で、

- Within a radius of about 10 meters from your phone,

■「COCOAアプリがインストールされているスマホ」の「台数」

- Number of "phones with COCOA installed

を調べることができるだけです。

だから、「自分の目の前にいる人」がインストールしているか否かをを特定する為には、

So, in order to identify whether or not the "person in front of you" has COCOA installed. the condition is given:

■約半径10メートル以内には、その人以外には、誰もいない

"There is no one else within a radius of approximately 10 meters except that person.

ことが必要となります。

-----

COCOA'の動作原理は簡単です。

The principle of operation of 'COCOA' is simple.

COCOA'は、COCOAのBluetoothの電波を発射しているスマホを探すだけです。

The COCOA' tries to find a phone that is transmitting COCOA's Bluetooth signal.

それだけしかできません。

That's all the app can do.

しかも、Bluetoothの電波の中の情報は、個人情報(スマホ固体番号等)と紐付いていないので、個人の特定はできません。

What's more, the information in the Bluetooth radio waves is not tied to personal information (such as the phone's solid number), so it cannot be used to identify an individual.

あなたは、街の中で、FreeのWiFiアクセスポイントを探したことがあると思います。

I'm sure you've looked for free WiFi access points around town.

COCOA'も、これと同じことをするだけです。

COCOA' just does the same thing.

-----

もし私(か、あるいは誰か)が、このCOCOA'を開発したら、ちょっと面白いことができます。

If I (or someone else) develops this COCOA', it could be a bit interesting.

『COCOAをインストールしている人 = コロナリテラシーが高い』という仮説を"真"とした上で、以下のようなこと調査や判断ができるようになります。

If the hypothesis that "people who have COCOA installed = high corona literacy" is true, then the following investigations and judgments can be made.

例えば、

For example,

■COCOA'を、居酒屋やラーメン屋の入口で起動する

- Launching 'COCOA' at the entrance of an izakaya or noodle shop

これによって、その店の中で、何人の人間がCOCOAを起動しているか、一目瞭然です。

This allows you to see at a glance how many people in that store are running COCOA.

店舗に入る前に、ざっくりとした、その店舗内の「コロナリテラシー」の高いお客の人数を、店に入る前に調べることができます。

Before entering a store, you can find out, roughly, the number of "high corona literate" customers in that store before you walk in.

(私なら、10人のお客が入っているラーメン屋の入口で、COCOAが起動しているスマホが3台だけなら、そのラーメン屋には、入りません)

(I wouldn't go into a ramen shop with 10 customers if there were only three phones with COCOA running at the entrance of a ramen shop)

■COCOA'を、職場や、飲み会の会場で起動する

- Launching 'COCOA' at your workplace or at a drinking venue.

自分の属する組織やグループの「コロナリテラシー」を、集団として観測することができます。

You can observe the "corona literacy" of your organization or group as a group.

(私としては、『それを言い訳に、飲み会の出席を拒否する』という切り札としても使えると期待しています)

(For me, I'm hoping it can be used as a trump card to "use that as an excuse to refuse to attend a drinking session".)

これによって、今後、

In the future,

■『COCOAをインストールしたスマホをお持ちでない方の入店はお断りします』という張り紙

A sign that says, "we do not allow people who do not have a smartphone with COCOA installed to enter the store".

が、飲食店のみならず、全ての施設(役所、アミューズメント、学校)の入口の前に張られるようになるかもしれません。

The paper could be put up in front of the entrances of all establishments (government offices, amusements, schools), not just restaurants.

-----

ざっとソースコードを見てみたのですが、この新しいアプリ(COCOA')の開発は、私には、少々敷居が高いように思われます。

I took a quick look at the source code and it seems to me that developing this new app (COCOA') is a bit of a challenge.

スキルも時間も足りませんが、特に時間の要素が大きそうです。

I don't have enough skills or time, but the time factor seems to be particularly significant.

従って、当面の私の仕事としては、

Therefore, for the time being, my work is to to write a column that explains easily

『COCOAによって、個人情報を抜き取られる心配はしなくていいよ』

"You don't have to worry about COCOA extracting your personal information"

を、分かりやすく解説するコラムを執筆する ―― こっちなら役に立てるかもしれません。

I might be able to help you with this work.

2020/08,江端さんの技術メモ

// mail.go

package main
 
import (
    "net/http"
 
    "github.com/labstack/echo"
)
 
func main() {
    e := echo.New()
	e.POST("/save", save)
	e.Logger.Fatal(e.Start(":1323"))
}


func save(c echo.Context) error {
	 name := c.FormValue("name")
	 email := c.FormValue("email")
	 return c.String(http.StatusOK, "name:"+name+", email:"+email)
}

でもって、curlで送ってみた。

ebata@DESKTOP-P6KREM0 MINGW64 ~
$ curl -F "name=ebata" -F "email=mailmail" http://localhost:1323/save

で、出力が、以下のようになった。
name:ebata, email:mailmail

2020/08,江端さんの忘備録

コロナ感染症対策として、マスクが有効か否かついては、こちらで記載しております。

Whether or not masks are effective in fighting corona infection is described here.

また、こちらで記載しているように、感染しているか否かを、"0"と"1"のように考えることができないことも明らかです。

It's also clear that you can't think of being infected or not as a "0" and a "1", as described here.

しかし、その効果がどうであれ、「マスク」が一種のマナーとなっているのは事実です。

But whatever the effect, it is true that "masks" have become a kind of etiquette.

そして、「マスク」は、いわゆる「コロナリテラシー」の初歩の初歩と言えます。

And the "mask" is the first step of steps in so-called "corona literacy".

私としては、このマスクに加えて「COCOA(新型コロナ接触確認アプリ)」を、このマナーに入れることを提言したいと思います。

For me, I would like to suggest that in addition to this mask, the COCOA (new corona contact verification app) be included in this etiquette.

COCOAについては、すでに私、色々書いていますので、参考にして下さい。

I've already written a lot about COCOA, so please refer to it.

■COCOAのインストールは個人の自由ですが、私はインストールをお勧めしたいと思います。

Installing COCOA is a personal choice, but I would recommend that you install it.

■「セキュリティが万全」というよりは、「ハックするコストが全然見合わない」という感じです。

It's not so much "full security" as it is "not at all worth the cost to hack.

私は、「COCOAのインストール」を実施したか/していないかで、その人の「コロナリテラシー」を判断できると思っています。

I believe you can determine a person's "corona literacy" by whether or not they have/don't have implement a "COCOA installation".

-----

やり方は色々あると思いますが、もっとも簡単な方法は、

There are many ways to do this, but the easiest way is to ask a question,

『COCOAインストールしました?』

"Have you installed COCOA?

という質問をすることです。

■「もちろんです」という人は、リテラシー"1"で良いと思います。

If the person says "of course", I think his/her literacy level is "1".

■「ああ、COCOAですね。でも個人情報について不安が・・・」という人は、「リテラシー"0.9"」くらいと判断して良いかと思います。

"Oh, COCOA. But I'm worried about personal information...", I think it's safe to say that he/she have a literacy level of "0.9".

比して、

In comparison to,

■「COCOA? 何ですか、それ?」という人は、「リテラシー"0"」と断定して良いでしょう。

If the person says "COCOA? What's that?", I think his/her literacy level is "0".

いわゆる「自粛警察」をやっている人で、COCOAを知らない人がいたら、あなたは、その「自称警察官」、殴っていいです。

If you're a so-called "self-restraint police" and you don't know COCOA, I will hit you absolutely.

(私は、これに加えて、大声で、"ふざけるな!"と罵ります)。

In addition, I will shout "Do not be silly!" loudly,

(続く)

(To be continued)

2020/08,江端さんの技術メモ

golang ではファイル名が _test.go で終わるファイルを run すると
上記のエラーが表示されて実行できません。

ちなみに、buildだと

$ go build echo_test.go
no packages to build

と表示されて、なんのことやらさっぱり分かりませんでした。

2020/08,江端さんの技術メモ

$ go build echo.go
echo.go:4:5: cannot find package "github.com/trevex/golem" in any of:
        c:\go\src\github.com\trevex\golem (from $GOROOT)
        C:\Users\ebata\go\src\github.com\trevex\golem (from $GOPATH)

ebata@DESKTOP-P6KREM0 MINGW64 ~/go_websocket_test
$ go get -u github.com/trevex/golem

ebata@DESKTOP-P6KREM0 MINGW64 ~/go_websocket_test
$ go build echo.go

2020/08,江端さんの忘備録

(昨日の続きです)

(Continuation from yesterday)

私は、コラムを書くのが好きで、イラストを描くのが好きで、コーディングをするのが好きで、そして ――

I like to write columns, I like to illustrate, I like to code, and

その全てが「下手くそ」です。

I am not good at all of them.

だから、これらを他人に任せるのが、もっとも効率的であり、いわゆる『生産性が上がる』のは間違いないでしょう。

So, I think it's most efficient to leave these things to others, and there is no doubt that it will increase so-called "productivity".

だが、それは「楽しいのか?」

But is it "fun"?

自分の作り出したモノ、自分でやった仕事は、他人のモノや仕事より「愛おしくはないか?」

Do you love what you created and worked, more than other people's creations and works ?

と考えると、私には分からなくなるのです。

I don't know that.

それ故に、私は「私を幸せにするアプローチ」として、

Therefore my "approach to making me happy

(1)ひとりでやる

(1) Do it alone.

(2)ずっとやる

(2) Do it for a long time.

(3)会議に出ない(ここはGoogleと同じで、これまでも、これからも)

(3) Don't attend meetings.(It's the same as Google here, from now and to now)

を続けていくことになると思います。

I think I'll continue to do them.

-----

つまるところ、これは人間のスケール感の問題かもしれないなぁ、とも思います。

As a result, I think that this is about a matter of human scale.

私は「技術」が好きで、特に「小技」が好きですが、その技の集大成である「サービス」や「ビジネス」が好きな人にとっては、「Google式仕事術」は正しいアプローチだと思います。

While I like "technology" and especially the "little tricks, for people who like "service" and "business", the "Google Method of Working" is the right approach.

私は、「他の人」を喜ばせることに幸せを感じられます。

I feel happy to please other people.

しかし、私は、「"多く"の他の人」を喜ばせることが、"多くの幸せ"になるとは、感じることはありません。

However I can't feel many happiness to please many other people.

つまるところ、

In conclusion,

『私は、人間としての器が小さい』

"I don't have what it takes"

この結論で、私は異義ありません。

I have no objection to this conclusion.

2020/08,江端さんの忘備録

「Google式仕事術」では、生産性を上げる為に、以下を提唱しているそうです(読んでいません)。

The "Google Method of Working" advocates the following to increase productivity (I haven't read it)

(1)ひとりでやらない

(1) Don't do it alone.

(2)ずっとやらない

(2) Don't do it for a long time.

(3)会議に出ない

(3) Don't attend meetings.

なるほど「生産性を上げる為」には、これが正解かもしれません。

Okay, maybe this is the right thing to do "to increase productivity".

しかし、「生産性なんぞ知ったことか」と置き換えるだけで、このメソッドはボロボロと崩れていきます。

But simply replacing it with "I don't care of productivity", the method falls apart in tatters.

-----

私、生産性については、かなり徹底的に勉強しました。

Me, I've studied productivity pretty thoroughly.

その結果、「生産性について、合意が取れている定義が存在しない」ということを発見しました。

As a result, I found that "there is no agreed-upon definition of productivity.

そして、「生産性」と「幸福」の間には、強い相関が存在しないことも知りました。

I also learned that there is no strong correlation between "productivity" and "happiness".

-----

「生産性を上げる = 幸福」と「幸福 = 善」から、「生産性を上げる = 善」という三段論法は成立します。

The triadic argument, "Increase productivity = happiness" and "Happiness = goodness," is established from "Increase productivity = goodness.

しかし、

However, it can also be interpreted as,

―― その"生産性"を上げるのは、"私以外の誰か"で良くね?

"Why can't someone other than me make it more productive?"

という解釈が可能です。

さらに、「Google式仕事術」が、"この私"に「楽しさや喜びを与えているのか?」 という点について、私には分からないのです。

Furthermore, I can't know that "Google Method of Working" gives me joy and pleasure of mine.

■自分でコラムを書かなくても、面白いコラムを書いている人がいるから、そのコラムを読めばいい。

- Even if I don't write your own column, someone else writes an interesting column, so I can read it.

■綺麗なイラストを書ける人は、世の中にゴマンといるから、その人に外注すればいい

- There are many people who can draw beautiful illustrations in the world, so I can outsource to them.

■自分でコーディングしなくても、コーディングのプロに頼めばいい

- I can ask a professional to do the coding for me.

まったく、その通りだと思います。

I think these are absolutely right.

(続く)

(To be continued)

2020/08,江端さんの技術メモ

0. メモ

CREATE DATABASE ca_sim0; の逆で、DBの消去方法は DROP DATABASE ca_sim0;

  1. メイン

すでに地図DBは作ってきたが、今のうちに纏めておきます。ここでは東京の豊洲地区を例にして説明します。

なお、Dockerの利用を前提とし、それぞれの地区のDBはバラバラに管理するものとします。地区ごとに取り扱えるようにして、DBを切り替えて利用することを前提とする為です。

(Step1) (to-path)/toyosu というディレクトリを掘る

(Step2) そのディレクトリに、以下のdocker-compose.ymlを作ります。

version: '3.7'

services:
  db:
    image:  postgis-pgrouting:latest
    environment:
      POSTGRES_HOST_AUTH_METHOD: 'trust'
      POSTGRES_PASSWORD: 'postgres'
    expose:
      - 5432
    ports:
    - 15432:5432
    volumes:
      - db_data
      - ./shared:/shared
  db_data:
    image: busybox
    volumes:
      - /data/db

これに対して、

docker-compose up -d
Creating network "toyosu_default" with the default driver
Pulling db (postgis-pgrouting:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Continue with the new image? [yN]y
Pulling db (postgis-pgrouting:latest)...
ERROR: pull access denied for postgis-pgrouting, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
ubuntu@ip-172-26-13-137:~/toyosu$

てなものが出てきた時は、

image: postgis-pgrouting:latest

の代わりに、

image: pgrouting/pgrouting:v3.0.0-dev-postgresql_12

にしたら動いた(理由は不明だが、まあいいか)

DB(PostgreSQL)のアクセス用のポート番号は、15432としています。ローカルにPostgresがある場合にバッティングを避ける為です。

(Step3) そのディレクトリの中で、"docker-compose up -d"を実行する。

(Step4)"$ docker start -a toyosu_db_1"としてコンテナを起動する

(Step5)(winpty) "docker container exec -it toyosu_db_1 bash" でシェルに入る

(Step6) "psql -U postgres" で、DBのコンソールに入る

(Step7)psqlでデータベースを新規作成する(以下、データベース名をca_simとする)。

postgres=#CREATE DATABASE ca_sim

(Step8)次のコマンドを実行する

postgres=# \c ca_sim
postgres=# create extension postgis;
postgres=# create extension pgrouting;

(Step9) ここで、もう一つ、コンソール(2)をたちあげて、(to-path)/toyosuに入っておく

(Step10) https://www.openstreetmap.org/ から、豊洲地区を選んで地図DBをエクスポートする

ファイル名を"toyosu.osm"として、(to-path)/toyosuに保存する。

↓私が使っている、"toyosu.osm"

(Step11) コンソール2で、"toyosu.osm"を、コンテナに放り込む

>docker cp toyosu.osm toyosu_db_1:/db_data

(Step12)コンソール2で、"apt-get update"、"apt-get update" を実施した後、"apt-get install osm2pgrouting"を実施

(Step13)コンソール2で、"osm2pgrouting -f /db_data/toyosu.osm -c /usr/share/osm2pgrouting/mapconfig_for_cars.xml -d ca_sim -U postgres" を実施

これで、地図DBはできているハズだが、多分、一発で成功することはないので、いろいろ試してみて下さい。

(Step14) psqlでログインしているコンロールから、以下の操作をして表示ができれば、成功

postgres=# \c ca_sim
You are now connected to database "ca_sim" as user "postgres".
ca_sim=# \dt
List of relations
Schema | Name | Type | Owner
--------+-------------------+-------+----------
public | configuration | table | postgres
public | pointsofinterest | table | postgres
public | spatial_ref_sys | table | postgres
public | ways | table | postgres
public | ways_vertices_pgr | table | postgres
(5 rows)

ca_sim=# select * from ways;

以下のような表示がでてくれば、(多分)成功

QGIS3で接続すると、こんな感じのものが表示されるはず

以上