2024,江端さんの忘備録

以前、GIGAスクール構想に関するコラムを書きました。

I have previously written a column on the GIGA school concept.

先日、ニュース番組で、名古屋市の小学校で、子どもたちの『ITリテラシー格差』の発生に関する特集が組まれていました。

A news program recently ran a feature on an "IT literacy gap" among elementary schools in Nagoya City.

格差の発生の原因を纏めると ―― どの世界でも同じですが ―― 「金(予算)」と「人材(教師)」らしいです。

The causes of the disparity can be summarized as "money (budget)" and "human resources (teachers)" -- the same as in any other world.

学力格差の発生も、「金(塾)」と「人材(講師)」ですから、全く同じ形態であると言えます。

The academic achievement gap is also caused by "money (cram schools)" and "human resources (instructors)," so it can be said that it is precisely the same form.

-----

ただ、私、見誤っていたことがあります。

I, however, have been looking at it wrong.

確かに「金」と「人材」の問題はあるけど、私たちは、それを乗り越える歴史的奇跡の3年間 ―― "コロナ禍"があったのです。

Yes, there are "money" and "human resources" issues, but we have had three years of historical miracles to overcome -- the "Corona Disaster."

あの時、子ども大人も、登校や出社を禁じられ、自宅での学習や就労をしなければなりませんでした。

At that time, children and adults were also forbidden to go to school or work and had to study or work at home.

それも、3日間でも、3ヶ月間でもなく、3年間です(まあ、3年間まるまる、という訳ではありませんが)。

Not for three days or three months, but for three years (well, not the whole three years).

『この3年間で、教師のITリテラシーは、爆上がりしたんだろう』 ―― 私は、そう信じていましたし、そんなことも書いていました。

I believed, and even wrote, that "IT literacy among teachers must have exploded in the last three years.

(が、私のその日記を見つけられませんでした。誰か見つけたら教えて下さい)。

(but I could not find that journal of mine. If anyone finds it, please let me know).

現場の教師は、全員、リアルタイムの遠隔授業を、自力で実施できるくらいに、レベルアップした ―― と信じていた私は、ただのマヌケでしたか?

Was I just a fool to believe that all teachers in the field had improved to the point where they could conduct real-time remote classes independently?

-----

ただ、現場の教師が、「タブレットのフリーズ対応」や「Wifiの設定」や「LANの敷設」までやらされているとすれば、それは、かなり酷い状況です。

However, if teachers in the field are being asked to "deal with tablet freezes" or "set up wifi" or even "install LAN", then that is a pretty bad situation.

その仕事は、基本的には、電気、水道、建物の修繕などの、学校の設備のメンテナンスを行う、用務員さんの仕事です。

The jobs are essentially that of a janitor, who maintains the school's facilities, including electricity, water, and building repairs.

しかし、電波強度、指向性、ITアドレス、デバイスドライバ、アプリのインストール、セキュルティ対策から、AWSのクラウド設定に至るまでの、IT設備の全部を網羅する ――

But it covers the whole gamut of IT equipment, from signal strength, directionality, IT addresses, device drivers, app installation, security measures, AWS cloud settings, and more.

そんな『IT用務員さん』がいるでしょうか? まあ、いないでしょうね。

Would there be such an "IT janitor"? Well, I don't think so.

多分、そのスキルがあれば、どこぞの企業のITシステム管理部門で働けます。

Maybe with those skills, they can work in any company's IT systems management department.

公立の小学校の給料よりは、稼ぎが良いでしょうしね。

And they would be making more than a public elementary school salary.

-----

なんとなく、GIGAスクール構想に根本的に欠けているのは、タブレットとかアプリの使い方以前に、学内における、ITインフラのメンテナンスを行える体制にあると思うんですよ。

I think the GIGA School concept fundamentally lacks a system that can maintain the IT infrastructure on campus, even before tablets and apps are used.

でまあ、その辺りの体制が、私のようなシニアIT技術者のリタイア後の受け皿になってくれるといいなぁ、と思っています。

I hope the system in that area will be a good place for senior IT technicians like myself to receive after retirement.

なにしろ、ITのアプリは凄い進歩していますが、ITのインフラそのものは、私の見たところ、1970年ころから、さほど進化しているようには思えないのです ―― いわば、電気の結線、水道の管の接合レベルです。

IT applications have made significant progress, but the IT infrastructure itself, as far as I can tell, has not evolved much since 1970 -- at the level of electrical wiring or water pipe joints.

なので、「シニアIT技術者のリタイア後の受け皿」は、私が死ぬ時くらいまでは、多分大丈夫かなぁ、と思っているのです。

