top of page

Spatial Proximity Analysis of Pharmacy Stores in Ebute Metta, Lagos

Updated: Aug 12

Abstract


This study presents a spatial proximity analysis of pharmacies and medical stores in the Ebute Metta area of Lagos using PostgreSQL with the PostGIS extension. We mapped the locations of all pharmacy stores in the area and studied their accessibility to residential neighborhoods. Geospatial queries, buffer analysis, and proximity calculations were applied to identify underserved zones with limited access to pharmaceutical services. The outcome of this study provides valuable insights for healthcare planning by highlighting sub-areas where new pharmacy stores can be established to enhance coverage. This study demonstrates how effective open-source spatial database tools can address urban health-access deficits in geographical entities.


Introduction


This project presents a spatial proximity analysis for pharmacy stores in the Ebute Metta area of Lagos State. The study was conducted in the second week of April 2026 using coordinates (latitude and longitude) from Google Maps. We performed buffer analysis to identify areas in Ebute Metta that are distant from pharmacy stores, along with an information table for pharmacy stores in the community.


Objectives of the Study


  • To apply the buffer feature of PostgreSQL to determine the spatial proximity of pharmaceutical stores in Ebute Metta and uncover underserved areas.


Study Area


The study was conducted within the Ebute Metta area of Lagos State, which is part of the Lagos Mainland Local Government Area. It consists of two districts: East and West, representing a developed urban settlement. The area exhibits spatial growth in land use, population distribution, and major infrastructure development. The eastern ward is bordered by the Lagos Lagoon, while the western part is adjacent to Western Avenue. A major road divides both sub-areas, running from Yaba to Iddo Island.


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 information, working hours, number of pharmacists, and ward locations.


Software Environment


  • PgAdmin4: Used for creating database tables and joining geometry and geography to analyze and measure real points on the Earth's surface.

  • Google Maps: Used 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, and buffering to show underserved areas. The workflow involved using Google Maps for data collection and PostGIS extensions for spatial database analysis.


Preprocessing Using Google Maps


Google Maps was used to gather essential information about the pharmacy stores in Ebute Metta. This included the pharmacy name, ward/district location, working hours, number of pharmacists present, store contact information, and coordinates (latitude and longitude).


Creating Table and Indexing


PostGIS extensions were used to create a table that nests information about these pharmacy stores in the database. The table contains attributes for each pharmacy store, including the pharmacy name, ward/district location, working hours, number of pharmacists present, store contact information, and coordinates. The rows of this table contain unique attributes of each pharmacy store in the area, as shown in Table 1 below. Figure 2 illustrates 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 were used to create a table that nests the ward ID, name, and coordinates. Indexing was applied 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 process merges the geographical details of the pharmacy stores and ward polygons.


Pharmacy Counts


This query determines the number of pharmacy stores in each ward in Ebute Metta. Twelve (12) stores are located in the Western ward, while thirteen (13) stores are in the Eastern ward. This information was organized in ascending order.


Buffering


The ST_Buffer function of the PostGIS extension was used to portray the buffer coverage of each pharmacy store at a 700-meter radius, in accordance with the pharmacy licensing rules in Nigeria. This illustrates the service coverage of each pharmacy store in the area. Figures 4 and 5 show the buffer areas 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


A query was conducted to determine the underserved areas of Ebute Metta. This was achieved by using the ST_Union function to merge the ward boundaries and pharmacy store coverage (buffer), followed by the ST_Difference function to present the underserved areas. Figure 6 illustrates these 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 revealed a clear pattern in the distribution of pharmacy stores across the Ebute Metta area. Most stores are well-distributed in the central and more developed parts of the community, particularly along major roads and commercial areas. This clustering is likely due to higher foot traffic and improved sales in these locations. However, the results also highlighted significant gaps in coverage, especially on the outskirts of the western ward. Residential neighborhoods in these areas fall outside a reasonable walking distance to any pharmacy store. The buffer analysis further emphasized the uneven distribution, particularly in the western ward. While the center of Ebute Metta enjoys relatively good access, the outer sub-areas in the western ward appear underserved.


Conclusion and Recommendations


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


It is highly recommended that local authorities and private investors consider these findings when planning to site new pharmacy stores. Prioritizing underserved outer neighborhoods will improve access to medicines for residents.


By addressing these gaps, we can enhance healthcare access and outcomes for the community. This analysis serves as a crucial step in promoting better healthcare planning and resource allocation in Ebute Metta.


---


This article aims to provide insights into the importance of spatial analysis in healthcare planning. By utilizing tools like PostgreSQL and PostGIS, you can uncover critical information that drives effective decision-making in urban health services.

Comments


bottom of page