How to Geocode a City

The label placement is often designed to improving map readability rather than being driven by the data directly: often cartographic displacement is performed on the original geometries to improve the legibility of the map. 41Latitude had a great article on city label placement you might be interested in.

The USGS GeoNames aka GNIS (a commonly used public domain gazetteer used by e.g. Geonames.org, Wikipedia, OpenStreetMap) provides this note:

...The guideline for digitizing areal features requires that the primary coordinates be taken in the center, but the location of the center of a large city is sometimes somewhat subjective.

If you were looking to algorithmically choose the center of a city you might use the centroid of a polygon delineating the city limits, or perhaps something more sophisticated like using the center of the alpha shape.


I doubt there is a universal algorithm for this. Geocoding providers buy their address data from some vendor. That vendor - or whoever collects the data - simply decides where the 'center of town' is (based on their knowledge of the area).