So, I think the "retired recipients of senior IT technicians" will probably be exemplary until about the time of my death.

『要するに、政府は、国民のITリテラシー向上の為に、国民を訓練をしている訳だね』

2022/04,江端さんの忘備録

私は、私の生涯で見た、最高の発明品は、「ピーラー(皮むき器)」であると思っていました。

I used to think the peeler was the best invention I had seen in my lifetime.

しかし、一昨年、「mRNAワクチン」に首位を奪われました。

However, the year before last, it lost the top spot to "mRNA vaccines."

現在、この首位は不変なのですが、次点の「ピーラー」に対抗する"もの"が登場しました。

The top spot remains unchanged, but a new competitor to the runner-up, the peeler, has appeared on the scene.

「パワーグリッド」です。

It is a "Power Grid"

筋トレには興味ないのですが、『視野に入るところに「鉄棒」があれば、なんとなくぶら下がってみたくなる』というのは、新しい発見でした。

-----

これ凄いです。

This is amazing.

私のぶら下がり限界時間が、20秒→60秒にアップしました。

My hanging limit time has increased from 20 seconds to 60 seconds.

使ってみた分かったのですが、「パワーグリッド」は、自分の体重を、握力だけで支えるのではなくて、腕に巻かれたバンドでも支えることができるため、弱い握力でも十分にぶら下がっていられるのです。

I found that the "Power Grid" can support my weight by my grip strength and a band wrapped around my arm so that I can hang on even with a weak grip.

ただ、私の部屋の鉄棒は、天井と鉄棒までの間隔が狭いので、掌に巻き込む弾性体(ゴム)が巻き付きにくくて、かなり手間がかかります。

However, the bars in my room are very narrow between the ceiling and the bars, so the elastic (rubber) that wraps around the palm is rugged and takes a lot of work.

体を十分な高さに持ち上げないと、弾性体を掌に巻き付きを得られないので、現在、脚立を使って、天井に近付いています。

The body must be lifted high enough to get the elastic to wrap around the palm, so we are now using a stepladder to get closer to the ceiling.

-----

で、思ったのですが、これは、小学生たちを救済する、最終兵器になるのではないか、と思うのです。

And I thought this could be the ultimate weapon to save elementary school students.

さか上がり ―― それは、私が『愚劣教育の極み』と断定した、体育ハラスメントである、鉄棒運動の技の一つです。

愚劣教育の極み

"kick over" ---- It is one of the bar exercise techniques I have determined to be 'the ultimate in foolish education' and physical education harassment.

パワーグリッドが、逆上がりに上手く適用できるかは不明ですが、もし上手く使えるのであれば、「逆上がり」に悩む子どもたち(かつての、私を含む)を、一気に救済するのではないか、と期待しています。

I am unsure if the Power Grid can successfully be applied to "kick over." Still, if it can be used successfully, I hope it will relieve children (including myself, once upon a time) struggling with "kick over" in one fell swoop.

「逆上がり」なんぞは、しょせん補助器具を使えば、誰でもできるものであるという事実は、「逆上がり」の価値を下落させ、教育現場から、「逆上がり」の意義を、消し去るに足ると思います。

The fact that anyone can do "kick over" with the use of aids is enough to diminish the value of "kick over" and erase the significance of "kick over" from the educational field.

まったく、

Anyway,

世の中には、『外で遊ばない子どもは成績が悪い』 ―― ということを、何がなんでも主張したい大人が多いようです。

世の中には、『外で遊ばない子どもは成績が悪い』 ―― ということを、何がなんでも主張したい大人が多いようです。

"There seem to be many adults in the world who want to insist at all costs that "children who don't play outside get bad grades."

でも、書きましたが、まったく、『「屋外で遊ぶ子ども」礼賛主義』には、本当にうんざりです。

But, as I wrote, I am sick and tired of the "children playing outdoors" culture.

どの口が『多様性の尊重』『個性重視』などと言ってやがる、と、思います。

I wonder what kind of people are talking about "respect for diversity" and "emphasis on individuality."

「とじこもり続け」「コミュニケーションを忌避する」 ―― そういう子どもを、そのままに認めることを、"ダイバーシティ"って言うのです。

A "shut-in" or "communicative disorder" - to accept such a child as they are is called "diversity.

2019,江端さんの忘備録

世の中には、『外で遊ばない子どもは成績が悪い』 ―― ということを、何がなんでも主張したい大人が多いようです。

In the world, there are many adults who want to insist on that "children who do not play outside have poor grades."

私は、この手の議論に対して、終始一貫して

