Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.012 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python,': 0.02; 'tutorial': 0.03; 'static': 0.04; '21,': 0.07; 'subject:file': 0.07; 'subject:Long': 0.09; 'url:location': 0.09; 'cc:addr:python- list': 0.11; '1,000': 0.16; 'csv': 0.16; 'python-list,': 0.16; 'side.': 0.16; 'subject:XLS': 0.16; 'substitute': 0.16; 'urllib': 0.16; 'values),': 0.16; 'url:)': 0.16; 'wrote:': 0.18; "python's": 0.19; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'documented': 0.24; 'module,': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'this:': 0.26; 'url:maps': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'point': 0.28; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'requests': 0.31; 'file': 0.32; 'url:python': 0.33; 'subject:from': 0.34; 'problem': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:data': 0.36; 'url:org': 0.36; 'two': 0.37; 'list': 0.37; 'url:library': 0.38; 'read': 0.60; 'solve': 0.60; 'tips': 0.61; 'url:%20': 0.61; 'new': 0.61; 'you.': 0.62; 'save': 0.62; 'grab': 0.64; 'map': 0.64; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'side': 0.67; 'believe': 0.68; 'url:%1': 0.72; 'curl': 0.84; 'latitude': 0.84; 'longitude': 0.84; 'url:latest': 0.91; 'url:16': 0.93; '2013': 0.98 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=0jKI28dqAZC5QWEXtZedaQt5QuxW6HcOMkBiysIw8NA=; b=m4SA7fFprbPpwxph0gH19x4aPo8++txp6RcbUAp6JFmcdDy+GErTl3KYUE2IzoqC+w pNNvVzJzDT8b1Q4uLxcuc94b8SN+rKsGsU1gZ5Bbq4FrrufHJhS/5chq/esY9qrSMQO0 UI0dCbi3UoH/e9PCFVsH21k8dOapivAkqwAqVavBbPWHVe4so5H1YUuyq7Gj2PAI6Wvo jp9wKa734c8f3KyiMAquOcjC03qWDucIqlGbzMBsmbrgg8P4+hE391vpl0I2Kl2Txukt ZMSZEqusTOFbCCBzgWx+lECEvjflA1Jh4tNYr/wf4IVkoHc/SDijpr8gBEEqkIOct1oJ ffmA== X-Received: by 10.66.102.97 with SMTP id fn1mr3374305pab.116.1369144725325; Tue, 21 May 2013 06:58:45 -0700 (PDT) MIME-Version: 1.0 Sender: ken@bscientific.org In-Reply-To: References: From: Ken Bolton Date: Tue, 21 May 2013 09:58:25 -0400 X-Google-Sender-Auth: 6j97HbE-ExKLlf4_yPkdZQEFEfQ Subject: Re: Static Maps from Lat Long data in XLS file To: kobewka@gmail.com Content-Type: multipart/alternative; boundary=047d7bd90c6cffd90c04dd3ad8c1 X-Gm-Message-State: ALoCoQnSJe0MgMiLh6jlrL6yGsQd5E5zL4Merrq4fBvXvaqpkE+AtdSJ/EK/Z6t7EvSiUshOhXiW Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 108 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1369144728 news.xs4all.nl 15911 [2001:888:2000:d::a6]:45601 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:45668 --047d7bd90c6cffd90c04dd3ad8c1 Content-Type: text/plain; charset=UTF-8 On Tue, May 21, 2013 at 9:12 AM, 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 --047d7bd90c6cffd90c04dd3ad8c1 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= 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.
=C2=A0
Hi! I am a first-time poster to python-list, b= ut I think I can help you.
=C2=A0
I have an xls file that has about 1,000 latitude and longitude points. I wa= nt to do one of two things: 1) Save a static maps and street view image fro= m the coordinates, or 2) create an html file with the map and street view i= mage side by side.

If you save your xls file as a csv (comma-separat= ed values), you can use python's built-in csv module, documented here -= http://docs.python.o= rg/2/library/csv.html, to read the file line by line. Store the values = and substitute the strings into a new list of URLs.
=C2=A0
I need the urls to look like this:

Map with a pin in the centre:
http://maps.g= oogleapis.com/maps/api/staticmap?center=3D43.65162,-79.40571&zoom=3D16&= amp;size=3D600x600&markers=3Dcolor:blue%7Clabel:S%7C43.65162,-79.40571&= amp;sensor=3Dfalse

Image:
ht= tp://maps.googleapis.com/maps/api/streetview?location=3D43.65162,%20-79.405= 71&size=3D600x600&sensor=3Dfalse

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

hth.

b= est,
ken
--047d7bd90c6cffd90c04dd3ad8c1--