Skip to main content
100%

Gist cf3923e7f58c91a2953a2d9b91f9d0db

✓ Published0🌍 Public
CConorAspell
Last edited Mar 27, 2022
Created on Mar 27, 2022

This example shows a serverless function that converts a free-text address into geographic coordinates by matching the address’s county against a GeoJSON file of Irish county boundaries. The visualization highlights the geometry of the matched county, returning its centroid’s x and y coordinates alongside the parsed town and road names. The code uses `geopandas.read_file` to load the spatial data and `row['geometry'].iat[0].x/y` to extract the coordinate pair from the selected polygon. The response is delivered as JSON, with a 400 status code if parsing fails.

AI-generated description

Similar vizzes