Ah ya veo cual es el problema, es que el metodo
TJSONValue.GetValue utiliza tipos genericos y yo publique el codigo usando el resaltador de sintaxis de Delphi, al cual no le gustan los genericos
Ahora si
Código PHP:
var
json, geometry, location: TJSONObject;
results: TJSONArray;
lat, lng: TJSONNumber;
begin
json := TJSONObject.ParseJSONValue(TFile.ReadAllText(JsonFile)) as TJSONObject;
try
results := json.Values['results'] as TJSONArray;
geometry := results.Items[0].GetValue<TJSONObject>('geometry');
location := geometry.Values['location'] as TJSONObject;
lat := location.Values['lat'] as TJSONNumber;
lng := location.Values['lng'] as TJSONNumber;
Writeln(lat.ToString);
Writeln(lng.ToString);
finally
json.Free;
end;