Leveraging Kaggle for Free Geographical Data: A Guide to Integrating with PostGIS via QGIS

Leveraging Kaggle for Free Geographical Data: A Guide to Integrating with PostGIS via QGIS

In today’s data-driven world, access to quality geographical data is crucial for a wide range of applications, from urban planning to environmental monitoring. While obtaining such data may seem daunting, platforms like Kaggle offer a treasure trove of freely available datasets waiting to be explored. In this article, we’ll walk through the process of acquiring real geographical data from Kaggle, loading it into QGIS as a CSV layer, and seamlessly integrating it with PostGIS for advanced spatial analysis.

1. Prepare Data from Kaggle Datasets:

Navigate to Kaggle Datasets (https://www.kaggle.com/datasets) and explore the vast collection of available datasets.
Use the search functionality to find geographical datasets relevant to your area of interest. Whether it’s demographic data, transportation networks, or environmental parameters, Kaggle likely has what you need.
Select a dataset that suits your project requirements and download it in CSV format. Ensure that the dataset contains geographical attributes such as latitude and longitude or shapefiles for spatial analysis.

in this article we will use Riyadh Restaurants Dataset

Then download it

2. Open QGIS and And Add your Basemap:

You can Access Tabaqat’s free basemaps (https://platform.tabaqat.net/base-maps) to enhance the visual representation of your geographical data for Saudi Arabia within QGIS.
Tabaqat offers a variety of basemap styles, including street maps, satellite imagery, and terrain maps, enabling you to choose the most suitable backdrop for your analysis.
Integrate the Tabaqat basemap with your QGIS project to provide context to your geographical data and facilitate spatial interpretation.

Then Copy the WMTS URL Note Optain your access_token by signing up and replace it on url before using it for example


https://basemaps.tabaqat.net/styles/bright-arabic-ksa-boundary/wmts.xml?access_token=YOUR-ASSESS-KEY => https://basemaps.tabaqat.net/styles/bright-arabic-ksa-boundary/wmts.xml?access_token=tabaqat-13uPaas5bdT6IW-xxxxxx

Then add the basemap to your QGIS Project


Congrats

3. Add CSV as a Layer:

Launch QGIS, Create new project.
Use the ‘Add Layer’ button to import the CSV file you

Navigate to the downloaded dataset in file name input and select your file

Your Data is Ready

4. Load Data to PostGIS:

PostGIS, an extension of PostgreSQL, is a spatial database that allows for advanced storage, retrieval, and analysis of geographical data.
Before loading data into PostGIS, ensure that you have PostgreSQL and PostGIS installed on your system or you can Get Free PostGIS Hosted on the Cloud From SupaBase, check this article for more info: (https://dev.to/fady-shafeek/how-to-get-free-postgres-if8).

then enter your credential and test the connection

Now Drag and Drop Time!!

Congrats your data imported to PostGIS Successfully!

Leave a Reply

Your email address will not be published. Required fields are marked *