2021/02,江端さんの技術メモ

/*
GAでTSP問題を解くときの超定番である、
「ルート表現から順序条件に変換するアルゴリズム」と
「順序表現からルート表現に変換するアルゴリズム (前記の逆変換)」を
Golangで試してみた件
*/

package main

import "fmt"

func main() {

	// ルート表現から順序条件に変換するアルゴリズム

	var sliceA = []int{7, 8, 0, 4, 1, 6, 3, 9, 5, 2} // ルート表現
	var sliceB = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	// 1111 var sliceC = [10]int{} // 順序条件が入るところ
	var sliceC = []int{} // 順序条件が入るところ

	// ルート表現から順列表現に変換
	for i := 0; i < len(sliceA); i++ {
		fmt.Printf("i: %v\n", i)
		for k := 0; k < len(sliceB); k++ {
			fmt.Printf("k: %v\n", k)
			if sliceA[i] == sliceB[k] {

				fmt.Printf("before Slice_A: %v\n", sliceA)
				fmt.Printf("before Slice_B: %v\n", sliceB)
				fmt.Printf("before Slice_C: %v\n", sliceC)

				// 1111 sliceC[i] = k
				sliceC = append(sliceC, k)
				sliceB = append(sliceB[:k], sliceB[k+1:]...) // k番目の要素を削除

				fmt.Printf("after Slice_A: %v\n", sliceA)
				fmt.Printf("after Slice_B: %v\n", sliceB)
				fmt.Printf("after Slice_C: %v\n", sliceC)
				fmt.Printf("\n")
			}
		}
	}

	fmt.Printf("=======\n")

	// 順序表現からルート表現に変換するアルゴリズム (上記の逆変換)

	sliceA = []int{} // 今からルート表現を入れるところ
	sliceB = []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
	// sliceCには、すでに順序表現が入っている

	for i := 0; i < len(sliceC); i++ {
		fmt.Printf("i: %v\n", i)
		k := sliceC[i]
		fmt.Printf("k: %v\n", k)
		j := sliceB[k]
		fmt.Printf("j: %v\n", j)

		fmt.Printf("before Slice_C: %v\n", sliceC)
		fmt.Printf("before Slice_B: %v\n", sliceB)
		fmt.Printf("before Slice_A: %v\n", sliceA)

		sliceA = append(sliceA, j)
		sliceB = append(sliceB[:k], sliceB[k+1:]...) // k番目の要素を削除

		fmt.Printf("after Slice_C: %v\n", sliceC)
		fmt.Printf("after Slice_B: %v\n", sliceB)
		fmt.Printf("after Slice_A: %v\n", sliceA)
	}
	fmt.Printf("\n")
}

2021/02,江端さんの忘備録

昨日、"高齢者は変われない"という話を書きました。

(Continuation from yesterday)

Yesterday, I wrote about the fact that the elderly cannot change.

私の中にある、もっとも古い記憶は ―― 小さいブラウン管の白黒テレビです。

The earliest memory I have is of a small cathode-ray tube black and white TV.

記憶にはないのですが、私の時代と重なっているはずのことでは ―― 冷蔵庫とは、近所までやってくる「氷屋」から氷の塊を購入して、それを庫内に入れる、というものでした。

I don't remember that, however, as far as my time is concerned, a refrigerator was one where they would buy a block of ice from an "ice man" who would come to your neighborhood and put it in the refrigerator.

洗濯機は二槽式で、脱水は手動ローラーで行うものでした。

The washing machine was a two-tank type, and dehydration was done with manual rollers.

-----

電子レンジは、最初は40万円くらいしたと思います。

I think the microwave oven initially cost about 400,000 yen.

ワープロは200万円くらいだったかな。

A word processor was about 2 million yen.

OSのないPC-9800は、フルセットで50万円くらいでした。

A PC-9800 without an OS was about 500,000 yen for a full set.

パソコンが使える奴は、(「おたく」と呼ばれる前は)「完璧な技術エリート」でした。

Anyone who could use a computer (before they were called "Otaku") was the "perfect technical elite".

しかし ―― 今や、スマホは国民全員が所有するものと『決めつけられました』。

However -- we have now been 'decided' that every citizen should own a smartphone.

自営業の人はPCで確定申告を行う人が強要され、国民は、行政サービスの書類の入手を、マイナンバーカードを使ってコンビニで行うように促されています。

Self-employed people are forced to use their PCs to file their tax returns, and citizens are encouraged to use their My Number cards to obtain documents for government services at convenience stores.

-----

何がいいたいかというと ―― デジタル化について行けない、私たち高齢者はそんなに『悪い』か?

What I'm trying to say is -- are we older people so 'bad' that we can't keep up with the digitalization?

ということです。

いえいえ、分っています。

No, no, no, I understand.

この私こそが、「デジタルを使えない高齢者を追い込んで、責めたてている当事者」であることは。

I know that I am the one who is blaming the elderly for not being able to use digital technology.

ただ、普通に考えて、

To be frank,

―― もし、あなたが、同じような時系列、立場で、技術の進化やイノベーションに追い立てられたとして、『普通に今のデジタル技術を使いこなすことができた』と断言できますか?

"If you were driven by technological evolution and innovation in a similar timeline and position, can you say with certainty that you could normally use today's digital technology?

と。

-----

まあ、私を含めた高齢者の皆様。

Well, all you elderly people, including me.

もちろん全てではないですが、国民の大部分は、戦禍に直接巻き込まれることなく、平和な国で生きることができした。

Not all of them, of course, but the majority of the people were able to go about their lives in a peaceful country without being directly involved in the ravages of war.

上手くいけば、戦禍に直接巻き込まれることなく、死んでいくこともできそうです。

Hopefully, we will not be directly involved in the ravages of war and will be able to die.

「デジタル」という災禍に巻き込まれましたが、まあ、受忍できる範囲だと諦めましょう。

We've been caught up in a "digital" disaster, but let's just say it's tolerable.

私たちが邪険にされ続けることで、私たちの世界はより良くなって行くのです ―― 多分。

The more we continue to be wicked, the better our world will become -- maybe.

2021/02,江端さんの忘備録

『年齢を重ねることは、それ自体が「権力」になる』という話を、このコラムでちょっと書いた気がします。

I think I've written a little bit in this column about how "ageing itself becomes a 'power'".

能力がなくても、実績がなくても、高齢者は権力になる ―― これは、「儒教の敬老思想」の負の側面です。

Even if they are not capable or have no achievements, the elderly come to get the power -- this is the negative side of the Confucian concept of respect for the elderly.

能力があって実績もある高齢者ともなれば、もう誰も逆らえません。

