Hi KF,
brilliant... thank you
that is exactly waht I am looking for...
Mit freundlichen Grüßen / Kind regards / Bien à vous,
Seán Courtney
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of myibmi via RPG400-L
Sent: Wednesday, 19 October 2022 15:17
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: myibmi <myibmi@xxxxxxxxxxx>
Subject: AW: GPS coordinatesBrad Stone <bvstone@xxxxxxxxx>
Hi,
Have a look to the solution of Rainer Ross:
ctl-opt dftactgrp(*no) main(main);
//------------------------------------------------------------------//
// //
// Get Google Data //
// //
//----------------- //
// R.Ross 11.2018 * //
//------------------------------------------------------------------//
// SQL-Options //
//------------------------------------------------------------------//
exec sql set option datfmt=*iso, timfmt=*iso, commit=*none,
decmpt=*period, closqlcsr=*endactgrp;
//------------------------------------------------------------------//
// Main //
//------------------------------------------------------------------//
dcl-proc main;
dcl-s LocLat packed(11:8);
dcl-s LocLon packed(11:8);
dcl-s LocURL varchar(256);
dcl-s LocAddress varchar(256);
exec sql
set :LocAddress =
systools.urlencode('Bgm.-Hollweck-Straße 6, 85599 Parsdorf',
'UTF-8');
LocURL =
'
https://maps.googleapis.com/maps/api/geocode/json?address=' +
LocAddress +
'&key=AaaaaaaaaaaaaaaaK_PYp2iSKKNVJow7Q3-MsmSvo' +
'&components=country:DE';
exec sql
Select Latitude, Longitude into :LocLat, :LocLon
from JSON_TABLE(
SYSTOOLS.HTTPGETCLOB(:LocUrl,''), '$'
Columns(
Latitude dec(11, 8) path '$.results.geometry.location.lat',
Longitude dec(11, 8) path '$.results.geometry.location.lng'
)
);
end-proc;
//------------------------------------------------------------------//
The only thing you need is a valid Google Api Key.
Hope, this fits your needs.
KF
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] Im Auftrag von Brad Stone
Gesendet: Mittwoch, 19. Oktober 2022 15:09
An: Sean Courtney
Cc: RPG programming on IBM i
Betreff: Re: GPS coordinatesBrad Stone <bvstone@xxxxxxxxx>
The Code uses GETURI (and eRPG SDK since it's a web app). If you still want me to post it, I can at fieldexit.com.
On Wed, Oct 19, 2022 at 8:05 AM Sean Courtney <scourtney@xxxxxxxxxxx> wrote:
Hi Brad,
thank you for your reply ....
I need to run this on our system so I can retrieve LAT/LON for a
subset of our customers.
It would be great if you could give me the code ..
Mit freundlichen Grüßen / Kind regards / Bien à vous,
Seán Courtney
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
Of Brad Stone
Sent: Wednesday, 19 October 2022 14:33
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: GPS coordinatesBrad Stone <bvstone@xxxxxxxxx>
I have a demo here:
https://bvstools.com/geturidemo.html
The code isn't there, but I can get it if you want. The main thing is
that the request made is there as well as the output (see the full
request in the Debug Results section). If you're using SQL all you
need really is the request.
On Wed, Oct 19, 2022 at 5:20 AM Sean Courtney <scourtney@xxxxxxxxxxx>
wrote:
Hello All,
has anybody got a more or less working example of using googles geo
API to return the geo coordinates of a given address.
Preferably using SQL but I will take anything I get…
Thanks in advance …
Mit freundlichen Grüßen / Kind regards / Bien à vous,
Seán Courtney
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post
a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.
Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.