Convert all you strings into actual latitudes and longitudes using some geocoding service.
Store coordinates of locations in a database that supports Geo distance queries (PostGIS, Elastic search)
Read up on how to query using geo relevance.
You might also want to look into Nested SetsNested Sets but if you hierarchy has variable depth you may want to look into a graph database to have proficient queries.