No one can resist an elderly person who is capable and has a good track record.

当然です。

It is natural.

-----

加えて、人間は、高齢になればなるほど、パラダイムを変えるのが辛くなります ―― もちろん、私も辛い。

In addition, the older we get, the harder it is to change the paradigm -- and of course, the harder it is for me.

前にも述べましたが、私は「夫婦別姓」を獲得するのに数年、「同性婚」を獲得するには10年以上かかりました。

As I mentioned before, it took me several years to get "marital separation" and more than ten years to get "gay marriage".

これらを理解する為の自己学習(自習)は、長く辛いものでした。

The self-learning (self-study) to understand these things was long and painful.

この辛さが分からない人は、自分や家族をリアルにイメージして、

If you don't know how hard this is, imagine yourself and your family in a realistic way.

―― 血縁婚(兄弟婚、姉弟婚、兄妹婚、姉妹婚、親子婚)

"Blood marriage (brother marriage, sister marriage, brother-sister marriage, sister marriage, parent-child marriage)"

を受け入れれるようになるのに、どれくらいの時間と勉強が必要になるか、を、頭の中でシミュレーションしてみて下さい。

Try to simulate them in your mind how much time and study you will be able to accept them.

(という事例でいいのかな? )

(Is that a good example? )

-----

ともあれ、

Anyway,

■高齢者には、能力と実績と権力があり、

- The elderly have power.

■高齢者のパラダイムシフトは、「リアルな血縁婚」を受けいれるくらいに難しい

- Paradigm shift for the elderly is as difficult as accepting "real blood marriage".

と思って頂くことはできないでしょうか?

Can't you think of it that way?

うん、できないですよね。

Yeah, you can't do that.

わかります。

I understand.

とすれば、

If we assume that,

■「"高齢者は変われない"を前提とする相互理解」という概念

- The concept of "mutual understanding based on the premise that the elderly cannot change their minds.

and

■「高齢者を組織のトップから、ナチュラルに排除」する技術

- Technology to naturally remove elderly people from the top of the organization.

が、今後の社会ソリューションになっていくと思います。

I believe that these will be the social solutions of the future.

2021/02,江端さんの忘備録

今、シミュレーション結果の入ったデータベース(PostgreSQL)から、必要な情報を読み出すのに、SQL文を使っています。

Now, I am using SQL statements to read out the necessary information from the database (PostgreSQL) containing the simulation results.

―― SQL、まじパねっす

"SQL is really cool"

と、感動してます。

I'm very impressed.

SQL文は、慣れてくれば、テーブル間連携も自由自在で、欲しいデータの列が簡単に作れます。魔法みたいです。

Once you get used to SQL statements, you can easily create the columns of data you want, with the freedom to link between tables. It's like magic.

今、QGIS(GISアプリケーション)と連携して使っているのですが、描画の作成で、とてもラクできています。

I am now using it in conjunction with QGIS (a GIS application), and it is very easy for me to create drawings.

-----

とは言え、SQLは非常に直感に反するインターフェースをしていますし、高度な使い方をするのであれば、かなり面倒くさいです。

However, SQL is a very counter-intuitive interface, and if you are going to use it in an advanced way, it can be quite cumbersome.

SQLと言えども、

Even though it is SQL,

―― ラクをする為には、凄く苦労しなければならない

"You'll have to work very hard to be easy"

というのは、プログラムの共通的な矛盾ではあります。

This is a common contradiction in programming.

-----

私だって、年がら年中、SQL(や、Golang)を使える環境にあれば、その場で、パッパと処理プログラムを書けるようになる、という自信があります。

I'm confident that if I had access to SQL (or Golang) all year round, I would be able to write processing programs on the spot.

(C/C++については、私は、この域に近いと信じています)。

