The information needed in a Location structure includes any information that allows us to send regular postal mail. Thus, we need to include fields such as street address, city, state or province, and so forth. This structure also includes geospatial data such as latitude and longitude, allowing us to perform geospatial inquiries to better gauge property distances.
Some addresses, however, also contain a state, province, and other identifiers. The postcode format varies widely from country to country. Other variations exist as well. In the UK, for example, it is not uncommon for the address to include a building name. If a building has apartments, condos, or flats, the floor number and flat number are needed as well. Â
With all this in mind, here is our first attempt at a JSON Location structure:
Location = {
"streetAddress" : <number and name of street>,
"buildingName" : <name of building>,
"...