Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #45665 > unrolled thread

Static Maps from Lat Long data in XLS file

Started bykobewka@gmail.com
First post2013-05-21 06:12 -0700
Last post2013-05-22 04:21 -0700
Articles 5 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  Static Maps from Lat Long data in XLS file kobewka@gmail.com - 2013-05-21 06:12 -0700
    Re: Static Maps from Lat Long data in XLS file Ken Bolton <ken@bscientific.net> - 2013-05-21 09:58 -0400
      Re: Static Maps from Lat Long data in XLS file kobewka@gmail.com - 2013-05-22 04:21 -0700
    Re: Static Maps from Lat Long data in XLS file Tim Daneliuk <tundra@tundraware.com> - 2013-05-21 10:27 -0500
      Re: Static Maps from Lat Long data in XLS file kobewka@gmail.com - 2013-05-22 04:21 -0700

#45665 — Static Maps from Lat Long data in XLS file

Fromkobewka@gmail.com
Date2013-05-21 06:12 -0700
SubjectStatic Maps from Lat Long data in XLS file
Message-ID<d58b4b5f-1b65-48b4-811f-fd81f1c019fe@googlegroups.com>
Hello,

I'm new to Python, but I think it can solve my problem and I am looking for a someone to point me to tutorial or give me some tips here.

I have an xls file that has about 1,000 latitude and longitude points. I want to do one of two things: 1) Save a static maps and street view image from the coordinates, or 2) create an html file with the map and street view image side by side.

I need the urls to look like this: 

Map with a pin in the centre:
http://maps.googleapis.com/maps/api/staticmap?center=43.65162,-79.40571&zoom=16&size=600x600&markers=color:blue%7Clabel:S%7C43.65162,-79.40571&sensor=false

Image:
http://maps.googleapis.com/maps/api/streetview?location=43.65162,%20-79.40571&size=600x600&sensor=false

I am not sure if option 1 will work because the url doesn't actually lead to an image, but rather Google returns an image when that url is used. 

Any tips or pointers are much appreciated!

[toc] | [next] | [standalone]


#45668

FromKen Bolton <ken@bscientific.net>
Date2013-05-21 09:58 -0400
Message-ID<mailman.1924.1369144728.3114.python-list@python.org>
In reply to#45665

[Multipart message — attachments visible in raw view] — view raw

On Tue, May 21, 2013 at 9:12 AM, <kobewka@gmail.com> wrote:

> Hello,
>
> I'm new to Python, but I think it can solve my problem and I am looking
> for a someone to point me to tutorial or give me some tips here.
>

Hi! I am a first-time poster to python-list, but I think I can help you.


> I have an xls file that has about 1,000 latitude and longitude points. I
> want to do one of two things: 1) Save a static maps and street view image
> from the coordinates, or 2) create an html file with the map and street
> view image side by side.


If you save your xls file as a csv (comma-separated values), you can use
python's built-in csv module, documented here -
http://docs.python.org/2/library/csv.html, to read the file line by line.
Store the values and substitute the strings into a new list of URLs.


> I need the urls to look like this:
>
> Map with a pin in the centre:
>
> http://maps.googleapis.com/maps/api/staticmap?center=43.65162,-79.40571&zoom=16&size=600x600&markers=color:blue%7Clabel:S%7C43.65162,-79.40571&sensor=false
>
> Image:
>
> http://maps.googleapis.com/maps/api/streetview?location=43.65162,%20-79.40571&size=600x600&sensor=false


