Due to privacy concerns you might not want to show a precisely geocoded location
Privacy first! In many cases you might not want to show a precisely geocoded location. As a very basic example: imagine you're building an app that lets people share photos. You might want to show the neighbourhood and city a user of the app is in, but probably not the precise house address.
If you send coordinates (for example the location of the user's phone, or
the coordinates you extracted from the photo) to the OpenCage geocoding
API, by default we will reverse geocode those coordinates to as precise
a location as possible, for example a building address.
We then format that address correctly for that country and put the result
value of the API result.
So what can you do if you don't want to show that exact address?
Creating your own privacy respecting formatted string
The solution is you need to create your own location string to display
from the hierarchy pieces we return in the
part of the response. As a first step, please read the brief
section about components in the API reference.
As an example, for the coordinates
we return a
Jablonskistraße 29, 10405 Berlin, Germany
but with the logic below you would instead show
Winsviertel, Prenzlauer Berg, Berlin, Germany
which is correct but not precise.