The coordinates that are given for Cortland NY are incorrect.
Lat:=42.5842136, Lon:-76.0704906 is McGraw New York, where as Cortland NY is Lat:42.6012 Lon:-76.1805.
Searching osm.org for “cortland ny” gives me two results:
- Cortland County as first result Relation: ‪Cortland County‬ (‪1838016‬) | OpenStreetMap with Node: ‪Cortland‬ (‪316976650‬) | OpenStreetMap as the “label” roughly midpoint of the county at 42.5842136, -76.0704906 as you posted
- City of Cortland Relation: ‪City of Cortland‬ (‪174991‬) | OpenStreetMap as the second result
Is including Cortland County, New York when searching for “Cortland NY” incorrect?
When I use the API, both “Cortland NY” and “Cortland County NY” return the same coords.
42.5842136, -76.0704906 would be correct for Cortland County.
42.60026 -76.17773 would be correct for The City of Cortland, which your second link shows.
I guess my issue is I cannot get the API to return “The City of Cortland”. Both Cortland and Cortland County return the same coords with a different name for me.
Just to confirm, as that might help someone look into it: Which API are you using? What’s the exact request you are making?
I can reproduce the issue using Nominatim API integration on osm.org. This debug page gives some additional behind-the-scenes details.
As in most counties in the U.S., a place=county
node is located at the geographic centroid of the county. It’s a label
member of the boundary relation, so Nominatim knows the node and boundary relation are related. This node was originally part of a massive import of county nodes long ago, when our tagging standards were not as developed. In my opinion, these nodes are superfluous for “space-filling” administrative subdivisions like New York’s counties and towns, since data consumers can and do generate centroids automatically.
These place nodes’ name=*
tags omit “County”. I don’t think people normally refer to the county as just “Cortland” except very informally. The idea was probably that the “County” was superfluous because data consumers could automatically append that word to the name of any place=county
. But generally speaking, place names and classifications aren’t predictable enough in every language for that to be a rule hard-coded in software. The incorrect names are one more reason to delete the nodes, in my opinion.
Despite the place node’s name, most other U.S. counties don’t have the suboptimal search results that you encountered. I suspect a compounding factor is that, across New York State, the name=*
tag on each city, town, and village boundary has been modified to say “City of”, “Town of”, or “Village of” explicitly. In any other state, “City of Cortland” would be just “Cortland”. So the City of Cortland ends up looking like a worse match for “Cortland” than Cortland County, which at least has a name=Cortland
somewhere.
The boundaries were renamed as part of a very thorough statewide cleanup effort back in 2022. The names are fully qualified because many cities, towns, and villages of the same name border each other. For example, the City of Plattsburgh is an enclave of the Town of Plattsburgh. It occasionally comes up as a point of concern, like this past January when the boundary QA checker began flagging every single fully qualified name as a mismatch against Wikidata and Census Bureau data.
At the very least, the City of Cortland boundary should have an alt_name=Cortland
or short_name=Cortland
, so that Nominatim knows that people refer to the city as simply “Cortland”. If that doesn’t work, it might be a good opportunity to revisit either the place=county
nodes or the fully qualified naming in New York State. Perhaps someone on this forum who’s more familiar with the state than me could double-check this diagnosis before editing the map.
Minh_Nguyen is correct, and I can get the correct location by calling “City of Cortland”. And I believe their explanation is spot on as well.
For reference, i was requesting Nominatim Demo with city,state as the request parameters.
In such a case the wikipedia-derived importance usually takes care to ensure that the city is preferred over the county result. In this case however, Wikipedia finds the county significantly more interesting.
I suspect that this is due to the huge link boxes that have been added at the end of the article. They throw off the link counter. This is difficult to handle because afaik these links are not specially marked.
I’ve opened an issue: Thematic link boxes throw off importance computation · Issue #85 · osm-search/wikipedia-wikidata · GitHub
Wikipedia’s built-in search engine supports a bit of markup that excludes certain content such as navboxes and content quality warnings from the search index. However, Nominatim relies on Wikipedia’s database dump of backlinks, which doesn’t have that kind of granularity.
I removed one of the navboxes, which doesn’t belong there, since it doesn’t even provide navigation to the article. On the other hand, this means it doesn’t contribute to any other articles linking back to the article. It only serves to boost the page rank of colleges and universities in the region.
Apart from that, on the English Wikipedia, it isn’t unusual for a county article to contain a navbox about the county that links to all the county subdivisions and another navbox about the state that links to all the counties (among other things). This means all the county subdivisions and all the other counties will link back to the article.
The article for the City of Cortland should have quite a few backlinks too via the county navbox plus another navbox of all the state’s county seats. However, it also includes the state navbox even though this navbox doesn’t link to individual cities and towns. If every place in the state similarly includes this navbox unnecessarily, then that could help explain the high number of backlinks.
In general, it isn’t surprising that a county ranks higher than even its county seat. Among the cases where a U.S. county contains a place by the same name, some of the places are more famous, while some of the counties are more famous. But unless the place is a tiny unincorporated hamlet, the user is more likely to want the place unless they qualify the query with “County”.
Thanks, everyone, for the info so far! The support here has been amazing!
I started a discussion on Wikipedia about removing the state navbox from obscure articles. This isn’t purely a New York problem. I’ve seen the same thing happen in other states like Indiana too, but maybe we can start here and see what works.