Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Google Static Maps in IDL
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  11 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Fanning  
View profile  
 More options Jul 11 2012, 11:38 am
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Wed, 11 Jul 2012 09:38:42 -0600
Local: Wed, Jul 11 2012 11:38 am
Subject: Google Static Maps in IDL
Folks,

As long as I am talking about updating your Coyote Library
distribution this morning, let me give you another reason
to do so.

I have built a pretty nifty MABEL lidar browser recently
that you can download from an SVN repository if you are
interested in this new photon counting lidar data.
Complete directions are available in the Wiki you will
find on the MABEL project page.

   http://sourceforge.net/projects/mabelidl/

In addition to the zooming/panning capability that I
built into cgZPlot, I wanted the user to be able to
see the lidar track on a map. If the map showed the
topography of the location that would be a HUGE plus
for me. And, of course, I wanted to be able to annotate
the map with features that were pertinent to the lidar
flight.

To this end, I built a small object that exposes quite
a bit of the Google Static Map API:

   https://developers.google.com/maps/documentation/staticmaps/

Static maps are actually images that come back from Google.
You can't interact with them in the same way you can with
a Google map in a web browser. There are definite limitations.
For example the image that returns can be no larger than
640x640 pixels. But, you can set the zoom level and the
type of map you want: terrain, satellite, roadmap, or hybrid.
You can also add Google markers to the map.

