YouTube Channel for IJGIS Webinar

https://www.youtube.com/channel/UChhdFPA_sw9HYgluFcjK1bA

Buat yang hobi baca artikel dari journal Q1, IJGIS, International Journal of Geographical Information Science, yang dapat diakses dari Perpusnas via

https://e-resources.perpusnas.go.id:2130/tgis20

(butuh login dulu ke perpustakaan)

BTW, seperti webinar para professor … ngga se-asyik nonton tiktok … tapi … melihat langsung eh via YouTube wajah author atau reviewer itu … SESUATU ….

[QGIS] [Raster] Georeferencing Google Earth

Citra satelit dari Google Earth memiliki kelebihan yaitu memiliki historical imagery, yang dapat diakses melalui butang berbentuk jarum jam dengan panah berputar berlawan arah jarumjam (Counter Clockwise)

Show historical imagery on Google Earth

Latihan kali ini, kita akan melakukan kembali georeferencing, seperti latihan sebelumnya. Namun, kali ini kita tidak akan memasukkan koordinat lagi, tetapi menggunakan patokan peta yang telah dibuka sebelumnya.

Download peralatan tempur dahulu

Sila download (unduh) dahulu file latihan kita di Google Drive saya berikut:

https://drive.google.com/drive/folders/12hleI-rwya5J8Z0sPHgWXbU_iATgPCSv?usp=sharing

Pada folder tersebut, sudah saya buatkan sebuah project QGIS, yang telah diisi layer XYZ ke Esri World Imagery, dan sebuah KML file yang dibuat dengan Google Earth

Berhubung ini masih kuliah minggu ke1 (buat mahasiswa PERMATA) / minggu ke2 buat mahasiswa regular UIN Suska Riau, maka, saya sertakan saja dahulu tile XYZ dan KML nya.

Pertemuan berikut, kita akan belajar membuat sendiri.

Tiga buah gambar JPG

Pada folder tersebut telah tersedia juga 3 buah citra satelit hasil export dari Google Earth.

Jika Ananda ingin membuat sendiri, pastikan posisi gambar direset sebelum di export dengan menu View -> Reset -> Tilt and Compass. Dengan begini, gambar tidak tilt (mereng , tetapi sudah “ortogonal”, terlihat dari atas), dan sudah lurus ke bagian true north (utara sebenarnya) di bagian atas.

Reset Tilt and Compass agar gambar lurus sebelum di export

Namun, ananda tidak harus melakukan ini sekarang, karena gambarnya sudah saya export. Saya khawatir Ananda belum mendownload Google Earth Pro.

QGIS Enable Snapping

Snapping memungkinkan kita memilih vertex lebih akurat, dan dapat menghindari kerusakan vector karena tidak menempel / mengunci.

Snapping terkadang tidak ter-enable by default, karena dikahawatirkan membingungkan pemula.

Kali ini, kita membutuhkan snapping nya on ke verteks. Artinya, begitu mouse kita mendekati titik verteks, posisi mouse akan “terkunci” ke verteks tersebut, sehingga koordinat lebih presisi.

QGIS Settings -> Options …

Untuk meng-enable snapping, buka dulu opsi QGIS dari menu Settings -> Options…

Supaya lebih cepat, diketik saja snap, agar cepat dicari…

Pastikan snapping nya on (dicentang) dan kita gunakan 30 pixels.

Artinya, posisi mouse akan menempel ke titik verteks terdekat 30pixel.

Tanda snapping sudah bekerja adalah dengan adanya tanda kunci ke verteks terdekat saat kursor mouse mendekati sebuah titik

Georeferencing

Sekarang, buka Raster -> Georeferencing, dan buka gambar kita

Zoom in (scroll mouse) ke sebuah sudut kotak pada gambar.

Kali ini, kita tidak akan memasukkan koordinat seperti kemaren, tetapi milih kotak tersebut pada QGIS (lihat ilustrasi gambar angka 3)

Pilih verteks yang sesuai dengan koordinat kita, pada contoh adalah kiri atas

Pastikan snapping terlihat, sehingga kita pilih adalah titik verteks nya.

Koordinat X dan Y sekarang otomatis diisi oleh QGIS

Nah, buat yang penasaran kenapa angkanya besar sekali, karena kita sekarang otomatis menggunakan CRS 3857 (Pseudo Mercator) baca: sudo merkator, atau koordinat Google, dalam meter dan bukan derjat lagi seperti WGS 84 / EPSG: 4326

Ini bisa dilihat dari status bar pada pojok kanan bawah QGIS

terlihat residual kita sangat kecil, karena posisi kita menempel dengan semprulna

Lakukan terus untuk 3 titik berikutnya

Residual terlihat kurang dari setengah pixel… kalau peta scan kemaren hingga 20pixel

Kalau residual belum keluar, dikarenakan belum kita setting transformasinya. Silahkan disetting kembali (jika belum)

