TMSFNCGeocoding Reverse Geocoding

Using a TTMSFNCGeocoding component accessing Google's services, the address fields of a reverse geocoding lookup gives strange results. For example, if I call GetReverseGeocoding with a parameter of "47 Cleveland Ave.,Trenton,NJ", retrieving the result in the GerReverseGeocodingResult method has a couple of fields filled in with either incorrect or questionable responses.

The street field reads "Cleveland Avenue 47". The house number is appended at the end of the street name. I checked the source, and the code filling the street field is: di.Street := streetname + ' ' + streetno; so this is by design. I can't figure out why.

The postal code field reads "1601", which is the +4 part of the full postal code for this address, which is 08609-1601. The code appears to follow the Google API, so this might be a Google issue. Here is the code filling in the PostalCode field: if Pos('postal_code', atype) > 0 then di.PostalCode := longname;

Has anyone else had trouble building an address from the AResult response in GetReverseGeocodingResult method?


The decision to combine the street name and street number in a single field was made because some geocoding services only provide "street + number" as a single field.
In case of Google's geocoding service this is indeed provided as 2 fields combined in a single property.
We'll consider adding two extra properties "StreetName" & "StreetNumber" for cases where this is needed.

We are not aware of any issues for addresses returned from Google and neither do we have control over which data is returned by Google or other geocoding services.
You might want to try one of the other supported geocoding services to find out if they produce better results in this case.