Skip to main content

PO boxes and other non-street addresses

The question

PO Box 1234, San Francisco, CA 94119 parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. without complaint and then geocodes to the middle of San Francisco. Nothing failed, and the answer is not the box. What class of address is this, which other shapes belong to it, and what is the right thing for a geocoder to return?

The analog

A box is a shelf behind a counter. The postal service carries the item to the shelf and stops; the recipient comes and collects it. That is a complete delivery, and the address that describes it is a complete address.

What it is not is a description of where the recipient is. The person renting the box can live twenty miles away, in a different town, in a different county — which is the point of renting one. A box is a delivery point deliberately decoupled from a location, and asking where it is returns the post office every time, along with every other box at that office.

The family

Several address shapes share that property, and it is worth recognizing them as one class.

Post office boxesPO boxA numbered mailbox at a post office used as a delivery address instead of a physical street location. Mailwoman tags it as the po_box component; structurally the same family as a subpremise., under whichever name the local service uses: BP in France, Apartado in Spain, GPO Box and Locked Bag in Australia. The leader word and the number belong together and the whole phrase sits beside the town, never inside a streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels..

General delivery, called poste restante outside the US: mail held at a named office for a recipient with no box and no fixed address there, collected in person at that office. The address names an office and a person, and nothing else.

Private mailboxes at a commercial mail receiving agency. These look like streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. addresses because they are streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. addresses — the agency's. The US Postal Service requires the box to be marked, with PMB and a number or the alternative # and a number, on its own line or appended to the streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. line (Domestic Mail Manual 508). Without that marking, a mail drop is indistinguishable from a suite in an office building, and it will geocode to a storefront that is a real place and the wrong one.

Rural route boxes, where the address names a route and a box along it rather than a streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. and a number.

Military addresses routed through APOAPO/FPO (Army Post Office / Fleet Post Office). US military postal addresses for personnel stationed overseas or aboard ship. They route through military postal hubs rather than geographic locations, so they break geographic parsing assumptions. and FPOAPO/FPO (Army Post Office / Fleet Post Office). US military postal addresses for personnel stationed overseas or aboard ship. They route through military postal hubs rather than geographic locations, so they break geographic parsing assumptions. channels, where the code names an entry point into a military postal network rather than a location on the ground.

What Mailwoman does with them

The pipelinestaged pipelineMailwoman's runtime architecture: a sequence of pure-function stages (normalize → query-shape → locale-gate → kind-classifier → phrase-grouper → classifier → decoder) connected by typed handoffs. Each stage is published as its own npm package. recognizes this class in two places. The kind classifierkind classifierStage 2.5 of the runtime pipeline: categorizes the input into one of eight query kinds (structured_address, postcode_only, locality_only, intersection, po_box, landmark, poi_query, vague) so the coordinator can route to the right parsing strategy. reports the input's shape before the modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' runs, so a PO boxPO boxA numbered mailbox at a post office used as a delivery address instead of a physical street location. Mailwoman tags it as the po_box component; structurally the same family as a subpremise. arrives labeled as one, and the parseaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. assigns the whole phrase to a single po_box component that sits beside the localitylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighborhood in the hierarchy. rather than under the streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels..

There is no box resolverresolverThe component that converts parsed address components (locality, region, postcode) into coordinates by looking them up in the gazetteer. The resolver ranks candidates by name match, population, and proximity, and returns the best-matching place with its centroid or polygon., and there could not be a useful one, since every box at an office would share a coordinate. So a geocode of a box address resolves whatever else the string contains — the town, the regionregionThe first-level administrative subdivision of a country — a US state, a French region, a province. The component between country and locality., the postcodepostcodeThe country-specific postal code (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one. — and reports the administrative tier it answered from. Handle PO boxes and other edge kinds has the transcripts, the regional forms it covers, and the same treatment for intersectionsintersectionAn address that names a location by two crossing streets ('5th & Main') rather than a number and street. Mailwoman tags the two streets as intersection_a and intersection_b — a negative-space format that starved the early model., bare postcodespostcodeThe country-specific postal code (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one. and landmark queries.

What it costs

Three things to plan for.

A coordinate for a box address is a coordinate for the town. It is the correct answer to the question the string can support, and it is unusable for routing a driver. Read the resolution tier rather than the coordinate.

Parsingaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. tells you the shape and not the truth of it. A well-formed box address parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. whether or not the box is rented, and a private mailbox marked as a suite parsesaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. as a suite. Deliverability is a question for a postal authority's address file (Validate an address before you use it draws the line).

And a person can hold several of these at once — a streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. address where they live, a box where they receive mail, a mail drop for a business — with no component in common between them. Record matchingrecord matchingThe process of determining whether two database records refer to the same real-world entity. Mailwoman's matcher uses a geocode-first approach (match the resolved place, not the address string) with Fellegi-Sunter probabilistic scoring. on address text alone will treat them as three people. Matching on resolved components with a deliberate rule for box addresses will not (Match messy records).