I have consistently thought that this kind of argument is

―― アホか

"How stupid he/she is".

と思っています。

-----

最近、また、「新説」を読みました。

Recently I read the "new theory" again.

どっかの講師だったか教師だったか忘れましたが、『高層マンション高い階に住んでいる子どもの理科の成績が悪い』と主張していました。

I forgot whether the author was a teacher or a teacher, but he insisted that "Children living on high floors of a high rise apartment have poor grades in science".

その理由が、「高い階に住んでいる子ども」は、自然に接することがなく、自然に対する理解が不足するから、だそうです。

The reason is that "children living on the high floor" is not in touch with nature and lacks understanding of nature.

この手の主張で興味深いのが、必ず『これまでの、私の10年以上の経験で・・・』という下りが登場することです。

The interesting thing about this kind of claim is that the line "This is my past experience of over 10 years ..." has appeared.

この講師だか教師だか知らんこの人は、「統計データ」一つ出すこともせずに、単に持論を展開しているのです。

I am not interested in the person, whether teacher or a teacher, however, he simply develops his own theory without giving out one "statistical data".

多分、統計手法における「検定」の概念すら知らんのだろうと思っています。

Perhaps he even knows the concept of "testing" in statistical methods.

客観的なデータを示さずに、よくもまあ、そんな主張ができるものだと感心します。

I am impressed that he can make such a claim without giving objective data.

私は、自分の仮説に基づく仮説を、自分自身の計算で「潰して」しまったことが、何度もあります。

Many times, I have "killed" my hypotheses based on my own experiments in my own calculations.

そんな時は、相当な徒労感で、かなり落ち込みます。

At that time, I felt quite depressed and quite uneasy.

『これまでの、私の10年以上の経験で・・・』が、いかに信用できないか、を、私は知り尽しているのです。

I do know that how "this is my past experience of over 10 years ..." is doubtful.

-----

ちなみに、私は、『外で遊ぶのが大嫌いな子ども』でした。

By the way, I was "a child who hates playing outside."

外は、暑いし、寒いし、ケガするし、複数で遊べば、頭が悪いガキの命令口調にムカつきました。

It was hot, cold, and risky moreover I have irritated a poor boy who caress of the leader.

ですので、部屋の中で、一人で、科学の図鑑を読んでいる方が、圧倒的に好きでした。

That's why I liked overwhelmingly reading a science illustration, alone in my room.

しかし、今の私は、自然に対する理解や情熱(?)が、そんじょそこらの大人に負けていないという自負があります。

However, I now have the pride that our understanding and passion for nature is better than those of other adults.

さらに、コンピュータシミュレーションという「技」を身につけたことによって、自然に対する理解は、さらに深まったと確信しています。

Furthermore, I am convinced that my understanding of nature has been further deepened by acquiring the "simulation" by computer.

-----

まあ、それはさておき。

Well, that aside.

『高層マンション高い階に住んでいる子どもの理科の成績が悪い』というのであれば、先ずは数値で、その事実を示せ、と、私はいいたいです。

If he want to claim that "children living on high floors of a high rise apartment have poor grades in science", show me the number first.

『外で遊ばない子どもは成績が悪い』のロジックは、私は聞き飽きているんですよ。

I'm tired of hearing the logic of "children who don't play outside have poor grades".

-----

まあ、そういう私も、私も統計も使わずに、独断的に主張していることが、ない訳ではありません。

To tell you the truth, I have a claim selfishly without using statistics.

それは、

That is

『勉強しない子どもは成績が悪い』

"Children who do not study have poor grades"

ということです。

私に関しては、これだけです。

That's all for me.

多分、すぐにデータも出せます。かなり簡単に。

Maybe I can open the data soon. Pretty easy.

2010,江端さんの忘備録

小学生の頃、放課の時間になると外に追い出されていました。

真夏の炎天下、真冬の小雪の吹雪の中でも例外なしです。

そして、真冬の授業開始前に、マラソンと称して、校庭を10周も走らされた日々は、「小学生」という私の人生の貴重な時代を、決定的に暗黒の時代にしてくれました。

あのマラソンなる阿呆なイベントは、小学生の私を重度の鬱病にし、不必要に風邪などの病理を招いたことは、今となっては明白な事実です。

当時の教師達か、A県の教育委員会か、なんだか分からないけど、そういう組織か法人に、損害賠償請求(民709条)を請求したいものだ、と、ふと、今日思いました。

が、すでに時効が成立していました(20年)。

-----

それと、今でも、給食を食べ切れない児童を、居残りさせてまで食べさせる意義が、どこにあったのかを、私は知りたいのです。