I was able to use curl to grab the images you linked. I believe you can use
urllib (or, better, requests - http://docs.python-requests.org/en/latest/)
to get and save the images.

hth.

best,
ken

[toc] | [prev] | [next] | [standalone]


#45721

Fromkobewka@gmail.com
Date2013-05-22 04:21 -0700
Message-ID<a1c3e3d8-4b88-4669-a8a8-e335fbfc5b5c@googlegroups.com>
In reply to#45668
Thanks Ken. I'll have a closer look at those links. I also found Motionless, which creates a static map HTML file. Combined with what you said, I should be able to get what I need.

https://github.com/ryancox/motionless

Scott



On Tuesday, May 21, 2013 9:58:25 AM UTC-4, Ken Bolton wrote:
> On Tue, May 21, 2013 at 9:12 AM,  <kob...@gmail.com> wrote:
> 
> 
> Hello,
> 
> 
> 
> I'm new to Python, but I think it can solve my problem and I am looking for a someone to point me to tutorial or give me some tips here.
> 
>  
> Hi! I am a first-time poster to python-list, but I think I can help you.
> 
> 
>  
> I have an xls file that has about 1,000 latitude and longitude points. I want to do one of two things: 1) Save a static maps and street view image from the coordinates, or 2) create an html file with the map and street view image side by side.
> 
> 
> 
> 
> If you save your xls file as a csv (comma-separated values), you can use python's built-in csv module, documented here - http://docs.python.org/2/library/csv.html, to read the file line by line. Store the values and substitute the strings into a new list of URLs.
> 
> 
>  
> I need the urls to look like this:
> 
> 
> 
> Map with a pin in the centre:
> 
> http://maps.googleapis.com/maps/api/staticmap?center=43.65162,-79.40571&zoom=16&size=600x600&markers=color:blue%7Clabel:S%7C43.65162,-79.40571&sensor=false
> 
> 
> 
> 
> 
> Image:
> 
> http://maps.googleapis.com/maps/api/streetview?location=43.65162,%20-79.40571&size=600x600&sensor=false
> 
> 
> 
> 
> I was able to use curl to grab the images you linked. I believe you can use urllib (or, better, requests - http://docs.python-requests.org/en/latest/) to get and save the images.
> 
> 
> 
> 
> hth.
> 
> 
> best,
> ken

[toc] | [prev] | [next] | [standalone]


#45672

FromTim Daneliuk <tundra@tundraware.com>
Date2013-05-21 10:27 -0500
Message-ID<ccgs6a-1eo.ln1@ozzie.tundraware.com>
In reply to#45665
On 05/21/2013 08:12 AM, kobewka@gmail.com wrote:
> Hello,
>
> I'm new to Python, but I think it can solve my problem and I am looking for a someone to point me to tutorial or give me some tips here.
>
> I have an xls file that has about 1,000 latitude and longitude points. I want to do one of two things: 1) Save a static maps and street view image from the coordinates, or 2) create an html file with the map and street view image side by side.
>
> I need the urls to look like this:
>
> Map with a pin in the centre:
> http://maps.googleapis.com/maps/api/staticmap?center=43.65162,-79.40571&zoom=16&size=600x600&markers=color:blue%7Clabel:S%7C43.65162,-79.40571&sensor=false
>
> Image:
> http://maps.googleapis.com/maps/api/streetview?location=43.65162,%20-79.40571&size=600x600&sensor=false
>
> I am not sure if option 1 will work because the url doesn't actually lead to an image, but rather Google returns an image when that url is used.
>
> Any tips or pointers are much appreciated!
>


https://pypi.python.org/pypi/xlrd



-- 
-----------------------------------------------------------------------
Tim Daneliuk

[toc] | [prev] | [next] | [standalone]


#45722

Fromkobewka@gmail.com
Date2013-05-22 04:21 -0700
Message-ID<9dbdf222-8a2f-4edc-b9c9-7c1d7e8f4ddf@googlegroups.com>
In reply to#45672
On Tuesday, May 21, 2013 11:27:42 AM UTC-4, Tim Daneliuk wrote:
> On 05/21/2013 08:12 AM, @gmail.com wrote:
> 
> > Hello,
> 
> >
> 
> > I'm new to Python, but I think it can solve my problem and I am looking for a someone to point me to tutorial or give me some tips here.
> 
> >
> 
> > I have an xls file that has about 1,000 latitude and longitude points. I want to do one of two things: 1) Save a static maps and street view image from the coordinates, or 2) create an html file with the map and street view image side by side.
> 
> >
> 
> > I need the urls to look like this:
> 
> >
> 
> > Map with a pin in the centre:
> 
> > http://maps.googleapis.com/maps/api/staticmap?center=43.65162,-79.40571&zoom=16&size=600x600&markers=color:blue%7Clabel:S%7C43.65162,-79.40571&sensor=false
> 
> >
> 
> > Image:
> 
> > http://maps.googleapis.com/maps/api/streetview?location=43.65162,%20-79.40571&size=600x600&sensor=false
> 
> >
> 
> > I am not sure if option 1 will work because the url doesn't actually lead to an image, but rather Google returns an image when that url is used.
> 
> >
> 
> > Any tips or pointers are much appreciated!
> 
> >
> 
> 
> 
> 
> 
> https://pypi.python.org/pypi/xlrd
> 
> 
> 
> 
> 
> 
> 
> -- 
> 
> -----------------------------------------------------------------------
> 
> Tim Daneliuk

Thanks Tim.

Scott

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web