Week 6: Developing the First Piece of the EV Coverage Script
April 29, 2026
The objective of this past week was to develop the first functional component of the EV coverage analysis Python script: to access live EV charging station data from an API and to integrate it into ArcGIS Online (AGOL) for future mapping and analysis. The first step I took was setting up an API key through the National Renewable Energy Laboratory, or NREL, which allows for continual access to the Alternative Fuels Station database, which keeps track of EV charging stations throughout the country, updating constantly with new data. Successful data retrieval using the API was a critical step, as one of the core components of the tool in development is the ability to access live data. Written in Python and using only the lightweight “requests” library, load_ev_stations.py is free from dependency on larger GIS-specific packages. The script authenticates with AGOL using OAuth2 and queries the NREL API for publicly available Level 2 and DC Fast Charger stations in Washington, DC. Results are uploaded to a feature layer titled GA_EV_Stations_DC.
There were some technical hurdles along the way. The NREL API only returns 200 records per call, and their paging function did not appear to work (it kept returning duplicate records). In order to address this, I split our zip codes into two groups, querying the two separately and removing any duplicates according to station ID. The run resulted in the successful accounting for of all 246 relevant stations in DC. One crucial design change I made along the way was related to how the script handles being run multiple times. The original logic merely resulted in a clearing of the feature layer, refreshing from scratch every time. That’s fine for a proof of concept but wouldn’t work for a tool that someone would run repeatedly, as it would delete any edits or notes they added to the layer. Rather than deleting and reloading all of the data every time, the script now “smart syncs” by only appending new stations and deleting old ones (matched by ID), leaving pre-existing records intact. This allows users to manually edit station info or make annotations without worrying about losing that data if they need to re-run the tool.

Leave a Reply
You must be logged in to post a comment.