Displaying the image is straightforward, of course. The tricky
part was figuring out how to set up the map coordinates to be
able to navigate the map and annotate it myself. (The images
are returned in GIF, JPEG, or PNG formats, but NOT in the
more useful GeoTiff format. That can't really be an oversight!)

All this to say that is built a compound widget/object
named cgGoogleMapWidget to retrieve and work with these static
Google map images. I have added this to the most recent version
of the library.

I have put a picture of the MabelBrowser here so you can see
how the map can be used:

   http://www.idlcoyote.com/misc/mabelbrowser.png

The window at the top allows me to zoom into and pan to
the relevant lidar location. The window at the bottom is
the cgGoogleMapWidget compound widget, shown here as a terrain
map. As you can see, buttons allow you to choose different
map and marker types to display on the map, and I have annotated
the map with box axes and grid lines. (I am displaying
user-defined markers, rather than Google markers on this map.)
Both the zoom/pan plot and the map can be saved as high-quality
raster and PostScript output should you want to make slides
of them, etc.

There is a delay when the map is updated, comparable to the
delay you would experience with function graphics, while I
go out to the Internet and get a new map from Google,
but it is not bad, and it allows me to center the map at
a location where I click, etc. If I click near a map marker,
it will update the zoom/pan plot to that marker location.

If you are just interested in the cgGoogleMapWidget program itself,
you can run the program to see where Coyote lives. If it is not
passed the identifier of a parent widget, it will create it's
own top-level base.

   IDL> object = cgGoogleMapWidget()

You can find all the necessary programs in the latest version
of the Coyote Library:

    http://www.idlcoyote.com/programs/zip_files/coyoteprograms.zip

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nata  
View profile  
 More options Jul 11 2012, 12:59 pm
Newsgroups: comp.lang.idl-pvwave
From: nata <bernat.puigdomen...@gmail.com>
Date: Wed, 11 Jul 2012 09:59:08 -0700 (PDT)
Local: Wed, Jul 11 2012 12:59 pm
Subject: Re: Google Static Maps in IDL
I have some problems extracting the zip file :

   skipping: coyote/cgcmdwindow__define.pro  unsupported compression method 14
   skipping: coyote/cgzplot__define.pro  unsupported compression method 14
   skipping: coyote/printpath.pro    unsupported compression method 14
   skipping: coyote/symcat.pro       unsupported compression method 14

nata


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 11 2012, 2:32 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Wed, 11 Jul 2012 12:32:28 -0600
Local: Wed, Jul 11 2012 2:32 pm
Subject: Re: Google Static Maps in IDL

nata writes:
> I have some problems extracting the zip file :

>    skipping: coyote/cgcmdwindow__define.pro  unsupported compression method 14
>    skipping: coyote/cgzplot__define.pro  unsupported compression method 14
>    skipping: coyote/printpath.pro    unsupported compression method 14
>    skipping: coyote/symcat.pro       unsupported compression method 14

Yes, sorry. I do not know what that is about. It appears to be
a bug in my PowerArchiver software when I freshen files in the
archive. It changes the compression method even though I have
the correct compression method selected. :-(

Anyway, here is a version that should be working correctly:

   http://www.idlcoyote.com/programs/zip_files/coyoteprograms.zip

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 11 2012, 5:37 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Wed, 11 Jul 2012 15:37:46 -0600
Local: Wed, Jul 11 2012 5:37 pm
Subject: Re: Google Static Maps in IDL

David Fanning writes:
> To this end, I built a small object that exposes quite
> a bit of the Google Static Map API:

>    https://developers.google.com/maps/documentation/staticmaps/

I've been having a couple of problems with this today.
Does anyone have any special knowledge of firewalls?
This seems to be a firewall issue to me.

I use the IDLnetURL object to connect to the Internet.
My NASA client is having a problem connecting to the Google
static map location and retrieving a map. The command
we use looks like this:

   cmd = 'http://maps.googleapis.com/maps/api/staticmap?' + $
         'center=35.8271,-106.6480&zoom=12&size=640x390' + $    
         '&maptype=satellite&sensor=false&format=png32'
   netObj = Obj_New('IDLnetURL')
   void = netObj -> Get(URL=cmd, FILENAME='gmap.png')
   Obj_Destroy, netObj

We get the following error message when we issue this command:

  IDLNETURL::GET:  CCurlException:  Error: Http Get Request Failed.
  Error = Failed writing body (0 != 11946), Curl Error Code = 23..

However, if we issue this command:

   cmd = 'http://www.idlcoyote.com/misc/toucan.png'
   netObj = Obj_New('IDLnetURL')
   void = netObj -> Get(URL=cmd, FILENAME='gmap.png')
   Obj_Destroy, netObj

We have no problem whatsoever.

Are the properties on the end of the Google URL giving
us problems with the NASA firewall, do you think?

I appreciate any help you can give.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alx  
View profile  
 More options Jul 12 2012, 7:50 am
Newsgroups: comp.lang.idl-pvwave
From: alx <lecacheux.al...@wanadoo.fr>
Date: Thu, 12 Jul 2012 04:50:33 -0700 (PDT)
Local: Thurs, Jul 12 2012 7:50 am
Subject: Re: Google Static Maps in IDL
On 11 juil, 23:37, David Fanning <n...@idlcoyote.com> wrote:

I used your command and could get the image without any problem.
(IDL8.2 win32 and Win7 32 bits).
You might check rights for writing on *your* machine (according to
curl error).
alain.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Fab  
View profile  
 More options Jul 12 2012, 7:59 am
Newsgroups: comp.lang.idl-pvwave
From: Fab <fabien.mauss...@gmail.com>
Date: Thu, 12 Jul 2012 13:59:52 +0200
Local: Thurs, Jul 12 2012 7:59 am
Subject: Re: Google Static Maps in IDL
Great stuff David!

It works perfectly on my machine and on my university network:

{ x86_64 linux unix linux 7.1.1 Aug 21 2009      64      64}


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Coyote  
View profile  
 More options Jul 12 2012, 2:00 pm
Newsgroups: comp.lang.idl-pvwave
From: Coyote <sageande...@gmail.com>
Date: Thu, 12 Jul 2012 11:00:55 -0700 (PDT)
Local: Thurs, Jul 12 2012 2:00 pm
Subject: Re: Google Static Maps in IDL

On Thursday, July 12, 2012 5:59:52 AM UTC-6, Fab wrote:
> Great stuff David!

> It works perfectly on my machine and on my university network:

> { x86_64 linux unix linux 7.1.1 Aug 21 2009      64      64}

The problem appears now to be related to an environment variable on Macs. I am trying to store the image that comes back from Google in a temporary directory located with the GetEnv command like this:

   tempdir = GetEnv('IDL_TMPDIR', /ENVIRONMENT)

This directory either doesn't exist, or can't be written into, on this particular Mac. Can someone with a Mac help me understand what this directory might be?

Thanks,

David


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Galloy  
View profile  
 More options Jul 12 2012, 2:16 pm
Newsgroups: comp.lang.idl-pvwave
From: Michael Galloy <mgal...@gmail.com>
Date: Thu, 12 Jul 2012 12:16:57 -0600
Local: Thurs, Jul 12 2012 2:16 pm
Subject: Re: Google Static Maps in IDL
On 7/12/12 12:00 PM, Coyote wrote:

For me on my Mac with IDL 8.1 and 8.2, both

IDL> print, getenv('IDL_TMPDIR')
/var/folders/j2/hhx4tc4d6wn13qkl4mj_dksr0000gz/T/
IDL> print, filepath('', /tmp)
/var/folders/j2/hhx4tc4d6wn13qkl4mj_dksr0000gz/T/

yield the same thing and I can write to files in that directory.

-Mike

--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Fanning  
View profile  
 More options Jul 12 2012, 2:43 pm
Newsgroups: comp.lang.idl-pvwave
From: David Fanning <n...@idlcoyote.com>
Date: Thu, 12 Jul 2012 12:43:03 -0600
Local: Thurs, Jul 12 2012 2:43 pm
Subject: Re: Google Static Maps in IDL

Michael Galloy writes:
> For me on my Mac with IDL 8.1 and 8.2, both

> IDL> print, getenv('IDL_TMPDIR')
> /var/folders/j2/hhx4tc4d6wn13qkl4mj_dksr0000gz/T/
> IDL> print, filepath('', /tmp)
> /var/folders/j2/hhx4tc4d6wn13qkl4mj_dksr0000gz/T/

> yield the same thing and I can write to files in that directory.

This particular Mac was returning the name of
a directory that didn't exist. Once we created
it, all was well. Don't know, but I'm adding
a check for this now.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Craig Markwardt  
View profile  
 More options Jul 12 2012, 4:36 pm
Newsgroups: comp.lang.idl-pvwave
From: Craig Markwardt <craig.markwa...@gmail.com>
Date: Thu, 12 Jul 2012 13:36:46 -0700 (PDT)
Local: Thurs, Jul 12 2012 4:36 pm
Subject: Re: Google Static Maps in IDL

Yep, same success here!
Craig

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
nata  
View profile  
 More options Jul 12 2012, 10:05 pm
Newsgroups: comp.lang.idl-pvwave
From: nata <bernat.puigdomen...@gmail.com>
Date: Thu, 12 Jul 2012 19:05:50 -0700 (PDT)
Local: Thurs, Jul 12 2012 10:05 pm
Subject: Re: Google Static Maps in IDL


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »