Heatmap adalah salah satu alat visualisasi terbaik untuk data poin yang padat. Heatmaps digunakan untuk memudahakan dalam pengidentifikasian cluster dimana ada konsentrasi tinggi suatu aktifitas. Heatmap juga berguna dalam cluster analysis atau hotspot analysis.
Kita akan bekerja dengan sebuah dataset lokasi kriminal di Surrey, UK untuk tahun 2011 dan menemukan hotspot kriminal di sebuah negara.
data.police.uk provides street-level crime, outcome, and stop and search data in simple CSV format.
Download the data for Surrey Police and unzip the downloaded archive to extract the CSV file.
For convenience, you may directly download a copy of the dataset from the link below:
Data Source [POLICEUK]
2015-08-surrey-street.csv
file on your computer and open
it. (Your filename maybe different if you downloaded a fresh copy of the
dataset). Select CSV (comma separated values) as the file
format. You will see the Longitude
and Latitude
columns automatically
selected as X and Y fields. Make sure you check the Use spatial
index option as that will speed up your operations on this layer. Click
OK.Anda mungkin melihat sejumlah error. Anda dapat tidak menghiraukan hal ini untuk tujuan tutorial ini. Klik Close.
Catatan
If you need to change the automatically assigned CRS, you can use
.Zoom-in sedikit lebih dekat untuk mendapat visual yang lebih baik pada data. Anda akan melihat bahwa data cukup padat dan sulit untuk tahu di mana konsentrasi tinggi poin-poin tersebut. Ini saatnya heatmap menjadi berguna.
2015-08-surrey-street
and select
Properties.Oranges
color-ramp. Leave the
other parameters to default and click OK.Heatmap
. See Menggunakan Plugins to know how
to enable built-in plugins. Once you have enabled the plugin, go to
.crime_heatmap
as the
name out the Output raster. Enter 1000 meters as the
Radius. Radius is the area around each point that will be used
to calculate the i`heat` a pixel received. Check the Advanced so
we can specify the output size of our heatmap. Enter 2000
as
Rows value. The Columns value will update
automatically. Click OK to start the heatmap creation process.crime_heatmap
loaded into the canvas. Uncheck the
2015-08-surrey-street
layer.Sekarang anda akan melihatt sebuah heatmap yang lebih menarik . Anda dapat memilih tool xxx dan klik pada pixel manapun pada heatmap. Anda akan melihat nilai pixel pada pop-uo hasil. Nilai pixel ini adalah penghitungan berapa banyak poin dari layer sumber yang masuk pada radius yang sudah ditentukan ( dalam kasus kita - 1000m ) di sekitar pixel.
10
for this data. In Raster calculator dialog, name the
output layer as crime_hotspots_vector
. Double-click on
crime_heatmap@1
under the Raster bands section and
it will be added to the Raster calculator expression textarea.
Complete the expression as shown below. Check the box next to
Add result to project and OK."crime_heatmap@1" > 10
crime_hotspots
will be added to QGIS. This layer has
pixels with values of either 0 or 1. All pixels in the input layer where
the pixel value was larger than 10
now have a value of 1 and all
remianing pixels are 0. Click on .crime_hotspots_vector
. Check the box
next to Field name as well as Load into canvas when
finished. Click OK.crime_hotspots_vector
added to QGIS. This is the vector representation
of the clusters that were created in the previous step. The layers contain
clusters with both 0 and 1 values. Let’s filter out the 0 values, so we
get the clusters of hotspots. Right-click on the layer and select
Open Attribute Table.Pada Attribute table , klik Select feature using an expression.
"DN" = 0
crime_hotspots
layer. The final
layer crime_hotspots_vector
contains the cluster extracted from the
heatmap. These clusters are the intelligence gathered from the raw data
and can provide useful insights as well as serve as an input for further
action.This work is licensed under a Creative Commons Attribution 4.0 International License