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


Groups > comp.lang.python > #45668

Re: Static Maps from Lat Long data in XLS file

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 <ken@bscientific.org>
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&gt;': 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 <d58b4b5f-1b65-48b4-811f-fd81f1c019fe@googlegroups.com>
References <d58b4b5f-1b65-48b4-811f-fd81f1c019fe@googlegroups.com>
From Ken Bolton <ken@bscientific.net>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1924.1369144728.3114.python-list@python.org> (permalink)
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

Show key headers only | View raw


[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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web