CityName
Version 1.1.0.0 (1.04 MB) by
Richard Moore
Given a latitude and longitude, return the name of the nearest city
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 (2026). 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 LinuxCategories
- Mathematics and Optimization > Mapping Toolbox > Coordinate Reference Systems >
- Radar > Mapping Toolbox > Coordinate Reference Systems >
Find more on Coordinate Reference Systems in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
