This repo hosts pinpoint.ts, a cross-platform script that bulk geocodes
U.S. street addresses. It reads addresses from a CSV file, looks up their
coordinates with Nominatim by default (or another
service if you set GEOCODER_URL
), and writes results to GeoJSON and SQL files.
- Bun
- A CSV file with 4 required columns:
practiceId
,departmentId
,zip
, andminimalAddress
- Install Bun: See Bun installation docs.
- Clone or download this repository.
- Install dependencies:
bun install
- Optionally, override the default geocoder URL:
export GEOCODER_URL=https://another-geocode-service.com/search
Run the script with Bun:
bun run pinpoint.ts <addresses.csv>
The script reads addresses from the CSV and will produce <addresses.csv>.sql
and <addresses.csv>.geojson
files in the same folder.
- Reads each row of the CSV to get
minimalAddress
(andzip
if needed). - Calls the geocoding service (Nominatim by default).
- Logs a sample SQL
UPDATE
statement for each found coordinate. - Writes a GeoJSON file with point features of all geocoded addresses.
practiceId,departmentId,zip,minimalAddress
100,200,12345,"123 Main St Anytown"
101,201,67890,"456 Oak Ave"
- The script uses a 300 ms pause between geocoding requests to help avoid rate-limiting.
- For large CSVs or more stringent rate limits, you can increase that delay.
- Always check and follow the usage policies of any geocoding service you use.