どなたか、小学校の給食が食べられなくて、栄養不足で死亡した児童がいたら教えて頂けませんか。 私は確信を持って、一人もいないだろう、と断言できます。

-----

クラス全員が「逆上がり」ができることで、『全員達成!』を標榜し、逆上がりができない子供を追いつめる教育をしていたA県の小学校の教育は、「愚劣」を百万回称呼しても足りないくらいの愚劣教育の極みだと断言します。

戦時中の「隣り組制度」や、日本の隣に位置する独裁国も真っ青の全体主義教育を、当時の保護者はどうして看過できたのでしょうか。

-----

当時の小学校とは、私には、理不尽の集大成でした。

理不尽であることを学ばせることを目的としているのであれば、その意義は十分に果せていると思います。

A県は、私の出身地です。

私がA県から離れた理由は、A県の教育に起因しています。

いずれお話します。

2024,江端さんの忘備録

最近、「生成AIの使い方講習」というメールが、頻繁に参上します。

Recently, I have received frequent e-mails asking for "training on using the Generative AI.

私は、この連載で、バズワード批判をしてきましたが、「生成AI」に関しては、私はバズワードと言い切れないのです。

I have been a critic of buzzwords in this series of articles, but when it comes to "generative AI," I can't say it is a buzzword.

なぜなら、私は「生成AI」を、毎日使い倒しているからです。

Because I use the "Generative AI" to the fullest every day.

-----

この「生成AI」と組み合わさって登場するニュースヘッドをちょっと調べてみたのですが、

I did a little research on the news heads that appear in combination with this "generative AI,"

「上手な使い方」

"Good use"

「経営層」

"The management ranks."

「社会課題の解決方法」

"How to solve social problems."

「3時間で学ぶ」

"Learn in three hours."

「成果を上げるための3つの鍵」

"Three Keys to Better Results."

うん、これまで通りですね。

Yes, it's the same as before.

自分で生成AIを使って試したことがない人に向けたニュースヘッドです。

These news heads are for those who have never tried using a generative AI.

これらは、生成AIを、『自分で使わずに誰かに使わせてラクしたい』または、『自分で使うにしてもできるだけ手を抜きたい』という人に向ける甘言になっています。

These are sweet words for those who want to "let someone else use it without using it themselves" or "cut corners as much as possible even if I use it myself.

-----

なんかなぁ、って思うんですよね。

I wonder what it is.

私、小学生の頃、逆上がりができなくて、今でも「逆上がり」という言葉がトラウマです。

I couldn't do the "back hip circle" in elementary school, and I am still traumatized by the word.

さか上がり ―― それは、私が『愚劣教育の極み』と断定した、体育ハラスメントである、鉄棒運動の技の一つです。

「逆上がり」ができなくて困っていた私に、大人たちが言い放った言葉は、

What did the adults say to me when I was having trouble doing "back hip circle"?

―― 理屈じゃないんだ。何度も練習して、自分の体で覚えていくんだ

"It's not logic. You practice it over and over, and your body learns it."

でした。

------

私、生成AIでラクしたい、手を抜きたい人に対して、『同じこと』を言いたいんですけど、いいですか。

I want to say 'the same thing' to those who like to cut corners and get comfortable with generative AI, OK?

だって、生成AIに対して行うことは、自然言語や表や図を投入するだけです。

All you have to do for a generative AI is feed it natural language, tables, and figures.

なんで、その程度のこと、自分で試さないんですか?

Why don't you try that level of detail yourself?

はっきり言って、生成AIに興味があって、それを自分で試さない大人は、『小学生以下』と言われても仕方ないです。

An adult interested in generative AI and not trying it out for themself can be called 'less than an elementary school student.

未分類

https://airuca.com/camera-rtsp/

Panasonic / i-Pro

WV-S2130

RTSPパス rtsp://

Src/MediaInput/stream_1
Src/MediaInput/stream_2
Src/MediaInput/stream_3
Src/MediaInput/h264/stream_1
MediaInput/h264
MediaInput/mpeg4
VideoInput/1/h264/1

 

なんか、ドンピシャな情報

からコピペさせて頂きました。

====== さらに引用 ここから =======

これでRTSPストリームのURLはわかりました。
次にこのURLで映像を見るとき、どうやってカメラに設定したユーザー名とパスワードを使って認証させるのか?という課題が生じます。
こちらは下記のようなURLを作れば問題ありません。
(例)H.264/H.265のストリーム1の映像を参照したい場合
rtsp://UserName:Password@IP_Address_of_camera/Src/MediaInput/stream_1

