top of page

Proximity Analysis Using PostGIS: Mapping Healthcare Accessibility in Lagos

ABSTRACT

This study presents a spatial proximity analysis of pharmacy and Medical stores in the Ebute Metta area of Lagos using PostgreSQL with PostGIS extension. The location of all pharmacy stores in the area were mapped out and their accessibility to residential neighborhoods was studied. Geospatial queries, buffer analysis, and proximity calculations were applied to this study, underserved zones were identified with limited access to pharmaceutical services. The outcome of this study provides a better understanding for healthcare planning, by presenting sub-areas where new pharmacy stores can be provided to promote pharmacy store coverage. This study shows how effective open-source spatial database tools can be used in addressing urban health-access deficit in a geographical entity.

INTRODUCTION

This project presents a Spatial Proximity analysis for pharmacy stores in Ebute-Metta area of Lagos State. The study was carried out in the second week of April 2026 using coordinates (Latitude and Longitude) from google Maps. The buffer analysis was done to portray areas in Ebute-Metta that are quite distant to a pharmacy stores, coupled with information table for pharmacy stores in Ebute-Metta community.

OBJECTIVES OF STUDY

• To apply the buffer feature of Postgree SQL database in determining the spatial proximity of Pharmaceutical stores in Ebute metta and uncovering underserved areas.

STUDY AREA

The study was conducted within the Ebute-Metta area of Lagos State which is under the Lagos Mainland Local government area and it has 2-district namely ‘East’ and ‘West’ that collectively represent a developed urban settlement. The area exhibits spatial increase in terms of Land use, population distribution and major infrastructure development. The Eastern ward is enclosed with the Lagos Lagoon while the western part is bordered by the Western Avenue, with a major road dividing both sub-areas running through from Yaba to Iddo Island as portrayed.

Figure 1: Map of Lagos State, Nigeria showing Ebute metta
Figure 1: Map of Lagos State, Nigeria showing Ebute metta
DATA USED

Ebute-Metta Area Boundaries

  • Geometry Type: Multi-Polygon

  • Administrative Units: 1 Local government area (2 wards)

  • Projection: EPSG: 4326 (WGS 84 Datum)

  • Purpose: Spatial Proximity analysis

  • Datasets: Coordinates (Longitude and Latitude), names, contact, working hour, Number of Pharmacist and ward location and coordinates.

Software Environment

PgAdmin4 – Creating database tables and joining geometry and geography to analyse and measure real points on the earth surface.

Google Map- For extracting coordinates of all pharmacy stores in the area.

METHODOLOGY

The methodology adopted in this study combines creating database tables and indexing, Spatial joining of Pharmacy stores and wards, Pharmacy counts, buffering to show underserved areas. The workflow was done using Google Map for data collections, and PostGIS extensions for spatial database analysis.

• Preprocessing using Google Map

- Google Map was used to gather essential information about the pharmacy stores in Ebute-Metta. They include- Pharmacy name, Ward/district located, working hours, Number of Pharmacist present, Store contact, and Coordinates pair (Latitude and Longitude).

• Creating Table and Indexing

- PostGIS extensions will be used to create a table that nests information about these pharmacy stores on the database. These columns in the table will contain attributes affixed to all pharmacy stores and they are: Pharmacy name, Ward/district located, working hours, Number of Pharmacist present, Store contact, and Coordinates pair (Latitude and Longitude). The rows of this table contain unique attributes of each pharmacy store in the area as portrayed in Table 1 below. Figure 2 shows the geographical spread of pharmacy stores in Ebute metta.

Table 1: Attributes of Pharmacy stores in Ebute-Metta
Table 1: Attributes of Pharmacy stores in Ebute-Metta
Figure 2: Geographical spread of Pharmacy stores in Ebute-Metta area of Lagos
Figure 2: Geographical spread of Pharmacy stores in Ebute-Metta area of Lagos
• Creating Ward Table and Indexing

-PostGIS extensions will be used to create a table that nests the ward id, name and coordinates and indexing will be used to locate relevant geometry on the map. Figure 3 below shows the ward polygon.

Figure 3: Map of Ebute Metta area of Lagos showing the Eastern (right) and  	      Western (left) wards.
Figure 3: Map of Ebute Metta area of Lagos showing the Eastern (right) and Western (left) wards.
• Spatial Joining of Pharmacy stores and Wards

- This query classifies each pharmacy store in the area into the ward it intersects. Pharmacy stores outside all defined ward polygons will not appear in this result. This serves to merge the geographical details of the pharmacy stores and wards polygon.

• Pharmacy Counts

- This query is done to ascertain the number of Pharmacy stores in each ward in Ebute Metta. Twelve (12) stores are located in Western ward, while Thirteen (13) stores are located in the Eastern ward. This was done in ascending order.

• Buffering

- The ST_Buffer function of PostGIS extension was used to portray the buffer coverage of each pharmacy store at a 700 meters radius, as this is in accordance with the rule of Pharmacy licensing in Nigeria. These shows the service coverage of each pharmacy store in the area. Figure 4 and 5 shows the buffer area of pharmacy stores in the Eastern and Western wards respectively.

Figure 4: Buffer coverage of Pharmacy stores in Eastern ward of Ebute-Metta area
Figure 4: Buffer coverage of Pharmacy stores in Eastern ward of Ebute-Metta area
Figure 5: Buffer coverage of Pharmacy stores in Western ward of Ebute-Metta area
Figure 5: Buffer coverage of Pharmacy stores in Western ward of Ebute-Metta area
• Underserved areas

- Query was done to determine the underserved axis of Ebute-metta area. This was done by using the ST_Union function to merge the ward boundaries, pharmacy stores coverage (buffer), before using the ST_Difference function to present the underserved areas. Figure 5 shows the underserved areas.

Figure 6: Underserved area in Ebute-metta community with high proximity to pharmacy stores
Figure 6: Underserved area in Ebute-metta community with high proximity to pharmacy stores
DISCUSSION OF SPATIAL PROXIMITY ANALYSIS

The spatial analysis showed a clear pattern in the siting of pharmacy stores across Ebute Metta area. Most stores are well-spread in the central and more built-up parts of the community, especially along major roads and commercial areas. This clustering can be attributed to a higher foot traffic and improved sales in those areas. However, the results also showed noticeable gaps in coverage, especially on the outskirts of the western ward after using a seven hundred (700) meters buffer for each pharmacy stores. Residential neighborhoods on the outskirts of Ebute-Metta west falls outside a logical walking distance to any pharmacy store. The buffer analysis further highlighted how uneven the spread is especially in the western ward. While the center of Ebute Metta community enjoys relatively good access, the outskirts sub-areas in the western ward appear underserved.

CONCLUSION AND RECOMMENDATIONS

Conclusively, the PostGIS extension analysis clearly shows that pharmacy stores in Ebute Metta area are quite clustered in the central areas and developed zones, leaving many residents on the outskirts of the western ward with constrained access to essential medicines. This irregular distribution in the western wards highlights a gap in healthcare infrastructure within the area.

It is highly recommended that local authorities and private investors consider these findings when trying to site a new pharmacy store, by prioritizing the underserved outer neighborhoods to improve access to medicine for residents.

bottom of page