Untuk sementara abaikan saja EPSG nya, karena kita linear, kita hanya butuh membuat World File.

Untuk hasil yang lebih presisi, Ananda bisa menggunakan projective pada type transformasi, namun akan menghasilkan berkas raster baru, berbentuk GeoTIFF, dan biasanya cukup besar ukurannya, walaupun sudah dikompres dengan DEFLATE, apalagi kalau tidak dikompres.

Sekarang kita linear saja, karena gambar tidak tilt dan tidak terputar (sudah direset tilt dan compass nya)

begitu dipencet tombol start, akan masuk gambar kita ke sebuah layar baru di QGIS, namun CRS nya masih tanda tanya … walaupun sama dengan CRS kita sekarang, 3857, sudo merkator

Kalau Ananda risih, atau ingin mengganti koordinat CRS QGIS nantinya, silahkan saja dipencet tanda tanya tersebut, dan pilih 3857

Pilih Pseudo-Mercator, yaitu proyeksi XZY tile atau terkadang dibilang proyeksi Google Map

Copy WLD

Selamat! Ananda sudah bisa me-rektifikasi / meng-geo-referensing gambar.

Berhubung gambarnya sama koordinatnya, hanya berbeda temporal nya saja (waktu nya saja), maka kita dapat saja meng-copy kan WLD nya menjadi WLD file gambar yang lain …

Silahkan copy dan rename file, sesuai dengan nama file gambar yang lain

Drag and drop / seret dan jatuhkan dua gambar yang lain ke QGIS,

Opsional: agar rapih, dijadikan Group

Sedikit tips agar rapih, pilih ketiga gambar, lalu jadikan group. Pilih ketiganya, klik kanan, pilih Group Selected. Sebenarnya ada juga tombolnya… silahkan cari sendiri di atas layer

Nah, kelebihan dari group, bisa kita buatkan mutually exclusive. artinya, hanya satu gambar yang bisa hidup. Mirip radio button, tetapi radionya masih pakai checklist di QGIS ini … hahaha

Trouble Shooting / Error

Jika Ananda ada yang ragu, dan ingin melihat file yang saya hasilkan, ada saya upload juga file final nya … cukup move / pindahkan berkas tersebut ke folder kerja Ananda …

.

.

[QGIS] Raster GeoReferencer

This post is intended to my fellow students of GIS Fall 2021.

Start QGIS

Load World Map by typing “world” without quote into mouse coordinate at bottom right corner of your QGIS

type world at coordinate textbox, then, press Enter key

Download the Raster

Download 0816 PAKANBARU. It’s quite huge, around 11 Megabyte

Load Georeferencer Plugin

If Georeferencer submenu is hidden from your raster menu, try to enable it from Plugins menu

Old YouTube video with no sound.

Use savefrom.net/https://youtu.be/rG1pqgbG5Sg to download the video

All Geology map being uploaded at Google Drive

You don’t need to download it, but if you curious, and have plenty of hard-drive space and bandwidth,

Gridded Population of the World (GPW), v3

The newer version of GPW is version 4, so … this one is some how outdated.

You can donwload GPW v3 from here: https://sedac.ciesin.columbia.edu/data/set/gpw-v3-population-density/data-download

original resolution is 375x151px

The only problem is … the server seems so slow, so you need to be a lil bit patient to wait for the download to finish …

If you don’t have that kind of patience, you may download them from my own one, which had been re-upload here, into my Google Drive …

https://drive.google.com/drive/folders/1tgu4h2B9EVlVSmQ3WmXkrI3QyFbnVbYQ?usp=sharing

Bounding Box

University of Columbia has pre-built GeoServer WMS serviced image promoted to their page. Those images are not globally covered earth…. since they only cover from altitude of -60 (south) up to +85 north

bbox=-180,-60,180,85

Most NASA global images are covering up from south pole to north pole …. i.e. from altitude -90 south up to +90 north …

Since it is a GeoServer WMS service, you can easily change the bbox (Bounding Box) back into whole globe, which is:

bbox=-180,-90,180,90

and do not forget to change WIDTH and HEIGHT also

width=5400&height=2700 (for 8km resolution or about 0.06667degree)

or

width=10800&height=5400

for 4 km resolution (about 0.03333 degree)

8 km and 4 km resolution

Since the 8 km and 4 km are usual resolution for global coverage, we can easily create WLD (World File) from other raster which has same resolution …

I put them also into Google Drive … if you curious

Now, since we have our WLD already, we can open our raster into QGIS or ArcGIS, and will be align automagically …

What about 2km resolution?

Well, Uni GeoServer seems to be set to only allow 800Mega Byte of memory to use to render our WMS raster.

If you want to make greater resolution, you will need to split our bbox

MariaDB / MySQL Spatial

MySQL is not mainly intended to spatial query, whilst still has some usable inbuilt functions as WebGIS back-end.