そして最後に、上のURLをffplayで再生するには下記のコマンドをffplayのあるディレクトリ内で実行します。

ffplay -i rtsp://UserName:Password@IP_Address_of_camera/Src/MediaInput/stream_1

再生はされるがよく途切れる、灰色になって表示されない部分がよく出て不安定といった場合は、RTSPでのデータ伝送にTCP接続を強制すると改善するかもしれません。
TCP接続を強制する場合のコマンドは下記のようになります。

ffplay -rtsp_transport tcp -i rtsp://UserName:Password@IP_Address_of_camera/Src/MediaInput/stream_1

このとき、ffplayのウィンドウサイズはカメラ側で設定した解像度に合わせられます。
ffplayでPanasonicのIPカメラの映像を再生する方法は以上です。

====== 引用、ここまで ======

ありがとうございました。

 

JVC

VH-H268R
VH-H268VPR

RTSPパス rtsp://

ONVIF/Streaming/channels/0
ONVIF/Streaming/channels/1
ONVIF/Streaming/channels/2
ONVIF/Streaming/channels/3

2024,江端さんの忘備録

コラムが書きたい ―― 最近、とても、とても、とても、そう思います。

I want to write a column -- very, very, very much so lately.

書きたいネタが沢山あるんです。

I have a lot of stories to write.

轢断のシバタ先生にも、お願いしていることもあるんです。

I have even asked Dr. Shibata, a "run-over," to help me.

EE Times Japan編集部の編集部(編集長?)が、『最近、あの、江端の膨大な文章を編集しなくて、ラクだな』と思って頂けているなら、それが唯一の救いです(救いか?)。

If the editorial staff (editor-in-chief?) of EE Times Japan thinks, "It's so much easier not to have to edit Ebata's huge amount of writing these days," that's the only relief (or is it?).

-----

私が、「コンピュータの中に街を作る」のと、「コラムを書く」のは、どちらが世界に貢献しているだろうか?

I would contribute more to the world, "building a city inside a computer" or "writing a column"?

―― と考えて、そして、すぐに考えるのをやめました。

-- and then quickly stopped thinking about it.

『うん、どっちも世界に貢献はしないな』と思ったからです ―― 謙遜なんて1mmもありません。

I thought, 'Yeah, neither one of them contributes anything to the world' -- there's not a millimeter of modesty.

どっちも私のエゴの集大成です。

Both are the culmination of my ego.

でも、『コラム書きたい、書きたい、書きたい』が止まりません。

But I can't stop. 'I want to write a column. I like to write a column.

地図DB作りや、時刻表や、シミュレータや、映像転送コードや、生成AI評価や、特許明細書の執筆から、逃げたい訳ではありません。

I do not want to escape from making map databases, timetables, MAS simulators, video transfer codes, generating AI evaluations, or writing patent specifications.

ええ、そうです ―― 多分。

Yes, it is -- probably.

―― 私には、書きたいこと/言いたいことが沢山あるからです

2024,江端さんの技術メモ

Keyword:USB LAN ehternet アダプタ ubuntu  etc netplan

(1)>ip addrで、
8: enx207bd2222d29: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 20:7b:d2:22:2d:29 brd ff:ff:ff:ff:ff:ff
みたいな奴をみつける

(2)/etc/netplan/99_config.yamlで、以下のよう書き替える

network:
  version: 2
renderer: networkd
ethernets:
eth0:
#      dhcp4: false
addresses:
192.168.101.30/24
routes:
- {to: default, via: 192.168.101.1}
#      addresses:
#        - 192.168.0.15/24
enx207bd2222d29:
dhcp4: false
addresses:
192.168.0.15/24
(3) sudo netplan apply でネットワーク再起動

TP-LINK / Archer C2300 を再度設定しなおす

2024,江端さんの忘備録

以前、

Before,

「ブルーピリオド」という漫画の無料版を読んで、『久々に凄いもの読んだ』と思いました。

という話を書きました。

I wrote a story about this.

先程、

Now,

「YOASOBI、ヒット曲『群青』の世界観 マンガから学ぶ」

という記事を読んで、しっくり入ってきました。

I read the article that I could understand nicely.

-----

こういう『ブルーピリオド』の主人公のような生き方は、本当に、美しく、尊く、その内面から溢れる光と力で、世界を豊かに彩ります ―― 赤の他人にとっては。

This kind of life, like the protagonist of "Blue Period," is genuine, beautiful, and precious, and it enriches the world with the light and power that overflows from within -- for a stranger.

しかし、当の本人にとって、このような生き方は、絶望と挫折が無限に繰り返す、煉獄の日々です。