(For C/C++, I believe I'm close to this realm)

年次報告書やら、特許明細書やら、予算管理のエクセル表の作成やら、発明相談会やら、幹部報告会資料や、社外発表審査書類や、顧客殿向けデモやら、学会発表やら ――

Annual reports, patent specifications, Excel spreadsheets for budget management, invention consultations, executive briefing materials, external presentation review documents, customer demonstrations, conference presentations, etc.

そういうことが、一切ない世界線で生きていけるのであれば、『SQL王に、俺はなる!』と宣言できます。

If I can live in a world where there is no such thing, I can declare, "I will become the SQL King!"

-----

自分でモノを作らないで、プログラムやらSQLやらを外注すれば、自分の技術力が低下していくのは当然です。

If I don't create things myself and outsource the programming and SQL, it is natural that my technical skills will decline.

しかし、モノ作りに拘っていれば、社会人を続けられないのも、また事実です。

However, it is also true that I cannot continue to be a member of society if I am obsessed with making things.

一方、人徳もコネもないシニアのエンジニアが、技術力までもなくしたら、一体、何が残るというのか、とも思います。

On the other hand, if senior engineers, who have neither humanity nor connections, lose their technical skills, what will be left?

難しいのは「リソース配分」―― つまり「バランス」です。

The difficult part is "resource allocation" - in other words, "balance"。

2021/02,江端さんの忘備録

東京オリンピックがどうなるのか ―― 開催国の国民として興味があります。

As a citizen of the host country, I am interested in where the Tokyo Olympics is going.

現在、世界的なウイルス感染という、未曾有の災害の真っ最中です。

We are currently in the midst of an unprecedented disaster: a global viral outbreak.

歴史的に見れば、国家の一つや二つ、地球上から消滅しても不思議ではなかった、と思えるほどの災厄です。

Historically speaking, it would not have been surprising if a nation or two had been wiped off the face of the earth.

-----

オリンピックは、国家的なイベントです。

The Olympics is a national event.

当然に、開催実施、延期、または中止を含む、いくつかのシナリオがあるに違いない ―― と、多くの人は考えていると思います。

Naturally, there must be several scenarios, including implementation, postponement, or cancellation -- and I think many people are thinking that.

しかし、私は、『2つ目のシナリオは準備されていない』に、一票を投じてみたいと思います。

However, I would like to cast my vote for 'the second scenario is not prepared.

-----

というのは、私が、プロジェクトリーダをやるときは、複数のシナリオなんて考えない、というか、考えられないからです。

This is because when I am a project leader, I don't think about multiple scenarios, or rather, I can't think about them.

複数のシナリオを準備するには、それなりの人材や時間、費用の投入が必要となりますが、基本的に、プロジェクトの現場では、そんな余裕ありません。

Preparing for multiple scenarios requires a considerable investment of human resources, time, and money, but basically, there is no room for that at the project site.

一番怖いのは、現場を理解していない、現場指揮官の投入です ―― だいたいプロジェクトの失敗は、この指揮官から始まります。

The scariest thing is to have a field commander who doesn't understand the field -- -- Most project failures start with this commander.

というのは、燃えている現場に、一流の現場指揮官が割り当てられることは、稀(まれ)だからです。

This is because it is rare that a first-rate field commander is assigned to a burning site.

-----

現場を把握できる指揮官は、どの部署でもエースです。エースはどの部署でも手放そうとはしません。

A commander who can grasp the field is an ace in any department. No department wants to let go of its ace.

そして、エースは、現場の燃え具合を即座に理解できます。そして、全力で逃げを打つはずです。

And that ace can instantly understand the burning condition of the scene. And he/she would refuse to participate at all costs.

その結果、燃えている現場には、「使えない」「手放しても構わない」「どーしようもない」指揮官が割り当てられて、プロジェクトは加速的に崩壊に向かいます。

As a result, a "useless," "unnecessary," and "helpless" commander is assigned to the burning site, and the project is headed for accelerated collapse.

まあ、オリンピックと、民間のプロジェクトを同列に論じるのは、ちょっと乱暴に過ぎるかもしれませんが。

Well, it may be a bit too violent to discuss the Olympics and private projects in the same sentence.

-----

もう一つは、「失敗」には、別段シナリオが必要ありません。

The other thing is that "failure" does not require a specific scenario.

シナリオがあれば、失敗をソフトランディングに導くということもできまます。

With a scenario, it is possible to lead a failure to a soft landing.

しかし、ソフトランディングしようが、ハードランディングしようが、結局のところ「失敗は失敗」です。

However, whether it is a soft landing or a hard landing, in the end, "failure is failure.

失敗のアプローチに目の行く人は少ないです。「失敗に美学を持っている人」は、絶無といっても良いでしょう。

There are few people who have an eye for the approach of failure. The number of people who have an aesthetic appreciation for failure is almost nonexistent.

-----

オリンピックがどうなるかは、私には分かりません。

I don't know where the Tokyo Olympics is going.

ただ、「現場」を押しつけられることが多かった人間の一人として、

But I ,who has been forced to be "in the field" a lot, think that

「批判も、非難も、援護も、賞賛も、助言も、一切せず、ただ"沈黙"し続けよう」

"No criticism, no condemnation, no support, no praise, no advice, just silence"

とは思っています。

2021/02,江端さんの忘備録

「数字で救う! 弱小国家」というマンガが面白いです。

The manga whose title is "Saving a Weak Nation by the Numbers!" This is a very interesting comic book.

# パパのkindleで読めるぞ > 娘たち

# You can read this on Dad's Kindle > my daughters

今調べたら、文庫版もあるようでした。購入を検討中です。

I found that there is also a paperback version. I'm considering buying it.

-----

私が、以前「AIシリーズ」で話してきた、

As I've explained in my previous in "AI Series", this books include

■ゲーム理論

- Game Theory

■オークション理論

- Auction Theory

の話が、物語の中で、大変分かりやすいユースケースになっていて、感動しています。

and, I am impressed by the very clear use cases in the story.

それと、私の知らなかった「ホルト・ウィンスタース法」による需要予測計算や「ランチェスターの法則」なども登場します。

Also, "Holt-Winsters method" and "Lanchester's Law", which I have not known about, come to appear in the book.

これらを、WikiPediaで調べながら、マンガを読んでいました。

I was reading the manga while looking these up on WikiPedia.

「ランチェスターの法則」の戦力比較方式など、『いつか、どこかのコラムで使ってやろう』と虎視眈々と考えております。

I've been vigilantly thinking about using the "Lanchester's Law" method of comparing forces in my columns.

この年齢になって、私はようやく「単利計算」と「複利計算」の違いを理解するに至りました。

At this age, I have finally come to understand the difference between "simple interest calculation" and "compound interest calculation".

(でも、これは以前お話した「消費者金融」や「アムウェイ」の話と似ています)

(These are similar to the "consumer finance" and "Amway" stories we talked about before.)

-----

この漫画(文庫)の一貫したポリシーは、「徹底した弱者戦略」です。

The consistent policy of this manga (library) is "thoroughgoing strategy for the weak".

私の立場に置き換えるのであれば、

If I were to put myself in my shoes. I could think,

―― 学閥、人脈、コネ一切なしの、シニアのサラリーマンエンジニアの「ぼっち戦略」

""A lonely strategy" of a senior salaried engineer without any academic cliques, connections, etc."

と考えることができます。

これも以前お話しましたが、

I told you this before, too.

―― 「弱い」は、突き詰めれば「強い」

""Weak" is "strong" when I master it."

に通じるものがあり、大変勉強になります。

I learned a lot from this story.

-----

という訳で、世界に冠たる「数学大嫌い国家、日本」の若者のみなさん。

So, to all the young people of Japan, the world's leading math-phobic nation.

「ぼっち」で、これからの人生を生き抜くには、数学は結構な武器になりそうですよ。

If you are a "loner" and want to survive in the future, math is going to be a great weapon.

2021/01,江端さんの技術メモ

ca_sim=# select user_id, position_before, position_after from request_log_view;
user_id | position_before | position_after
---------+----------------------------------------------------+----------------------------------------------------
307 | 0101000020E61000003ACC9717607961407CB779E3A4D44140 | 0101000020E61000003EAE0D1563796140B56D1805C1D34140
491 | 0101000020E61000009E5DBEF56179614063EFC517EDD34140 | 0101000020E6100000F7AE415F7A7961406684B70721D44140
57 | 0101000020E61000001A8A3BDE6479614020D1048A58D44140 | 0101000020E610000079909E2287796140FD8348861CD34140
320 | 0101000020E6100000266F80996F79614041F50F2219D44140 | 0101000020E6100000740CC85E6F796140F58079C894D34140
208 | 0101000020E6100000D07B630880796140E84B6F7F2ED44140 | 0101000020E6100000199293895B7961405F5E807D74D44140
60 | 0101000020E6100000751E15FF7779614023A298BC01D44140 | 0101000020E6100000EF75525F96796140EFCA2E185CD34140

見易く、st_astextを使うと、

ca_sim=# select user_id, st_astext(position_before), st_astext(position_after) from request_log_view;
user_id | st_astext | st_astext
---------+-----------------------------+-----------------------------
307 | POINT(139.79298 35.661282) | POINT(139.793345 35.654328)
491 | POINT(139.793208 35.655673) | POINT(139.796188 35.657258)
57 | POINT(139.793563 35.658952) | POINT(139.797746 35.649308)
320 | POINT(139.794873 35.657017) | POINT(139.794845 35.652978)
208 | POINT(139.796879 35.657669) | POINT(139.792424 35.659805)
60 | POINT(139.795898 35.656303) | POINT(139.799606 35.651248)

となる。さて、上記の点が、ある円に属するかどうかを、判定したいんだが ・・・ まだ見つかっていない。

# 絶対にあるはずだ ―― と信じて、今日は寝よう。


起きた。活動開始。

https://myonyomu.hatenablog.com/

PostGIS(地理情報システムを実現するための拡張モジュール)

に、

gisdb=# CREATE INDEX ON t1 USING gist (p1);
CREATE INDEX

gisdb=# SELECT id, ST_AsText(p1) FROM t1 WHERE
  p1 &&
  Box2D(ST_GeomFromText('LINESTRING(139.5 36.5, 139.6 36.6)', 4326));
 id
-----
  11
 323
 503
 663
 669
 683
 804
(7 rows)

を見つけた。

矩形(四角形)に関しては、これでなんとかなりそう。

では、試してみよう。

の、user_idを取り出せるか?

ca_sim=# select user_id, ST_AsText(position_before) from request_log_view WHERE position_before &&  Box2D(ST_GeomFromText('LINESTRING(139.791326 36.663475, 139.795424 35.661496)', 4326));
 user_id |          st_astext
---------+-----------------------------
     149 | POINT(139.792855 35.662321)
     112 | POINT(139.79406 35.662354)
     159 | POINT(139.793198 35.662567)
      12 | POINT(139.792911 35.662442)
     355 | POINT(139.792903 35.662375)
     131 | POINT(139.793011 35.662165)
     490 | POINT(139.793132 35.662414)
     350 | POINT(139.792722 35.662398)
     301 | POINT(139.792798 35.662261)
(9 rows)
ca_sim=#
おお、できた、できた!!
じゃあ今度は、出発地点を"赤"の枠で、到着地点が"青"の枠内のものを探してみよう。

では、

まず、赤の部分と青の部分を指定して・・・

ca_sim=# select user_id, ST_AsText(position_before),ST_AsText(position_after) from request_log_view WHERE (position_before && Box2D(ST_GeomFromText('LINESTRING(139.791326 36.663475, 139.795424 35.661496)', 4326))) && (position_after && Box2D(ST_GeomFromText('LINESTRING(139.780310 35.643812,139.783851 35.641214)', 4326)));
ERROR: operator does not exist: boolean && boolean
LINE 1: ...791326 36.663475, 139.795424 35.661496)', 4326))) && (positi...
^
HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

