Comment une implantation possible est calculée

When you give us a zone — a city, a province, a region — MaPharmacieChainage does far more than drawing a circle around existing pharmacies. Here is, step by step, how a potential site is computed.

1. The zone is split into ~100-metre cells

The zone's population comes from two gridded rasters (WorldPop 2026 and GHSL 2025), combined cell by cell keeping the highest estimate: no populated area is underestimated. Only populated cells are candidates — there is no point suggesting a pharmacy in an empty field.

2. Distances are measured in a local metric projection

The pharmacies recorded in OpenStreetMap and the populated cells are reprojected into the UTM zone matching the zone's longitude (UTM 29N in the west, 30N in the east of Morocco): distances are thus exact to the metre, measured as the crow flies, as the 300-metre rule requires.

3. Each cell is tested at 9 points, not one

The centroid of a 100 m cell can be ~70 m away from the worst point of the cell. Each cell is therefore evaluated on a 3×3 sub-grid (~25–33 m spacing): the worst of the 9 points must clear the 300-metre rule for the cell to qualify. Cells whose worst point lies between 300 and 320 metres are kept but flagged “to verify” — the resolution cannot decide more finely.

4. Non-buildable land is excluded

A compliant cell sitting inside an excluded land-use polygon — industrial zone, railway right-of-way, military land, port, landfill, cemetery, body of water or wetland — is automatically removed: regulatory compliance is useless if you cannot build there. Conversely, being far from a road never eliminates a cell: it only feeds the score.

5. New neighborhoods are tracked separately

Population rasters always lag behind recent construction. A cell with no measured population that overlaps a residential or under-construction polygon while clearing the 300-metre rule is kept on a separate “new neighborhoods” list — opportunities the numbers cannot see yet.

6. The best sites are selected sparingly

All qualifying cells form the heat map. Among them, the best sites are picked by descending score, with a minimum spacing of 300 metres between suggestions so they cover distinct neighborhoods. The list stops at 20 — and often earlier: as soon as a candidate falls below 40 % of the #1 score (or below 10 points), the selection stops rather than padding with mediocre sites.

7. Each site gets an address

Finally, each selected site is geolocated with its exact GPS coordinates and enriched with an estimated address (street, neighborhood) by reverse geocoding — ready for a field visit.

These computations are indicative: they guide the search for a site but replace neither the validation of the Ordre National des Pharmaciens nor an on-site visit.

← All articles