ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* include google maps in context document
@ 2017-05-03 21:12 DesdeChaves
  2017-05-04 10:26 ` Mojca Miklavec
  2017-05-04 13:20 ` Ulrike Fischer
  0 siblings, 2 replies; 10+ messages in thread
From: DesdeChaves @ 2017-05-03 21:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 824 bytes --]

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

[-- Attachment #1.2: Type: text/html, Size: 1293 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-03 21:12 include google maps in context document DesdeChaves
@ 2017-05-04 10:26 ` Mojca Miklavec
  2017-05-04 11:30   ` DesdeChaves
  2017-05-04 13:20 ` Ulrike Fischer
  1 sibling, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2017-05-04 10:26 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 10:26 ` Mojca Miklavec
@ 2017-05-04 11:30   ` DesdeChaves
  2017-05-04 11:46     ` Mojca Miklavec
  0 siblings, 1 reply; 10+ messages in thread
From: DesdeChaves @ 2017-05-04 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2521 bytes --]

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 <mojca.miklavec.lists@gmail.com>:

> 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

[-- Attachment #1.2: Type: text/html, Size: 4056 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 11:30   ` DesdeChaves
@ 2017-05-04 11:46     ` Mojca Miklavec
  2017-05-04 13:59       ` Henning Hraban Ramm
  0 siblings, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2017-05-04 11:46 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 322 bytes --]

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

[-- Attachment #2: bachotex.tex --]
[-- Type: application/x-tex, Size: 7161 bytes --]

[-- Attachment #3: bachotex.osm.gz --]
[-- Type: application/x-gzip, Size: 15499 bytes --]

[-- Attachment #4: bachotex.pdf --]
[-- Type: application/pdf, Size: 20435 bytes --]

[-- Attachment #5: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-03 21:12 include google maps in context document DesdeChaves
  2017-05-04 10:26 ` Mojca Miklavec
@ 2017-05-04 13:20 ` Ulrike Fischer
  2017-05-04 14:48   ` Mojca Miklavec
  1 sibling, 1 reply; 10+ messages in thread
From: Ulrike Fischer @ 2017-05-04 13:20 UTC (permalink / raw)
  To: ntg-context

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/

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 11:46     ` Mojca Miklavec
@ 2017-05-04 13:59       ` Henning Hraban Ramm
  2017-05-04 14:55         ` Mojca Miklavec
  0 siblings, 1 reply; 10+ messages in thread
From: Henning Hraban Ramm @ 2017-05-04 13:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2017-05-04 um 13:46 schrieb Mojca Miklavec <mojca.miklavec.lists@gmail.com>:

> 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

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 13:20 ` Ulrike Fischer
@ 2017-05-04 14:48   ` Mojca Miklavec
  2017-05-05 19:50     ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2017-05-04 14:48 UTC (permalink / raw)
  To: Ulrike Fischer, mailing list for ConTeXt users

On 4 May 2017 at 15:20, Ulrike Fischer <news3@nililand.de> 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,...]

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 13:59       ` Henning Hraban Ramm
@ 2017-05-04 14:55         ` Mojca Miklavec
  2017-05-04 18:07           ` DesdeChaves
  0 siblings, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2017-05-04 14:55 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 14:55         ` Mojca Miklavec
@ 2017-05-04 18:07           ` DesdeChaves
  0 siblings, 0 replies; 10+ messages in thread
From: DesdeChaves @ 2017-05-04 18:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1713 bytes --]

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 <mojca.miklavec.lists@gmail.com>:

> 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
> ____________________________________________________________
> _______________________
> 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

[-- Attachment #1.2: Type: text/html, Size: 3002 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: include google maps in context document
  2017-05-04 14:48   ` Mojca Miklavec
@ 2017-05-05 19:50     ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2017-05-05 19:50 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 4 May 2017, Mojca Miklavec wrote:

> On 4 May 2017 at 15:20, Ulrike Fischer <news3@nililand.de> 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
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-05-05 19:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 21:12 include google maps in context document DesdeChaves
2017-05-04 10:26 ` Mojca Miklavec
2017-05-04 11:30   ` DesdeChaves
2017-05-04 11:46     ` Mojca Miklavec
2017-05-04 13:59       ` Henning Hraban Ramm
2017-05-04 14:55         ` Mojca Miklavec
2017-05-04 18:07           ` DesdeChaves
2017-05-04 13:20 ` Ulrike Fischer
2017-05-04 14:48   ` Mojca Miklavec
2017-05-05 19:50     ` Aditya Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).