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 errors and then geocodes to the middle of San
Francisco. No step failed, but the coordinate is not the box's location. This page explains what kind
of address this is, what other address shapes behave the same way, and what a geocoder should return
for them.
The analog
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. is a shelf behind a counter. The postal service brings the item to the shelf and stops, and the recipient comes to collect it. That is a complete delivery, and the address that describes it is a complete address.
The address does not say where the recipient is. The person renting the box can live twenty miles away, in a different town or county, and that separation can be the reason for renting one. A box is a delivery point deliberately separated from a location. A query for its location always returns the post office, the same answer as for every other box at that office.
The family
Several address shapes share that property, so treat 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 whatever 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. The office holds mail for a recipient who has no box and no fixed address there, and the recipient collects it in person. The address contains only an office and a person.
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 alternatively # 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 looks the same as a suite in an office building, and it geocodes to a storefront that is a real
place but the wrong one.
Rural route boxes, where the address gives a route and a box along it instead of 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 identifies an entry point into a military postal network instead of 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-hint → 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. is labeled as one. 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. then 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. instead of 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 a 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. would not be useful, because every box at an office would share one coordinate. A geocode of a box address therefore resolves the other parts of the string (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 postcode (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 used. Handle PO boxes and other edge kinds has the transcripts and the regional forms, and it covers 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 postcode (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one. and landmark queries the same way.
What it costs
Plan for three consequences.
A coordinate for a box address is the town's coordinate. It is the most the string can support, but it is unusable for routing a driver. Check the resolution tier instead of trusting the coordinate.
The parser identifies the shape of an address. It cannot tell you whether the address is real. 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. Only a postal authority's address file can confirm deliverability. Validate an address before you use it explains where 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. stops and deliverability checks begin.
A person can also have several of these addresses 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, and a mail drop for a business, with no component shared between them. Record matching on address text only treats them as three people. Resolved-component matching with an explicit rule for box addresses avoids that (Match messy records).
Related
- What an address is — the delivery point idea these addresses take to its conclusion.
- Two addresses, one building — the same person, several addresses, from the other direction.
- Global address conventions — where box collection is the primary mode rather than an alternative.
- Handle PO boxes and other edge kinds — the measured behavior, with transcripts.