For the persons themselves, however, this way of life is a purgatory of endless cycles of despair and frustration.

『私は、ついに、こういう生き方ができなかったなぁ』と、しみじみと思っています。

I think, 'Finally, I couldn't live like this.

なぜ、"今"、そう言い切れるかというと、私は、残りの人生においても、『ブルーピリオド』の主人公のような生き方をする予定はないからです。

I can say that "now" because I do not plan to live the rest of my life like the protagonist of "Blue Period."

私は、やれることをやり、できないことは諦めます。

I do what I can and give up what I cannot.

そういう今の生き方がいい ―― 煉獄の日々よりはずっといい。

That kind of life now is good -- much better than the days of purgatory.

-----

まあ、それにしても、自分ではない赤の他人に期待する人の、なんと多いことか。

How many people expect others who are not themselves to do so?

将棋でも、野球でも、何でも構わないけど、私は、自分でない他人の偉業を「素晴しい」と思いますが、それ以上でも以下でもありません。

I consider the accomplishments of others, be it chess, baseball, or whatever, to be "great," but nothing more or less than my own.

私は、自分のやりたいことだけで、自分のリソースを100%使い切っています。

I use 100% of my resources to do what I want.

私には、赤の他人を応援するだけの余裕がありません。

I do not have enough time to support a stranger.

『赤の他人を応援できる人は、一体どこに、そんな余裕があるのだろう』と不思議に思うことがあります。

Sometimes I wonder, 'Where in the world does a person who can support a stranger find the time to do so?

ともあれ、私は『自分では達成できない何かを、赤の他人に代替させ、期待すること』ことだけは絶対しない ―― そういう自分であり続けたいと思っています。

Anyway, I will never do anything I can't achieve by myself and expect someone else to do it for me -- I want to keep being that kind of person.

ましてや、『自分以外の他人が、自分の期待通りにならかったことを批判する』―― そういう醜悪な人間の側に属することだけは、死んでもゴメンです。

And I will not be on the side of those ugly people who criticize others for not living up to their expectations, even if someone kills me.

2024,江端さんの技術メモ

まず、この2つの点は、どっちが、私(江端)が追加したノードだったのかを思い出すことにします。

上のノードは、こんな風

id番号が若いから、こっちが私が作った方で、まあ、間違いないでしょう。

念の為、もう一方も確認。

こちもID番号若いけど、以前管理した番号とは違うみたいだから、こっちが既存のノードであろう、とする。

これを私が結線した時に作った道路が、これ。

結線の情報は、source,target, source_osm, target_osmで入っているので、少なくともノード間の結線であれば、ここの加工だけで何とかなるんじゃないかな、と。

で、ここの部分のエントリーを見てみたら、こんな感じでした。(tomioka_db_c_trialの方で確認中)

gid、osm_id →新規の番号を適当に付ける
source, target, source_osm, target_osm は、これから結線するノード番号を記載する。(sourceが、江端が作成したNodeになっている)
と、まあ、ここまではいいとして、tag_idってなんだろう。あと、the_geomをどうしようかなぁ。

QGIS使ってtag_id = 112 だけを表示して調べてみたけど、私が手を入れたところに(も)出てきているようなので、何も分からないまま 112 を使うことにする。

さて、次に問題は、the_geomである。これは面倒くさい。多分デタラメな値を入れても大丈夫だとは思うが、念を入れておきたい。

tomioka_db_c=# select * from ways where gid = 506;
 gid | osm_id | tag_id |        length         |      length_m      | name | source | target | source_osm | target_osm |         cost          |     reverse_cost      |       cost_s       |   reverse_cost_s   | rule | one_way | oneway  |       x1        |      y1       |       x2        |       y2       | maxspeed_forward | maxspeed_backward | priority |                                          the_geom
-----+--------+--------+-----------------------+--------------------+------+--------+--------+------------+------------+-----------------------+-----------------------+--------------------+--------------------+------+---------+---------+-----------------+---------------+-----------------+----------------+------------------+-------------------+----------+--------------------------------------------------------------------------------------------
 506 | 105780 |    112 | 7.110994016919574e-06 | 0.7650124135935403 |      |    277 |    414 |     102352 |     102501 | 7.110994016919574e-06 | 7.110994016919574e-06 | 0.0550808937787349 | 0.0550808937787349 |      |       0 | UNKNOWN | 139.61725559089 | 35.3693678707 | 139.61725862094 | 35.36936143758 |               50 |                50 |      2.5 | 0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140