え、なんで、こうなるの? これで普通いけるよね ..... (ググりながら2~3時間経過)

まさか、&& AND が違うなんてことないよね ―― と思って、試しにやってみたら、

ca_sim=# select user_id, ST_AsText(position_before),ST_AsText(position_after) from request_log_view WHERE (position_before && Box2D(ST_GeomFromText('LINESTRING(139.791326 36.663475, 139.795424 35.661496)', 4326))) AND (position_after && Box2D(ST_GeomFromText('LINESTRING(139.780310 35.643812,139.783851 35.641214)', 4326)));
user_id | st_astext | st_astext
---------+-----------------------------+-----------------------------
149 | POINT(139.792855 35.662321) | POINT(139.782598 35.642426)
(1 row)

―― 通った。

まだ、円形ではないけど、とりあえず当初の目的(に近いとろまで)に達成。

ーーーーー

では、この#149さんの動きを見てみよう。

ca_sim=# select * from user_position_view where id = 149;
date_index | tm | id | x | y | position
------------+---------------------+-----+-----------+-----------+----------------------------------------------------
1 | 2021-01-01 07:57:45 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:58:00 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:58:15 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:58:30 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:58:45 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:59:00 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:59:15 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:59:30 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 07:59:45 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:00:00 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:00:15 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:00:30 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:00:45 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:01:00 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:01:15 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:01:30 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:01:45 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:02:00 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:02:15 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:02:30 | 149 | 139.79286 | 35.66232 | 0101000020E61000000BEF72115F7961401D3A3DEFC6D44140
1 | 2021-01-01 08:02:45 | 149 | 139.79298 | 35.66228 | 0101000020E61000000A48FB1F607961408FE1B19FC5D44140
1 | 2021-01-01 08:03:00 | 149 | 139.7931 | 35.66223 | 0101000020E61000008D0C721761796140AE2EA704C4D44140
1 | 2021-01-01 08:03:15 | 149 | 139.79318 | 35.662155 | 0101000020E6100000BC7669C36179614032755776C1D44140
1 | 2021-01-01 08:03:30 | 149 | 139.79326 | 35.66208 | 0101000020E6100000EBE0606F6279614086376BF0BED44140
1 | 2021-01-01 08:03:45 | 149 | 139.7932 | 35.661995 | 0101000020E6100000514D49D661796140F9122A38BCD44140
1 | 2021-01-01 08:04:00 | 149 | 139.7931 | 35.66191 | 0101000020E6100000A54E4013617961409B728577B9D44140
1 | 2021-01-01 08:04:15 | 149 | 139.79301 | 35.661827 | 0101000020E6100000EC2E5052607961400E4E44BFB6D44140
1 | 2021-01-01 08:04:30 | 149 | 139.79291 | 35.66179 | 0101000020E6100000E7FEEA715F79614020ED7F80B5D44140
1 | 2021-01-01 08:04:45 | 149 | 139.79279 | 35.661766 | 0101000020E610000005323B8B5E79614098512CB7B4D44140
1 | 2021-01-01 08:05:00 | 149 | 139.79268 | 35.661743 | 0101000020E61000002F8672A25D796140DF313CF6B3D44140
1 | 2021-01-01 08:05:15 | 149 | 139.79257 | 35.661716 | 0101000020E61000004EB9C2BB5C7961405796E82CB3D44140
1 | 2021-01-01 08:05:30 | 149 | 139.79247 | 35.661694 | 0101000020E6100000780DFAD25B7961409F76F86BB2D44140
1 | 2021-01-01 08:05:45 | 149 | 139.79234 | 35.66167 | 0101000020E610000096404AEC5A796140E75608ABB1D44140
1 | 2021-01-01 08:08:15 | 149 | 139.79189 | 35.660706 | 0101000020E610000009C3802557796140809E060C92D44140
1 | 2021-01-01 08:08:30 | 149 | 139.79202 | 35.659588 | 0101000020E6100000CD76853E58796140217365506DD44140
1 | 2021-01-01 08:08:45 | 149 | 139.79245 | 35.65855 | 0101000020E6100000B3B27DC85B796140F163CC5D4BD44140
1 | 2021-01-01 08:09:00 | 149 | 139.79272 | 35.657696 | 0101000020E6100000DC114E0B5E79614011DF89592FD44140
1 | 2021-01-01 08:09:15 | 149 | 139.79266 | 35.656853 | 0101000020E6100000417E36725D796140C6A354C213D44140
1 | 2021-01-01 08:09:30 | 149 | 139.79323 | 35.655987 | 0101000020E61000006902452C62796140C3482F6AF7D34140
1 | 2021-01-01 08:09:45 | 149 | 139.7939 | 35.65513 | 0101000020E610000060E811A36779614001DD9733DBD34140
1 | 2021-01-01 08:10:00 | 149 | 139.79408 | 35.65424 | 0101000020E6100000F48AA71E6979614075E61E12BED34140
1 | 2021-01-01 08:10:15 | 149 | 139.79427 | 35.65335 | 0101000020E6100000882D3D9A6A796140E9EFA5F0A0D34140
1 | 2021-01-01 08:10:30 | 149 | 139.79384 | 35.652473 | 0101000020E61000005A2BDA1C6779614022C7D63384D34140
1 | 2021-01-01 08:10:45 | 149 | 139.79301 | 35.651573 | 0101000020E61000008D261763607961404276DEC666D34140
1 | 2021-01-01 08:11:00 | 149 | 139.79219 | 35.650677 | 0101000020E6100000B4006DAB5979614093A9825149D34140
1 | 2021-01-01 08:11:15 | 149 | 139.79135 | 35.64979 | 0101000020E610000011363CBD52796140191EFB592CD34140
1 | 2021-01-01 08:11:30 | 149 | 139.7904 | 35.649372 | 0101000020E6100000DAAED0074B796140B56FEEAF1ED34140
1 | 2021-01-01 08:12:00 | 149 | 139.78836 | 35.648926 | 0101000020E61000003C50A73C3A796140454772F90FD34140
1 | 2021-01-01 08:12:15 | 149 | 139.78905 | 35.648067 | 0101000020E6100000E5982CEE3F796140F44E05DCF3D24140
1 | 2021-01-01 08:12:30 | 149 | 139.788 | 35.647343 | 0101000020E610000007EA944737796140E3A9471ADCD24140
1 | 2021-01-01 08:12:45 | 149 | 139.78703 | 35.64754 | 0101000020E6100000D63906642F796140096D3997E2D24140
1 | 2021-01-01 08:13:15 | 149 | 139.7873 | 35.646866 | 0101000020E6100000BDA9488531796140A9F6E978CCD24140
1 | 2021-01-01 08:13:30 | 149 | 139.78622 | 35.64615 | 0101000020E61000005645B8C928796140BB270F0BB5D24140
1 | 2021-01-01 08:13:45 | 149 | 139.78516 | 35.645443 | 0101000020E61000004FE960FD1F79614080BBECD79DD24140
1 | 2021-01-01 08:14:00 | 149 | 139.7842 | 35.645493 | 0101000020E6100000B20FB22C1879614031EA5A7B9FD24140
1 | 2021-01-01 08:14:15 | 149 | 139.78342 | 35.64642 | 0101000020E610000050A73CBA11796140DAC534D3BDD24140
1 | 2021-01-01 08:14:30 | 149 | 139.78328 | 35.64658 | 0101000020E6100000C898BB9610796140849B8C2AC3D24140
1 | 2021-01-01 08:14:45 | 149 | 139.78336 | 35.64649 | 0101000020E610000027874F3A11796140A41CCC26C0D24140
1 | 2021-01-01 08:15:00 | 149 | 139.78343 | 35.646397 | 0101000020E61000007A54FCDF11796140F321A81ABDD24140
1 | 2021-01-01 08:15:15 | 149 | 139.78351 | 35.646305 | 0101000020E6100000CD21A9851279614012A3E716BAD24140
1 | 2021-01-01 08:15:30 | 149 | 139.78358 | 35.64621 | 0101000020E610000020EF552B1379614061A8C30AB7D24140
1 | 2021-01-01 08:15:45 | 149 | 139.78366 | 35.64612 | 0101000020E61000007FDDE9CE1379614080290307B4D24140
1 | 2021-01-01 08:16:00 | 149 | 139.78375 | 35.646027 | 0101000020E6100000D2AA967414796140CF2EDFFAB0D24140
1 | 2021-01-01 08:16:15 | 149 | 139.78383 | 35.64593 | 0101000020E61000002578431A157961401E34BBEEADD24140
1 | 2021-01-01 08:16:30 | 149 | 139.7839 | 35.64584 | 0101000020E61000008466D7BD157961403DB5FAEAAAD24140
1 | 2021-01-01 08:16:45 | 149 | 139.78398 | 35.64575 | 0101000020E6100000D7338463167961408CBAD6DEA7D24140
1 | 2021-01-01 08:17:00 | 149 | 139.78406 | 35.645657 | 0101000020E61000002A01310917796140AC3B16DBA4D24140
1 | 2021-01-01 08:17:15 | 149 | 139.78413 | 35.64556 | 0101000020E610000089EFC4AC17796140FB40F2CEA1D24140
1 | 2021-01-01 08:17:30 | 149 | 139.78423 | 35.64547 | 0101000020E6100000DCBC7152187961401AC231CB9ED24140
1 | 2021-01-01 08:17:45 | 149 | 139.7843 | 35.64538 | 0101000020E61000002F8A1EF81879614069C70DBF9BD24140
1 | 2021-01-01 08:18:00 | 149 | 139.78438 | 35.645287 | 0101000020E61000008257CB9D1979614088484DBB98D24140
1 | 2021-01-01 08:18:15 | 149 | 139.78445 | 35.64519 | 0101000020E6100000E1455F411A796140D74D29AF95D24140
1 | 2021-01-01 08:18:30 | 149 | 139.78453 | 35.6451 | 0101000020E610000034130CE71A796140F6CE68AB92D24140
1 | 2021-01-01 08:18:45 | 149 | 139.78462 | 35.64501 | 0101000020E610000033F9669B1B796140573F36C98FD24140
1 | 2021-01-01 08:19:00 | 149 | 139.78471 | 35.644928 | 0101000020E6100000035B25581C79614059A7CAF78CD24140
1 | 2021-01-01 08:19:15 | 149 | 139.78479 | 35.644833 | 0101000020E61000006249B9FB1C796140A8ACA6EB89D24140
1 | 2021-01-01 08:19:30 | 149 | 139.78487 | 35.64474 | 0101000020E6100000C1374D9F1D796140F7B182DF86D24140
1 | 2021-01-01 08:19:45 | 149 | 139.78494 | 35.64465 | 0101000020E61000002026E1421E79614045B75ED383D24140
1 | 2021-01-01 08:20:00 | 149 | 139.78502 | 35.644554 | 0101000020E61000007F1475E61E79614094BC3AC780D24140
1 | 2021-01-01 08:20:15 | 149 | 139.7851 | 35.644463 | 0101000020E6100000EA23F0871F796140E3C116BB7DD24140
1 | 2021-01-01 08:20:30 | 149 | 139.78517 | 35.644367 | 0101000020E61000004912842B2079614032C7F2AE7AD24140
1 | 2021-01-01 08:20:45 | 149 | 139.78525 | 35.644276 | 0101000020E6100000A80018CF2079614081CCCEA277D24140
1 | 2021-01-01 08:21:00 | 149 | 139.78534 | 35.644184 | 0101000020E610000007EFAB7221796140D0D1AA9674D24140
1 | 2021-01-01 08:21:15 | 149 | 139.78542 | 35.64409 | 0101000020E610000066DD3F16227961401FD7868A71D24140
1 | 2021-01-01 08:21:30 | 149 | 139.78549 | 35.643997 | 0101000020E6100000C5CBD3B9227961406EDC627E6ED24140
1 | 2021-01-01 08:21:45 | 149 | 139.78557 | 35.643906 | 0101000020E610000023BA675D23796140BDE13E726BD24140
1 | 2021-01-01 08:22:00 | 149 | 139.78564 | 35.64381 | 0101000020E61000009AEAC9FC23796140DC627E6E68D24140
1 | 2021-01-01 08:22:15 | 149 | 139.78552 | 35.64375 | 0101000020E610000000E484092379614037E2C96E66D24140
1 | 2021-01-01 08:22:30 | 149 | 139.78542 | 35.643684 | 0101000020E61000003659A31E227961405072874D64D24140
1 | 2021-01-01 08:22:45 | 149 | 139.78531 | 35.64362 | 0101000020E61000006CCEC133217961409886E12362D24140
1 | 2021-01-01 08:23:00 | 149 | 139.78519 | 35.643555 | 0101000020E6100000A243E04820796140B1169F0260D24140
1 | 2021-01-01 08:23:15 | 149 | 139.78508 | 35.64349 | 0101000020E6100000D8B8FE5D1F796140CAA65CE15DD24140
1 | 2021-01-01 08:23:30 | 149 | 139.78497 | 35.643425 | 0101000020E61000000E2E1D731E796140E3361AC05BD24140
1 | 2021-01-01 08:23:45 | 149 | 139.78485 | 35.64336 | 0101000020E610000044A33B881D7961402B4B749659D24140
1 | 2021-01-01 08:24:00 | 149 | 139.78474 | 35.643295 | 0101000020E61000007A185A9D1C79614044DB317557D24140
1 | 2021-01-01 08:24:15 | 149 | 139.78464 | 35.64323 | 0101000020E6100000B08D78B21B7961405D6BEF5355D24140
1 | 2021-01-01 08:24:30 | 149 | 139.78453 | 35.643158 | 0101000020E61000009F3C2CD41A796140C498F4F752D24140
1 | 2021-01-01 08:24:45 | 149 | 139.78442 | 35.64308 | 0101000020E61000005E6743FE19796140E9D66B7A50D24140
1 | 2021-01-01 08:25:00 | 149 | 139.78432 | 35.643013 | 0101000020E61000007079AC1919796140616F62484ED24140
1 | 2021-01-01 08:25:15 | 149 | 139.78418 | 35.64297 | 0101000020E610000059DE550F1879614062A3ACDF4CD24140
1 | 2021-01-01 08:25:30 | 149 | 139.78406 | 35.642925 | 0101000020E61000004E64E60217796140925B936E4BD24140
1 | 2021-01-01 08:25:45 | 149 | 139.78394 | 35.642883 | 0101000020E610000036C98FF815796140C2137AFD49D24140
1 | 2021-01-01 08:26:00 | 149 | 139.7838 | 35.64284 | 0101000020E61000001F2E39EE14796140C347C49448D24140
1 | 2021-01-01 08:26:15 | 149 | 139.78368 | 35.642796 | 0101000020E61000000893E2E313796140F3FFAA2347D24140
1 | 2021-01-01 08:26:30 | 149 | 139.78355 | 35.642754 | 0101000020E6100000FC1873D712796140F433F5BA45D24140
1 | 2021-01-01 08:26:45 | 149 | 139.78342 | 35.642708 | 0101000020E6100000E57D1CCD1179614025ECDB4944D24140
1 | 2021-01-01 08:27:00 | 149 | 139.7833 | 35.642666 | 0101000020E6100000CEE2C5C21079614055A4C2D842D24140
1 | 2021-01-01 08:27:15 | 149 | 139.78317 | 35.642624 | 0101000020E6100000B6476FB80F79614056D80C7041D24140
1 | 2021-01-01 08:27:30 | 149 | 139.78304 | 35.64258 | 0101000020E6100000ABCDFFAB0E7961408690F3FE3FD24140
1 | 2021-01-01 08:27:45 | 149 | 139.78291 | 35.642532 | 0101000020E61000009432A9A10D796140B648DA8D3ED24140
1 | 2021-01-01 08:28:00 | 149 | 139.78279 | 35.64249 | 0101000020E61000007D9752970C796140B77C24253DD24140
1 | 2021-01-01 08:28:15 | 149 | 139.78265 | 35.64245 | 0101000020E610000065FCFB8C0B796140E7340BB43BD24140
(112 rows)

