Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS API for Python

Download the samples Try it live

Finding suitable spots for placing heart defibrillator equipments in public

In this sample, we will observe how site suitability analyses can be performed using the ArcGIS API for Python. The objective of this sample is to find locations in the city of Philadelphia that are suitable for placing AED (Automated External Defibrillator) for public emergencies.

Image of an AED device attached to a wall at San Diego Convention Center during Esri UC

The criteria for suitable places are those that have high incidence of OHCA (Out of Hospital Cardiac Arrests) and be accessible to public, such as commercial areas.

As inputs, we start with geocoded OCHA (Out-of-Hospital Cardiac Arrest) point data, along with a few base layers for the city of Pittsburgh published as feature layers. As output, we need to generate a list of locations that have a high incidence of heart-attacks and located within commercial areas, allowing easy access at times of emergencies.

Getting set up

In [1]:
from arcgis.gis import GIS
from arcgis.mapping import WebMap
from arcgis.widgets import MapView
from arcgis.features import FeatureCollection, use_proximity_proximity
from datetime import datetime
In [2]:
gis = GIS(url='https://pythonapi.playground.esri.com/portal', username='arcgis_python', password='amazing_arcgis_123')

Load input datasets

In [70]:
ohca_item = gis.content.search(query="title:pitts* & owner: api_data_owner", item_type='Feature Layer')[0]
ohca_map_item = gis.content.search(query="title:pitts* & owner: api_data_owner", item_type='Web Map')[0]
ohca_item
Out[70]:
Pittsburgh heart attacks
OHCA in PittsburghFeature Layer Collection by api_data_owner
Last Modified: March 11, 2020
0 comments, 30 views

Let us take a look at the layers available in this item

In [68]:
for lyr in ohca_item.layers:
    print(lyr.properties.name)
Heart attack incidence
Streets
Zoning
Boundary

Let us display the Web Map item to view these layers on a map.

In [38]:
map1 = MapView(item=ohca_map_item)
map1.legend=True
map1