【Flourish】期間中に件数が増加した地域を可視化(Areas where the number of cases increased during the period)

では同様に、Flourishで表示していきます。

前回QJISでは、期間前半後半で犯罪件数が10倍超になった場所に絞りましたが、今回はプラスになった(2010-2014より2015-2019の犯罪件数が多かった)場所すべてを地図に置いていきます。1倍(同じ件数)も含んでるから増加とはいえないか。うーんでも全体件数半減だから言えないこともないか。いや屁理屈やん。

使用データは

【SQL】件数10倍超ブロックの緯度経度中央値

記事のメーンSQLから

WHERE ( count1519 / count1014 ) > 10

を省いて、全ての道路の比率を用います。あ、ゼロ除算チェックしてない。こういうとき、計算はもう単純にプラマイかゼロ排除か基準値置き換えか、ルーティン化せなんと思う。自分の考えが足りてない。

ツール:Flourish

【入力データ】

  • データソース:CSV
  • 文字コード:UTF-8

【Map】

[Base map] Vector, OSM Bright

[Viewport and Interaction] Centroid/Latitude:41.83,Longitude:-87.66,zoom:0

Custom:Width100,Height100, Min zoom:10,Max zoom:20

Limit viewpoint bounds, Repeat map horizontally:ON

VIEWPORT LIMITS: Min

[Graticules] Disabled

[Points] Appearance:Pulses, Scale type:Numeric, Sequential

Palette: Reds,Reverse:ON

Domain: Custom, MIN:-160,MAX:300

[BLENDING] Blending mode: Normal, Point opacity: 80

[POINT SIZE] Default size: 05, Min size: 0, Max size: 20

Scale with zoom: Min zoom 4, Max zoom 20

[ANIMATED POINTS] Date/time format data: Auto

増加率が大きいほど円が大きいです。同じ数(比率1)でもポイントするので、QJISのときより数が多いですね。全体数は半減しているけど、環境が変わらなければ比率1(2010年代の前半後半で数が変わらない)もたくさんある。わかりやすくするならQJISのように、極端に増えている個所を絞ったほうが、見るほうはわかりやすい。

では拡大。

赤いぶつぶつが湿疹みたいだな。もいっこ拡大

ちょっと路地だったり、大きい建物が多くて住宅少ないとこだったり、ですかね。間違いなく観光客は行かない地元の道路です。


備忘:

本当は、マイナスを含んだ増減で青→赤なヒートマップを作りたかった。が、基本コンセプトが「同じデータ、同じ表現、同じ意図」でポートフォリオに載せたい。

加えて、Flourishヒートマップ、マイナス表現の設定場所がわからなかった。下限がゼロ基準、そのため、最初は単純にマイナスをゼロに底上げしようとした。するとマウスオーバーしたときのラベルが底上げ数字になる。(別ラベルで指定すればよかろうけど)これでは誤解が生まれる。

あと、期間中の件数増減を表示するだけでは、全体が減っている状況なのでピンとこない。全体件数が半減している、それでも異様に増えてしまっているところがある。

件数でなく比率を用いたのは、箇所によって基準が違うから。もともと100件発生していた場所が200件になるのと、1件が2件になるのでは規模が違う。そのため、QJISの時点で比率を使っています。



********



Now we will display the same information in Flourish.

In the previous QJIS we focused on places where the number of crimes increased more than 10 times in the first half of the period, but this time we will put on the map all places where the number of crimes was positive (more crimes in 2015-2019 than in 2010-2014). Well, the total number of crimes is down by half, so I can call it an increase. No, that's a quibble.

The data used are

Median lat/long of blocks where the number of crimes more than 10-fold

From the article Maine SQL.

WHERE ( count1519 / count1014 ) > 10

Take out this sentence. Then use the ratios for all the streets.

Oh, I didn't check for zero division. In a case like this, I think the calculation should be, just add or subtract, eliminate zeros, replace the base value, or make it routine. I'm not thinking hard enough.

Tool:Flourish

Input data

Data source:CSV

Character code:UTF-8

Map Settings

[Base map] Vector, OSM Bright

[Viewport and Interaction] Centroid/Latitude:41.83,Longitude:-87.66,zoom:0

Custom:Width100,Height100, Min zoom:10,Max zoom:20

Limit viewpoint bounds, Repeat map horizontally:ON

VIEWPORT LIMITS: Min

[Graticules] Disabled

[Points] Appearance:Pulses, Scale type:Numeric, Sequential

Palette: Reds,Reverse:ON

Domain: Custom, MIN:-160,MAX:300

[BLENDING] Blending mode: Normal, Point opacity: 80

[POINT SIZE] Default size: 05, Min size: 0, Max size: 20

Scale with zoom: Min zoom 4, Max zoom 20

[ANIMATED POINTS] Date/time format data: Auto


The larger the percentage increase, the larger the circle. The ratio 1 is also included, so there are more point numbers than in QJIS.

The total number has halved, but there are many "ratio 1s" (where the number remains the same in the first half of the 2010s and the second half of the 2010s). For clarity, it would be easier for the audience to understand if we narrowed down the extremely increasing number of areas, as in QJIS.

Now let's zoom in.

Red bumps look like eczema. Expand a little more

It may be a bit of an alley, or a place with many large buildings and few residences. It is definitely a local road that tourists don't go to.


Reminder:

I really wanted to do a blue to red heatmap with the increase/decrease including the negative. But the basic concept was "same data, same expression, same intent" and I wanted to put it in my portfolio.

Also, I did not know where to set the Flourish heatmap and the expression below zero. The lower boundary is a zero standard, so at first I just tried to set the minus to zero. Then the label on mouse-over becomes a wrong number. (It would be better to create a different label.) This would lead to misunderstandings.

Also, just showing the increase or decrease in the number of cases during the period does not make sense because the total number of cases is decreasing. The total number of cases has decreased by half, but there are places where the number of cases has increased bizarrely.

The reason for using the ratio instead of the number of cases is that the scale is different depending on the location. The scale is different when the number of cases increases from 100 to 200, or when the number of cases increases from 1 to 2. For this reason, I used ratios at the time of QJIS.