Skip to content
oslew
Get a free key

Learn

Why geocoders pick the wrong street

A geocoder usually returns the wrong location for one of five reasons: the street name exists more than once and the query did not say which, the context that would have narrowed it was missing or in the wrong place, the geocoder quietly dropped context it could not match, several candidates tied and one was picked for you, or a confidence score was trusted beyond what it measures. Each leaves a trace in a well-designed answer, so the fix starts with reading the right fields, not with changing provider.

Last reviewed

A wrong geocode rarely looks wrong. It comes back with coordinates, a formatted address and often a high score, and the error only shows when a driver arrives at a house on the other side of the city. Almost every such case traces back to one of a handful of mechanisms, and they apply to every geocoder, commercial or open source. This page describes each one, how to spot it in an answer, and what to change. oslew’s response fields are used as the worked example, because they were designed to expose exactly these failures; the same questions can be asked of any provider’s output.

1. The street name exists more than once

Cities reuse street names constantly — after national heroes, saints, dates, trees — and a large city can hold dozens of streets with the same name, several of them carrying the same house number. A query that names the street, the number and only the city leaves all of those streets in play. The geocoder then finds a genuine match: a real address point with the right name and the right number. It is simply on the wrong one of the streets, often kilometres from the intended one.

That is why “the wrong street” is more common than “no answer”. Measured on Mexico City held-out numbered addresses, the same addresses sent with only the city landed a median 162 m from the true point, and 52.2% of them within two hundred and fifty metres. Sent with the postcode instead, the median was 19 m and 86.7% landed within the same distance. With interpolation switched off, one city-scoped query in ten landed more than 18.1 km away; the postcode-scoped equivalent was 566 m. That long tail is ambiguity, not missing data. The accuracy page publishes the full table and how the sample was held out.

How to spot it: the tie count, if the duplicates matched equally well; otherwise the street and postcode in the answer’s normalised address differing from what the customer gave, or a position well outside the postcode they typed. The postcode lookup gives each code’s extent, which makes that last check a comparison of two boxes.

2. Context that is missing, or in the wrong place

Every geocoder needs some way to tell the part of the text that names the thing from the part that says where to look. oslew uses the last comma: everything before it is the name, everything after it is one piece of context. Other services use structured parameters, or guess from the shape of the text. Whatever the convention, breaking it produces wrong answers rather than errors.

The common breakages are the same everywhere. A second address line or a neighbourhood left between street and postcode becomes extra words that the name must match, which no address record contains, so the right address loses to a partial match elsewhere. A postcode sent in a parameter the service does not take is dropped without complaint. And the wrong kind of context helps nobody: named places such as museums or shops are rarely indexed by postcode, so a postcode narrows addresses well and places poorly.

How to spot it: a good answer echoes how it read your text. In oslew’s response, name and context show the split, and a context of the wrong piece — the country when you meant the postcode — is visible at a glance.

3. A silent fallback

When the context matches nothing — a misspelt town, a postcode the data does not hold — a geocoder has two choices: answer nothing, or search again without the context. Many choose the second, because an empty answer is unhelpful. The danger is when they do it silently. The results are then the best matches for the street name anywhere, which is rarely what someone who typed a town wanted, and nothing in a bare coordinate says so.

How to spot it: look for an explicit flag. oslew reports context_resolution, with known saying whether the context named anything the index holds and fallback: true when the results ignore it; each result’s locality component then reads missing. A fallback answer should be shown to a person or sent for review, never stored as if the context had been honoured.

4. A tie, decided for you

Some queries do not determine one place however well they are matched: a chain store’s branch name, a street name without context, a common village name. The candidates score equally, and the geocoder breaks the tie with a secondary rule — prominence, popularity, the order it stored them in — and shows the winner first. The answer is not wrong so much as arbitrary, and it looks exactly like a confident one.

A subtle version hides the tie completely. If a service counts ties only among the results it returns, asking for one result makes every query look unique.

