include google maps in context document
Dear Sirs I need to justify my displacements from my school to the various companies where I have students in training. For this I must include in my report a gloogle maps image with the path and the distance covered. In the browse o found all the information that I need. For example, with an url address like: http://maps.googleapis.com/maps/api/distancematrix/json?origins=Seattle&destinations=San+Francisco&mode=driving&sensor=false i get a json response, but not the google map image. If I try an address like this " https://www.google.pt/maps/dir/Chaves/Valpaços/" I found all information in the browser, but I need to include it in my context document report. Anybody know a simply way to make this work or this is a too hard task for now. Have a good night Thanks in advance Jorge
Hi, On 3 May 2017 at 23:12, DesdeChaves wrote:
Dear Sirs
I need to justify my displacements from my school to the various companies where I have students in training. For this I must include in my report a gloogle maps image with the path and the distance covered.
In the browse o found all the information that I need. For example, with an url address like:
i get a json response, but not the google map image.
If I try an address like this "https://www.google.pt/maps/dir/Chaves/Valpaços/" I found all information in the browser, but I need to include it in my context document report.
Anybody know a simply way to make this work or this is a too hard task for now.
This is not really a ConTeXt-related question, but ConTeXt can include any image you can feed to it, and potentially fetch images from URL on the fly. So you first need to figure out how to get the image you want. See: https://developers.google.com/maps/documentation/static-maps/intro You first need your own API_KEY. If you have problems with the interface, ask on stackexchange or elsewhere. If you have problems with making as automatic workflow as possible (once you know how to get your PNGs exactly), you may ask here. But have the rest of the details ready. ConTeXt supports "natively" drawing OpenStreet Maps, but I doubt it would work in your case. Mojca
Thanks for your support.
Can you provide me a example (or a link) for use OpenStreet Maps in context?
Perhaps I can track my displacements with my phone and superimpose those
tracks with the OpenStreet Maps.
Jorge
2017-05-04 11:26 GMT+01:00 Mojca Miklavec
Hi,
On 3 May 2017 at 23:12, DesdeChaves wrote:
Dear Sirs
I need to justify my displacements from my school to the various companies where I have students in training. For this I must include in my report a gloogle maps image with the path and the distance covered.
In the browse o found all the information that I need. For example, with an url address like:
http://maps.googleapis.com/maps/api/distancematrix/json? origins=Seattle&destinations=San+Francisco&mode=driving&sensor=false
i get a json response, but not the google map image.
If I try an address like this "https://www.google.pt/maps/dir/Chaves/Valpaços/" I found all information in the browser, but I need to include it in my context document report.
Anybody know a simply way to make this work or this is a too hard task for now.
This is not really a ConTeXt-related question, but ConTeXt can include any image you can feed to it, and potentially fetch images from URL on the fly. So you first need to figure out how to get the image you want.
See: https://developers.google.com/maps/documentation/static-maps/intro
You first need your own API_KEY.
If you have problems with the interface, ask on stackexchange or elsewhere. If you have problems with making as automatic workflow as possible (once you know how to get your PNGs exactly), you may ask here. But have the rest of the details ready.
ConTeXt supports "natively" drawing OpenStreet Maps, but I doubt it would work in your case.
Mojca ____________________________________________________________ _______________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/ listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________ _______________________
-- Atentamente DesdeChaves
On 4 May 2017 at 13:30, DesdeChaves wrote:
Can you provide me a example (or a link) for use OpenStreet Maps in context?
Perhaps I can track my displacements with my phone and superimpose those tracks with the OpenStreet Maps.
See the attachment (you need to extract the osm file before running context). Mojca
Am 2017-05-04 um 13:46 schrieb Mojca Miklavec
On 4 May 2017 at 13:30, DesdeChaves wrote:
Can you provide me a example (or a link) for use OpenStreet Maps in context?
Perhaps I can track my displacements with my phone and superimpose those tracks with the OpenStreet Maps.
See the attachment (you need to extract the osm file before running context).
Wow, that looks like something I need, thank you so much! Why didn’t anyone publish this as a module or on the wiki? Greetlings, Hraban --- http://www.fiee.net http://wiki.contextgarden.net GPG Key ID 1C9B22FD
On 4 May 2017 at 15:59, Henning Hraban Ramm wrote:
Am 2017-05-04 um 13:46 schrieb Mojca Miklavec:
On 4 May 2017 at 13:30, DesdeChaves wrote:
Can you provide me a example (or a link) for use OpenStreet Maps in context?
Perhaps I can track my displacements with my phone and superimpose those tracks with the OpenStreet Maps.
See the attachment (you need to extract the osm file before running context).
Wow, that looks like something I need, thank you so much! Why didn’t anyone publish this as a module or on the wiki?
Blame me :( Hans wrote most of the code and told me to document it. Mojca
Thanks to all for your support.
For now I use Latex for making the images (thanks to Ulrike and Mojca),
but my heart is on OpenStreet Maps + luatex + Metapost solution (thanks to
Hans et al). Perhaps soon anybody can play with it. For now it lacks a
labels level and it's to hard add particular gps tracks.
Thank you very much to all.
Jorge
2017-05-04 15:55 GMT+01:00 Mojca Miklavec
Am 2017-05-04 um 13:46 schrieb Mojca Miklavec:
On 4 May 2017 at 13:30, DesdeChaves wrote:
Can you provide me a example (or a link) for use OpenStreet Maps in
context?
Perhaps I can track my displacements with my phone and superimpose
On 4 May 2017 at 15:59, Henning Hraban Ramm wrote: those
tracks with the OpenStreet Maps.
See the attachment (you need to extract the osm file before running context).
Wow, that looks like something I need, thank you so much! Why didn’t anyone publish this as a module or on the wiki?
Blame me :(
Hans wrote most of the code and told me to document it.
Mojca ____________________________________________________________ _______________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/ listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ____________________________________________________________ _______________________
-- Atentamente DesdeChaves
Am Wed, 3 May 2017 22:12:54 +0100 schrieb DesdeChaves:
For this I must include in my report a gloogle maps image with the path and the distance covered.
[...]
Anybody know a simply way to make this work or this is a too hard task for now.
There is a LaTeX-Package called getmap. http://www.ctan.org/pkg/getmap It's documentation contains also some remark about how to get routing. Perhaps you find something useful in it. -- Ulrike Fischer http://www.troubleshooting-tex.de/
On 4 May 2017 at 15:20, Ulrike Fischer
Am Wed, 3 May 2017 22:12:54 +0100 schrieb DesdeChaves:
For this I must include in my report a gloogle maps image with the path and the distance covered.
[...]
Anybody know a simply way to make this work or this is a too hard task for now.
There is a LaTeX-Package called getmap. http://www.ctan.org/pkg/getmap It's documentation contains also some remark about how to get routing. Perhaps you find something useful in it.
Thank you. This looks like something worth porting to ConTeXt :) Even if implemented from scratch, the package could be used to borrow the hacks. The syntax is pretty clean (and already relatively "ConTeXt"-ish): \getmap[file=berlin, mode=gm, language=de, scale=2, 8 xsize=400, ysize=600,...] To Jorge: I would probably use LaTeX to fetch the maps and then include the images into ConTeXt as the first workaround if you need the maps in a ConTeXt document and need a fast solution. Mojca
On Thu, 4 May 2017, Mojca Miklavec wrote:
On 4 May 2017 at 15:20, Ulrike Fischer
wrote: Am Wed, 3 May 2017 22:12:54 +0100 schrieb DesdeChaves:
For this I must include in my report a gloogle maps image with the path and the distance covered.
[...]
Anybody know a simply way to make this work or this is a too hard task for now.
There is a LaTeX-Package called getmap. http://www.ctan.org/pkg/getmap It's documentation contains also some remark about how to get routing. Perhaps you find something useful in it.
Thank you.
This looks like something worth porting to ConTeXt :) Even if implemented from scratch, the package could be used to borrow the hacks. The syntax is pretty clean (and already relatively "ConTeXt"-ish):
\getmap[file=berlin, mode=gm, language=de, scale=2, 8 xsize=400, ysize=600,...]
All the heavy lifing is done by a lua-script; the sty file is simply calling the lua script with appropriate arguments. So, it should be relatively straightforward to create a wrapper around the script using t-filter. Of course, ideally, since the code is written in lua, there is no need to call the external script. However, some refactoring needs to be done if the script is to used directly from the tex side (the parsing of arguments needs to be separated from actual call to the openmap api). Aditya
participants (5)
-
Aditya Mahajan
-
DesdeChaves
-
Henning Hraban Ramm
-
Mojca Miklavec
-
Ulrike Fischer