Formatting Addresses¶
Aurinko uses a catalogue of locations to which listings are mapped. There are three levels of aggregation:
- State - a region within the country
- Place - a larger place with it’s own (one or more) zip codes
- Community - a smaller location within or close to the place
It’s important to note that no two places share a zip code.
A place can have one or more communities. Communities are either villages located close to the place, or neighbourhoods within a city. Multiple communities can share a zip code.
Every listing has the following location data:
- street - street name and house number, or just a house number for smaller places
- place - name of the place or community in which the listing is located
- zip - the zip code
It’s important to note that listing.place can either be the name of the Place or the name of the Comunnity in which the listing resides. Sometimes the place and community names can be the same.
The following examples will be demonstrated on listing and places data from MongoDB, but the same data is available in Solr.
Case: listing.place == place name¶
Consider the following listing location:
{
"street" : "Kienmayerg 5",
"place" : "Wien",
"zip" : "1140",
}
Post code 1140 belongs to Wien.
In this case listing.place contains the name of the place and the address should be displayed as:
<Street>
<Zip> <Place>
In other words:
Kienmayerg 5
1140 Wien
Case: listing.place == community name¶
Consider the following listing location:
{
"street" : "Lindeng 1",
"place" : "Velm",
"zip" : "2325",
}
Zip code 2325 belongs to a place called Himberg which has the following communities:
- Gutenhof
- Himberg
- Velm
- Pellendorf
In this case listing.place contains the name of a Community and the address should be displayed as:
<Street>
<Community>
<Zip> <Place>
In other words:
Lindeng 1
Velm
2325 Himberg
Exception: Street only contains a number¶
Sometimes, usually for smaller places, listing.street will only contain a number. For example:
{
"street" : "6",
"place" : "Piregg",
"zip" : "8190",
}
Zip code 8190 belongs to Birkfeld.
The fact that listing.street only contains a number means that Piregg is too small to have streets and only has house numbers.
In this case the address should be displayed as:
<Community> <Street>
<Zip> <Place>
In other words:
Piregg 6
8190 Birkfeld