Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

FACULTY OF COMPUTING, ENGINEERING and SCIENCE

Assessment Cover Sheet and Feedback Form


2023/24
Name: Mobeen Fatima Roll No: 30076293
Module Code: Module Title: Lecturer:

IS4S703 ICT Systems Development: Mitchel Langford


Spatial Databases

Milestone No: No. of pages in total including this Maximum Word Count:
page: 5
2 n/a

Assignment Title: Spatial Queries

Tasks: see attached

Date Set: Submission Date: Feedback Date:


31st Jan 2024 1st Mar 22nd Mar

Query 1: Identifying Hospitals within a Buffer of Public Parks


1. Analysis:
This inquiry points to recognize healing centers found inside a 1-kilometer buffer zone
encompassing open parks in Ribs. This examination employments a proximity-based approach
to get it the spatial openness of clinics from recreational areas.

2. SQL Query:
SELECT h.*, ST_Buffer(p.geom, 1000) AS buffer
FROM hospitals AS h
JOIN parks AS p ON ST_Intersects(h.geom, p.geom);

3. Explanation:
 The inquiry joins the "healing centers" and "parks" tables based on the spatial relationship
between their geometries.
• ST_Intersects work checks on the off chance that the healing center geometry converges the
stop geometry.
• ST_Buffer makes a buffer zone of 1000 meters (1 kilometer) around the stop geometries.
• The last choice incorporates all clinic qualities (h.*) and the produced buffer (buffer).

4. Results and Analysis:


You’ll get a table posting healing centers and their comparing buffer zones. Analyzing the
information, you'll be able healing centers falling inside these buffer zones, demonstrating their
vicinity to open parks. Visualizing the comes about in QGIS with healing centers as focuses and
buffers as polygons permits for a clearer understanding of their spatial relationship with parks

Query 2: Finding Schools near Flood-Prone Areas


1. Analysis:
This query points to distinguish schools found inside a 500-meter span of ranges vulnerable to
flooding. It utilizes a proximity-based investigation to evaluate the potential chance variables for
schools arranged close surge zones.

2. SQL Query:
SELECT s.*, ST_Buffer(f.geom, 500) AS flood_buffer
FROM schools AS s
JOIN nrw_floodwatch AS f ON ST_DWithin(s.geom, f.geom, 500);

3. Explanation:
 The query joins the "schools" and "nrw_floodwatch" tables based on their spatial proximity.
 ST_DWithin work checks in the event that the school geometry is inside 500 meters of the
surge zone geometry.
 ST_Buffer makes a buffer zone of 500 meters around the surge zone geometries.
 The last determination incorporates all school qualities (s.*) and the produced buffer
(flood_buffer).

4. Outcome:
School subtle elements and their comparing buffer zones. Analyzing the comes about, you'll be
able schools falling inside the surge zone buffers, highlighting their potential defenselessness to
flooding. Visualizing the comes about in QGIS with schools as focuses and buffers as polygons
permits for a spatial evaluation of their vicinity to surge risks.

Query 3: Analyzing Population Density around Railway Stations


1. Analysis:
This query points to analyze the populace thickness inside a 2-kilometer span of railroad
stations in Ribs. It utilizes a spatial crossing point investigation to get it the dispersion of
populace around transportation hubs.

2. SQL Query:
SELECT ST_Union(buffer) AS combined_buffer,
SUM(population)/ST_Area(ST_Union(buffer)) AS avg_density
FROM (
SELECT ST_Buffer(s.geom, 2000) AS buffer, p.population
FROM railway_stations AS s
JOIN population_grid AS p ON ST_Intersects(s.geom, p.geom))
AS subquery;

3. Explanation:
• The inquiry employments a subquery to discover the populace inside a 2-kilometer buffer
around each station.
• ST_Buffer makes a buffer zone of 2000 meters around the station geometries.
• ST_Intersects checks on the off chance that the buffer zone meets the populace network
cells.
• The primary inquiry at that point totals the results:
• ST_Union combines all person station buffers into a single, unified buffer zone.
• SUM(population) calculates the entire populace dwelling inside the combined buffer.
• ST_Area calculates the entire range of the combined buffer.
• The last result shows the combined buffer (combined_buffer) and the normal
populace thickness inside the buffer zone (avg_density).
4. Outcome:
combined buffer geometry and the normal populace thickness inside that buffer. Analyzing the
result, you'll get it the common populace thickness around railroad stations in Ribs. Assist
examination can include comparing normal thickness values for distinctive locales or station
sorts. Visualizing the combined buffer zone in QGIS can provide a spatial context for the density
analysis.

You might also like