I do prefer PostGIS as database for every WebGIS project that me or my student develop.

BTW, to be honest, MySQL is quite fast, simple and easy to deploy and host. Almost every shared hosting (both paid and free like 000webhost/hostinger) provide MySQL with spatial query functionality.

If you want to deploy PostGIS, you need to pay for at least VPS (virtual private server) service and install (configure) linux, postgreSQL, apache/ngix by your own … and it took time and also pricy ( IDR 200k monthly) compared to SharedHosting (IDR 150k annually)

Why MySQL

If you only want to show some POINTs , POLYGONs or POLYLINEs, doing simple spatial query like
* building (constructing) features,
* spatial relationship (like CONTAIN / WITHIN, intersects, touches)
* creating GeoJSON / Text / WKT (Well Known Text)

You can count on MySQL or MariaDB

Measuring Area / length and projecting is sucks in MariaDB, but you can use Google Maps API or Leaflet or any JavaScript library to help you with it.

Why or When You Should Not use MySQL

If you are developing big GIS project, with heavy spatial functions (like those who had been provided by PostGIS, creating / projecting rasters, and as a database-back-end for your Desktop GIS (like QGIS or ArcGIS), then … please go with PostGIS

But … it’s only my own opinion … based on what I’ve been tinkering along.

What about Oracle / SQL Server?

Well, Oracle is too complicated for GIS… IMHO, and also the license. It just too heavy for me. Oracle is best suited for banking / finance.

Ok… now back with MySQL

If you still reading this paragraph, either you’re a geek or crazy … or you’re my students who’ve been assigned to read this post.

If you want to use MariaDB, please download it here.

https://mirrors.nju.edu.cn/mariadb//mariadb-10.6.4/winx64-packages/mariadb-10.6.4-winx64.msi

Indonesian mirror seems not working …

Before You’re Installing a new MariaDB

please back-up your old MySQL Databases … Lots of my students using XAMPP,

Old MySQL (like 20 years ago) using MyISAM as engine, so, you can easily zip mysql data folder then … it’s your back-up… you can copy-paste it into newer version or you friends laptop.. and will installing automagically.

But, InnoDB Engine is some how different.

You need to DUMP your old databases into SQL file, then, import it again on your new location / version.

I have back-up my old databases, now what?

OK, please proceed to install your MariaDB …

Removing old XAMPP service on MySQL is somehow helping a bit …

Make Sure You also install HeidiSQL (included within installer)

HeidiSQL is like TOAD at oracle, GUI client, powerful enough.

For old man like me, who love PHPMyAdmin a lot … learning HeidiSQL is like cheating with other girls … but …

Create ODBC account on your new MariaDB

ogr2ogr using ODBC to connect to MySQL, so … creating credentials for ODBC is will save your time next time

ERROR on creating table on your MySQL Database (if you have not providing user)

Click button whose icon like 2 people avatar, titled “Manage user authentication and privileges”

Click Add,

Type a new User name

If you only want to restrict ODBC user to messing with your GIS database, and not other precious databases, you can set it here.

easily creating table from your SHP file with ogr2ogr -f MySQL

Some Demo on SQL

If you’re my student, I will provide you with three tables: desa, perusahaan and sma

SELECT
s.nama_sekolah,s.kec, upper(s.desa), b.desa
FROM
sma s, bps_podes2014_riau b
WHERE
ST_WITHIN(s.SHAPE, b.SHAPE) AND upper(s.desa)<> b.desa

Previous image, showing you how to use ST_WITHIN, an SQL function to test whether sekolah shape within wich desa’s polygon

You’ll see that some geo-referenced location is some how are quite different with sekolah own column.

Next exercise … window query (aggregate) on spatial query

perusahaan table has no location field but POINT …

we can create their location field (kabupaten/kota, kecamatan or desa/kelurahan) from desa table …

The other useful query is window query … a simple count over partition

With window query, we can count how many perusahaan within specified kabupaten kota or kecamatan …

Clever way of batch converting Latitude/Longitude to Ordnance Survey XY in Excel

The Ordnance Survey grid conversion is usually required when dealing with some projects across the UK. Usually, along with the standard WGS 84 datum, we need to define X (Easting) and Y (Northing) coordinates. This task might be quite time-consuming when converting our locations one by one. Fortunately, we have some tools, which can do […]

Clever way of batch converting Latitude/Longitude to Ordnance Survey XY in Excel

Using Projected Coordinate System: Although we already know that projected map is always distorted (i.e. contains error)

Commonly, every map should be able to represent the location information of the area of interest along with its Shape Scale/distance Area If we are looking simply for the answer of “where?” from the map, Geographic coordinate system is enough, which map provide the location in degree decimal units. We can’t get actual measurements of […]

Using Projected Coordinate System: Although we already know that projected map is always distorted (i.e. contains error)

GIS Lecturer, in Bahasa (Indonesian)