ふむ、移動時間は、約30分というところか。

ゆりかもめを使うとこんな感じ

バスだと、こんな感じ

#149の人をトラッキングしてみました。

QGIS3 →  postGISから「新しいpostGIS接続を作成する」

(その前に、docker psで、DBのポート番号を抑えておくこと 0ba7ddf90bf2 pamtrak06/postgis-pgrouting-osm:latest "docker-entrypoint.s…" 4 hours ago Up 4 hours 0.0.0.0:8911->5432/tcp toyosu_postgres_1)

で、接続に成功したら、メニューの「データベース」から「DBマネージャ」を選択して、以下の順番に入力をしていく。

すると、こんな感じのものが出てくる。

waysを合わせてみるとこんな感じ

さらに、ways_vertices_pgrを重ねると、こんな感じ

#149さんの連続ルートはこれで見える。

select moving_route_log from request_log_view where user_id = 149;

■スマホを見て、走っているのバスに”飛び乗っている”(サービス稼動中の乗車の例)
①待ち時間が0の乗客を抽出する。(到着時刻-出発時刻-所要時間≒0)
到着時刻 request_log_view.time_after
出発時刻 request_log_view.time_before
所要時間 request_log_view.distance_on_foot [meter] と、 request_log_view.distance_by_bus [meter]、バスの速さ 30 km/h、人の速さ 3 km/h から計算する。
②ユーザのidから、移動履歴を取得する。