(1 row)
で、以下のように実行して、 the_geom の内容を調べてみると
tomioka_db_c=# select ST_Astext(the_geom) from ways where gid = 506;
                                st_astext
--------------------------------------------------------------------------
 LINESTRING(139.61725559089 35.3693678707,139.61725862094 35.36936143758)
(1 row)

と、2点の座標を結ぶ直線であることが分かった。

そこで、以下のプログラムを作成してみた。

/*
c:\users\ebata\tomika3b\src\others\main31.go
go run main31.go


*/
package main

import (
	"encoding/hex"
	"fmt"

	"github.com/twpayne/go-geom"
	"github.com/twpayne/go-geom/encoding/wkb"
)

func main() {

	// 2つの緯度経度ポイント
	//coordinates := [][]float64{{139.6917, 35.6895}, {-74.006, 40.7128}}
	coordinates := [][]float64{{139.61725559089, 35.3693678707}, {139.61725862094, 35.36936143758}}
	//coordinates := [][]float64{{139.61725862094, 35.36936143758}, {139.61725559089, 35.3693678707}}

	// Geometryの作成
	lineString := geom.NewLineStringFlat(geom.XY, []float64{coordinates[0][0], coordinates[0][1], coordinates[1][0], coordinates[1][1]})

	// WKB形式に変換
	wkbBytes, err := wkb.Marshal(lineString, wkb.NDR)
	if err != nil {
		fmt.Println("Error:", err)
		return
	}

	// WKB形式を16進数文字列に変換
	wkbHex := hex.EncodeToString(wkbBytes)

	// 出力
	fmt.Println(wkbHex)
}

さて、このプログラムからから、
0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140
を作れるかな?

coordinates := [][]float64{{139.61725559089, 35.3693678707}, {139.61725862094, 35.36936143758}}
としたら、
ベース: 0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140
作成: 01020| |0000002000000aa04cc8ec0736140c26c467247af414090c32695c0736140a2674f3c47af4140
一部欠けているが、一致している。

では、逆転させてみよう。
coordinates := [][]float64{{139.61725862094, 35.36936143758}, {139.61725559089, 35.3693678707}}
としたら、
ベース: 0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140
作成: 000000000200000002406173c08ecc04aa4041af4772466cc2406173c09526c3904041af473c4f67a2
こっちは、不一致が多いようです。

でも geomの長さが違うと思い、ChatGPTに尋ねてみたところ、以下のように言われました。

PostGISで生成されたWKB形式のデータは、ヘッダーを含んでいるため、より長いバイト列となります。一方、Go言語の標準ライブラリを使用して生成されたWKB形式のデータは、ヘッダーを省略しているため、より短いバイト列となります。

両方のWKB形式のデータが同じ構造と座標を持っている場合、データの内容は正しく解釈されます。しかし、データの長さには違いが生じることがあります。この違いは、WKB形式が異なる実装によって生成された場合に一般的です。

WKB形式のデータは、そのバイト列を解釈する際に、ヘッダーの情報を使用してジオメトリの種類と座標の次元を正しく読み取ります。そのため、データの長さの違いは問題ありません。

ということなので、長さについては無視することにしました。まあ、ダイクストラ計算をする分には問題ないでしょう

-----

では、本命。

この2点間を結線する、をやってみます。

    //source 305(×306) {139.62232489, 35.37185132}  target 1401  {139.62233160, 35.37184490} // これが今回のターゲット

    coordinates := [][]float64{{139.62232489, 35.37185132}, {139.62233160, 35.37184490}}

で計算したところ、

0102000000020000002d41e315ea736140ed2ff5d298af41408ea8f523ea7361409a571a9d98af4140
となったので、これはこのまま利用。

今回は、この2点間を繋ぐ、wayのオブジェクトを作れば良いだけなので、基本的にはwayのエントリーを一つ追加するだけで足りるはず。

#gid =506のエントリーがこんな感じなので、これをパクります。
tomioka_db_c=# select * from ways where gid = 506;
 gid | osm_id | tag_id |        length         |      length_m      | name | source | target | source_osm | target_osm |         cost          |     reverse_cost      |       cost_s       |   reverse_cost_s   | rule | one_way | oneway  |       x1        |      y1       |       x2        |       y2       | maxspeed_forward | maxspeed_backward | priority |                                          the_geom
