1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
LET NumOfDB = NoOfRows('Pv_AdressERP');
//For i = 0 to ($(NumOfDB) - 1)
For i = 0 to 100
LET vPv_ID = Peek('PV', $(i), 'Pv_AdressERP');
LET vPv_Adress1 = replace(Peek('ERP_CLIENT_ADRESSE1', $(i), 'Pv_AdressERP'),' ','+');
LET vPv_Adress2 = replace(Peek('ERP_CLIENT_ADRESSE2', $(i), 'Pv_AdressERP'),' ','+');
LET vPv_Adress3 = replace(Peek('ERP_CLIENT_ZIP', $(i), 'Pv_AdressERP'),' ','+');
// LET vGeo_Adress = 'http://maps.googleapis.com/maps/api/geocode/json?address=' & $(vPv_Adress1) & ',' & $(vPv_Adress2) & ','& $(vPv_Adress3) & ',FRANCE&sensor=false';
LET vGeo_Adress = 'http://maps.googleapis.com/maps/api/geocode/xml?address=$(vPv_Adress1),$(vPv_Adress2),$(vPv_Adress3),FRANCE&output=xml&oe=utf8&sensor=false';
// if len($(vGeo_Adress)) >0 then
TableGps:
LOAD $(vPv_ID) as PV,
status,
[result/type] as type,
[result/formatted_address] as formatted_address,
[result/partial_match] as partial_match,
[result/geometry/location_type] as location_type,
[result/geometry/bounds/northeast/lat] as [bounds/northeast/lat],
[result/geometry/bounds/northeast/lng] as [bounds/northeast/lng],
[result/geometry/bounds/southwest/lat] as [bounds/southwest/lat],
[result/geometry/bounds/southwest/lng] as [bounds/southwest/lng],
[result/geometry/viewport/northeast/lat] as [viewport/northeast/lat],
[result/geometry/viewport/northeast/lng] as [viewport/northeast/lng],
[result/geometry/viewport/southwest/lat] as [viewport/southwest/lat],
[result/geometry/viewport/southwest/lng] as [viewport/southwest/lng],
[result/geometry/location/lat] as [location/lat],
[result/geometry/location/lng] as [location/lng]
FROM
[$(vGeo_Adress)]
(XmlSimple, Table is [GeocodeResponse]);
// endif
next i |