まず軽く実験 (time_after - time_before < '10 mins'を取り出す)

ca_sim=# select time_after, time_before from request_log_view where time_after - time_before < '10 mins';
time_after | time_before
------------+-------------
10:37:15 | 10:28:00
11:49:30 | 11:41:15
20:36:30 | 20:26:45
22:19:15 | 22:09:45
00:00:00 | 23:48:45
00:00:00 | 23:47:30
00:00:00 | 11:25:45
00:00:00 | 23:48:00
00:00:00 | 23:24:15
00:00:00 | 23:59:15
00:00:00 | 23:39:15
00:00:00 | 23:10:30

時刻と時間を表示させてみる 後半の2つは秒数になっている

ca_sim=# select time_after, time_before, distance_on_foot/0.8333, distance_by_bus/8.333 from request_log_view ;
time_after | time_before | ?column? | ?column?
------------+-------------+--------------------+--------------------
03:37:45 | 03:26:15 | 511.5950243478489 | 84.87666166802921
03:43:30 | 03:22:00 | 494.1959763351471 | 252.84164686899976
03:46:45 | 03:32:00 | 593.0148094595659 | 0
03:52:15 | 03:42:00 | 614.8145339876095 | 0
03:58:45 | 00:27:15 | 1931.1687506562762 | 402.76739975849034