-----+--------+--------+-----------------------+--------------------+------+--------+--------+------------+------------+-----------------------+-----------------------+--------------------+--------------------+------+---------+---------+-----------------+---------------+-----------------+----------------+------------------+-------------------+----------+--------------------------------------------------------------------------------------------
 506 | 105780 |    112 | 7.110994016919574e-06 | 0.7650124135935403 |      |    277 |    414 |     102352 |     102501 | 7.110994016919574e-06 | 7.110994016919574e-06 | 0.0550808937787349 | 0.0550808937787349 |      |       0 | UNKNOWN | 139.61725559089 | 35.3693678707 | 139.61725862094 | 35.36936143758 |               50 |                50 |      2.5 | 0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140

(1 row)

空き番号となっているgidは1984
空き番号となっているosm_idは、現在104088(と同じ桁であれば)、104090あたりが良さそう

x1,y1,x2,y2も比較してみたところ、
source 139.61725559  35.36936787
target 139.61725862 35.36936144
X1 139.61725559089 Y1 35.3693678707
X2 139.61725862094  Y2 35.36936143758となっていたので、とりあえずx1、x1をsource に、x2、y2をtargetにしてみたでは作ってみますか
(他のところは、現在のノード(506)をパクッても大きな問題にはならないだろう、と予測)
gid | osm_id | tag_id |        length         |      length_m      | name | source | target | source_osm | target_osm |         cost          |     reverse_cost      |       cost_s       |   reverse_cost_s   | rule | one_way | oneway  |       x1        |      y1       |       x2        |       y2       | maxspeed_forward | maxspeed_backward | priority |                                          the_geom
1984| 104090 |    112 | 7.110994016919574e-06 | 0.7650124135935403 |      |    305 |    1401 |    102381 |    4095221163 | 7.110994016919574e-06 | 7.110994016919574e-06 | 0.0550808937787349 | 0.0550808937787349 |      |       0 | UNKNOWN | 139.61725559089 | 35.3693678707 | 139.61725862094 | 35.36936143758 |               50 |                50 |      2.5 | 0102000020E610000002000000AA04CC8EC0736140C26C467247AF414090C32695C0736140A2674F3C47AF4140

INSERT INTO ways (gid, osm_id, tag_id, length, length_m, name, source, target, source_osm, target_osm, cost, reverse_cost, cost_s, reverse_cost_s, rule, one_way, oneway, x1, y1, x2, y2, maxspeed_forward, maxspeed_backward, priority, the_geom)
VALUES (1984, 104090, 112, 7.110994016919574e-06, 0.7650124135935403,NULL, 305 , 1401, 102381, 4095221163, 7.110994016919574e-06, 7.110994016919574e-06, 0.0550808937787349, 0.0550808937787349, NULL, 0, 'UNKNOWN', 139.62232489, 35.37185132, 139.62233160, 35.37184490, 50, 50, 2.5, '0102000000020000002d41e315ea736140ed2ff5d298af41408ea8f523ea7361409a571a9d98af4140');

結線されたようです。

では、ちゃんとダイクストラで繋がるのかを確認してみます。

tomioka_db_c_trial=# SELECT seq, source, target, x1, y1, x2, y2 FROM pgr_dijkstra('SELECT gid as id, source, target, cost, reverse_cost FROM ways',699, 304, directed := false) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;
 seq | source | target |       x1        |       y1       |       x2        |       y2
-----+--------+--------+-----------------+----------------+-----------------+----------------
   1 |    699 |   1401 |      139.622458 |     35.3721429 |     139.6223316 |     35.3718449
   2 |    305 |   1401 |    139.62232489 |    35.37185132 |     139.6223316 |     35.3718449
   3 |    304 |    305 | 139.62216476726 | 35.37185094304 | 139.62232488969 | 35.37185132369
(3 rows)
逆方向はどうかな?
tomioka_db_c_trial=# SELECT seq, source, target, x1, y1, x2, y2 FROM pgr_dijkstra('SELECT gid as id, source, target, cost, reverse_cost FROM ways',304, 699, directed := false) a INNER JOIN ways b ON (a.edge = b.gid) ORDER BY seq;
 seq | source | target |       x1        |       y1       |       x2        |       y2
-----+--------+--------+-----------------+----------------+-----------------+----------------
   1 |    304 |    305 | 139.62216476726 | 35.37185094304 | 139.62232488969 | 35.37185132369
   2 |    305 |   1401 |    139.62232489 |    35.37185132 |     139.6223316 |     35.3718449
   3 |    699 |   1401 |      139.622458 |     35.3721429 |     139.6223316 |     35.3718449
(3 rows)
繋っているを確認できました(ホッとしました)
# 正直、ダイクストラ計算の書式が気になるけど、結線に成功しているなら、まあいいや(もう疲れた)
tomioka_db_cにも、同じエントリをして、tomioka_db_c_trialを消去しました。