CityName

Given a latitude and longitude, return the name of the nearest city
282 Downloads
Updated 3 May 2016

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

This uses a list of 5000 world cities from the GeoNames data set. Currently, it returns the name of the city with the closest latitude and longitude. An improvement that would better handle high latitude cases would use ground distance.

Cite As

Richard Moore (2024). CityName (https://www.mathworks.com/matlabcentral/fileexchange/56878-cityname), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

CityName/

Version Published Release Notes
1.1.0.0

Updated to use ground distance. Also adds options to: return region name, apply a population threshold, return the distance between the user-provided coordinates and the returned city.

1.0.0.0