さて、HH:MM:SSを"秒"の表記にする方法は、こうするらしい

ca_sim=# select time_after, time_before, time_after - time_before, (extract(epoch from (time_after - time_before)::time))::numeric from request_log_view;
time_after | time_before | ?column? | date_part
------------+-------------+-----------+-----------
00:28:00 | 00:16:15 | 00:11:45 | 705
00:32:00 | 00:12:15 | 00:19:45 | 1185
00:40:15 | 00:18:45 | 00:21:30 | 1290
00:41:45 | 00:11:45 | 00:30:00 | 1800
00:43:30 | 00:20:45 | 00:22:45 | 1365

では、本命 (到着時間 ー 出発時間 ー 歩行時間 ー 乗車時間 < 60(秒)以内)の乗客をピックアップしろ。

ca_sim=# select user_id,time_after, time_before, time_after - time_before, distance_on_foot, distance_by_bus from request_log_view where extract(epoch from (time_after - time_before)::time)::numeric - distance_on_foot/0.8333 - distance_by_bus/8.333 < 60;
user_id | time_after | time_before | ?column? | distance_on_foot | distance_by_bus
---------+------------+-------------+-----------+------------------+-----------------
234 | 00:28:00 | 00:16:15 | 00:11:45 | 563.23376 | 0
275 | 01:23:30 | 01:12:00 | 00:11:30 | 536.52704 | 0
324 | 03:23:15 | 03:07:45 | 00:15:30 | 731.304 | 0
118 | 03:52:15 | 03:42:00 | 00:10:15 | 512.32495 | 0
57 | 04:16:00 | 03:48:00 | 00:28:00 | 1388.9436 | 0
157 | 07:59:45 | 07:47:15 | 00:12:30 | 618.9883 | 0
458 | 07:59:45 | 07:41:45 | 00:18:00 | 898.75244 | 0
397 | 08:37:00 | 08:09:15 | 00:27:45 | 1363.375 | 0
410 | 08:52:00 | 08:27:30 | 00:24:30 | 1221.9526 | 0
395 | 09:52:15 | 09:41:45 | 00:10:30 | 516.0718 | 0
92 | 09:57:00 | 09:36:30 | 00:20:30 | 1023.69165 | 0
310 | 10:02:15 | 09:50:15 | 00:12:00 | 564.49817 | 0
90 | 10:02:45 | 09:50:45 | 00:12:00 | 596.32117 | 0
155 | 10:28:00 | 10:14:15 | 00:13:45 | 671.9812 | 0
178 | 11:49:30 | 11:41:15 | 00:08:15 | 372.38193 | 0
315 | 12:09:15 | 11:56:15 | 00:13:00 | 643.7695 | 0
481 | 12:11:00 | 11:55:45 | 00:15:15 | 685.71277 | 348.4668
399 | 12:11:45 | 11:49:00 | 00:22:45 | 1123.1423 | 0
127 | 15:00:15 | 14:41:30 | 00:18:45 | 913.04913 | 0
404 | 12:13:30 | 11:41:15 | 00:32:15 | 1562.6414 | 0
198 | 12:15:30 | 11:55:30 | 00:20:00 | 959.8891 | 0
32 | 12:48:15 | 12:27:30 | 00:20:45 | 1014.6684 | 0
116 | 13:06:15 | 12:48:00 | 00:18:15 | 911.0616 | 0
130 | 13:25:00 | 13:05:30 | 00:19:30 | 971.8267 | 0
411 | 15:42:00 | 15:26:00 | 00:16:00 | 788.83246 | 0
229 | 14:07:15 | 13:50:30 | 00:16:45 | 835.96875 | 0
61 | 14:15:45 | 14:01:15 | 00:14:30 | 684.7999 | 0
79 | 14:32:15 | 14:21:45 | 00:10:30 | 494.44864 | 0
317 | 22:20:00 | 22:05:00 | 00:15:00 | 730.14026 | 0
133 | 17:00:30 | 16:31:15 | 00:29:15 | 1454.8848 | 0
97 | 17:18:00 | 17:03:30 | 00:14:30 | 682.81305 | 0
193 | 18:29:30 | 18:05:30 | 00:24:00 | 1199.9945 | 0
80 | 18:55:00 | 18:44:15 | 00:10:45 | 497.08746 | 0
271 | 19:48:45 | 19:36:00 | 00:12:45 | 622.33954 | 0
298 | 19:50:15 | 19:36:00 | 00:14:15 | 694.23785 | 0
13 | 19:55:30 | 19:36:00 | 00:19:30 | 961.26294 | 0
496 | 22:19:15 | 22:09:45 | 00:09:30 | 447.28525 | 0
305 | 21:10:30 | 20:44:45 | 00:25:45 | 1262.3821 | 0
283 | 21:14:00 | 21:00:00 | 00:14:00 | 652.0706 | 0
67 | 21:29:00 | 21:05:45 | 00:23:15 | 1158.776 | 0
124 | 22:43:15 | 22:17:00 | 00:26:15 | 1281.6383 | 0
309 | 23:05:00 | 22:46:15 | 00:18:45 | 921.8486 | 0
338 | 00:00:00 | 23:59:15 | -23:59:15 | 0 | 0
(43 rows)