How to spot it: a tie count taken before the result list is cut. oslew’s tied_at_top counts candidates sharing the best score across everything the search kept, so it reads the same whether you asked for one result or fifty; values of eight or more mean “at least this many”. Anything above one means the right move is to ask the person, or to add context and ask again.

5. A confidence score read as more than it is

Many geocoders return a score between zero and one, and it is tempting to treat any such number as a probability. Some of those scores are text-similarity measures: how alike the query and the matched name are. That number can be high for an answer on the wrong street, because the street name matched perfectly — it just matched the wrong street.

A calibrated confidence is a different object. It says how often answers of the same shape were right on a measured set, which makes it genuinely useful for splitting accepted rows from a review queue. It still has limits worth stating. It is an upper bound on how an answer will do in your data. It says nothing about whether a tie was broken for you — a tied answer can carry a high confidence, because each tied candidate is an exact match for the name. When too few answers of a shape were measured, oslew reports a neutral value of one half, meaning “not known” rather than “doubtful”. And confidence is about the match, not the world: it does not say the place still exists or is open.

How to spot it: read the tie count and the precision before the score, and treat the neutral value as its own case.

Three causes that are not the geocoder’s fault

  • Swapped coordinates. Some formats write latitude first, others longitude first. A pair copied from GeoJSON into a latitude-first parameter lands in another hemisphere, or is refused.
  • A repair that found another real street. Fuzzy matching rescues typos, but two edits can turn one real street name into another. A good geocoder labels a repaired match; oslew marks it fuzzy in why.mode and never reports it as an exact match.
  • Precision read as more than it is. A street-level answer plotted as a pin looks exactly like a door-level one. Geocoding precision levels explains how to read what each level locates and how far to trust it.

A checklist for a wrong answer

  1. Check how the text was split, and whether the context was the piece you meant.
  2. Check whether the context was recognised, or silently dropped.
  3. Check the tie count. Above one, ask rather than accept.
  4. Check the precision and its radius in metres against what the use needs.
  5. Check whether the match was exact or repaired.
  6. Only then read the confidence, and treat its neutral value as unmeasured.
  7. Fix the input — usually by sending the postcode — before blaming the data.

For a whole table of existing addresses, the same checks become columns, and the customer data clean-up workflow applies them row by row. The geocoding API page lists every field oslew returns.

Bottom line

A geocoder that picks the wrong street is usually answering the question it was sent, not the one that was meant. Duplicate street names, misplaced context, silent fallbacks, hidden ties and over-trusted scores account for most wrong answers, and each is detectable from the response when the response is designed to show it. Send the postcode, read the tie count before the coordinates, and treat any score as evidence to weigh rather than a verdict.

Questions

Why does my geocoder put the address on the wrong street?

Most often because the street name occurs more than once in the area the query allowed. A city is a large area, and a big city can hold many streets with the same name and the same house number. The geocoder finds a real match — just on the wrong one of those streets. Sending the postcode narrows the search to a small area before anything is ranked.

Why does the geocoder ignore the city or postcode I sent?

Either it was not read as context — it sat in the middle of the text, or in a parameter the service does not take — or it was read but matched nothing, and the geocoder fell back to searching without it. A good answer tells you which: it echoes how the text was split, and flags a fallback explicitly.

Can I trust a geocoder’s confidence score?

Only as far as its definition. A score computed from string similarity says how alike two names are, not how often the answer is right. A calibrated score says how often answers of the same shape were right on a measured set, which is useful for sorting a review queue but is still an upper bound, and it says nothing about ties or about what the position locates.

What does it mean when several geocoding results tie?

That the text you sent does not determine one place. The candidates matched equally well, and the first one shown was picked by a secondary rule such as prominence. The right response is to ask the person which they meant, or to add context and ask again — not to take the first result.

How do I make geocoding results more accurate?

Send the postcode as the address context. Measured on Mexico City held-out numbered addresses, postcode-scoped queries landed a median 19 m from the true point, against 162 m when the same addresses carried only the city. Keep the house number, and do not put anything between the street and the postcode.

Browse every page →