よし。ラストだ

■歩いて5分のコンビニからの帰宅にも使われている(近距離利用の例)
①出発座標と到着座標の距離が近い、かつ、バスに乗っている ユーザIDを取得する。
出発、到着: request_log_view.position_before、request_log_view.position_after
バスに乗っている: request_log_view.distance_by_bus > 0
②ユーザのidから、移動履歴を取得する。

5分以内は1人もいなかったけど、10分以内に1人だけいた

ca_sim=# select user_id,time_after, time_before, time_after - time_before, distance_on_foot, distance_by_bus from request_log_view where (extract(epoch from (time_after - time_before)::time)::numeric < 600) AND distance_
by_bus/8.333 > 0;
user_id | time_after | time_before | ?column? | distance_on_foot | distance_by_bus
---------+------------+-------------+----------+------------------+-----------------
14 | 10:37:15 | 10:28:00 | 00:09:15 | 92.753555 | 982.5703
(1 row)

 

結局、知り合いの方から教えて貰ったの方法で実現できたみたい (35.65457592, 139.79652749 を中心に300メートル)

ca_sim=# select user_id, ST_AsText(position_before) from request_log_view where st_dwithin(position_before, st_geomfromtext('POINT(139.79652749 35.65457592)', 4326), 0.03233394 / 3600 * 300);
user_id | st_astext
---------+-----------------------------
368 | POINT(139.797258 35.65431)
298 | POINT(139.795197 35.656211)
396 | POINT(139.795056 35.656002)
212 | POINT(139.794265 35.655042)

では、これでファイナル。

ca_sim=# select user_id, ST_AsText(position_before), ST_AsText(position_after) from request_log_view where st_dwithin(position_before, st_geomfromtext('POINT(1
39.79652749 35.65457592)', 4326), 0.03233394 / 3600 * 300) AND st_dwithin(position_after, st_geomfromtext('POINT(139.78482207 35.64501561)', 4326), 0.03233394 / 3600 * 300);
user_id | st_astext | st_astext
---------+-----------------------------+-----------------------------
388 | POINT(139.796825 35.653691) | POINT(139.783568 35.645798)
159 | POINT(139.794932 35.65632) | POINT(139.783022 35.645729)
316 | POINT(139.796816 35.656201) | POINT(139.787289 35.644699)
454 | POINT(139.795517 35.655392) | POINT(139.784164 35.646674)
428 | POINT(139.795264 35.655453) | POINT(139.785816 35.64436)
318 | POINT(139.79846 35.653964) | POINT(139.782998 35.643485)
349 | POINT(139.798028 35.654032) | POINT(139.785334 35.643373)
115 | POINT(139.795711 35.6562) | POINT(139.786663 35.645087)
72 | POINT(139.797807 35.656475) | POINT(139.785665 35.643757)
(9 rows)

忘れない内に、メモを色々残しておこう。

ca_sim=# SELECT home FROM user_param where st_dwithin("home", st_geomfromtext('POINT(139.79652749 35.65457592)', 4326), 0.03233394 / 3600 * 300);
home
----------------------------------------------------
0101000020E6100000B058C3456E796140FB1F60ADDAD34140
0101000020E610000040A6B5696C796140E19524CFF5D34140
0101000020E610000021904B1C79796140A2258FA7E5D34140
0101000020E610000081CCCEA277796140390B7BDAE1D34140

 

以上

 

 

2021/02,江端さんの忘備録

先日ご紹介した私の著書を読んで頂いている方から、引続き「尊厳死宣言」に関わる事項をさらにご教示頂いております。

The reader of my book, which I introduced the other day, has continued to provide me with further information on matters related to the "Death with Dignity Declaration.

(私の為に)箇条書きにて、概要を記載します。

Here is an overview in bullet points (for me).

■弁護士さんが引き出しできる口座を準備する(入院、葬式用)

- Prepare an account that the lawyer can withdraw from (for hospitalization and funeral).

■上記に関しては、弁護士さんと個別の契約をすることができる

- For the above, you can make an individual contract with a lawyer.

■決済用口座(利子がつかない)を作って、当面のお金を入れておくと良い

- Make a settlement account (interest free) and put money for the time being in it.

■成人後見人制度は、結構面倒くさい

- The requirements for adult guardianship are quite strict.

私も、父が単独で新聞契約をしてしまった時に、私(江端)は、この制度の利用を検討したことがあります。

I (Ebata) have also considered using this system when my father signed up for newspapers on his own.

しかし、その時、介護業務の方から、「姉と私の対応が妥当で迅速」であるという理由で、申請が却下される公算が高いと言われました。

However, at that time, I was told by the care services that my application was highly likely to be rejected because of the "reasonable and prompt" response of my sister and me(Really).

-----

以下は、検討しておくべきチェックリストです

Here is a checklist of things to consider

■Gmail, LINE, facebook 等の ITのアカウント、パスワード、および解約方法

- IT accounts, passwords, and cancellation methods for Gmail, LINE, facebook, etc.

■オンライン口座、FX口座、ビットコイン等の暗号通貨(私もあと600円分ある)の取引所の撤収方法、FX口座

- How to get rid of online accounts, forex accounts, and exchanges for bitcoin and other cryptocurrencies (I have another $600 worth).

■Amazon,楽天等のECポータルの解約方法

- How to cancel an e-commerce portal such as Amazon, Rakuten, etc.

■クラウドサーバ(AWS等)の抹消、解約

- Cancellation or termination of cloud servers (AWS, etc.)

■破壊すべきHDD, USBメモリのITガジェット

- HDD to be Destroyed, USB Memory IT Gadgets

■(本来、存在していないはずの)機密書類や機器の返却または抹消

- Return or erase confidential documents and equipment (that should not exist).

------

以前、IDとパスワードを知らせずに夫が死亡して、妻がスマホ、PC、あらゆる電子デバイスが使えなくなって、孤立してしまったという、知人の話を記載しましたが ――

I once described the story of an acquaintance whose husband died without informing her of his ID and password, leaving his wife isolated with no access to her phone, PC, or any electronic devices.

江端家の場合でも、間違いなく、このような状況が発生すると思います。

I have no doubt that this situation will arise in the case of the Ebata family.

この機会に、いろいろ準備しておこう、と思います。

I think I'll take this opportunity to prepare a lot of things.