Community Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Show satellite image for a given location

Contestant Info:

Christian Altenbach

Research Ophthalmologist at the Jules Stein Eye Institute, UCLA

(I don't post my e-mail in public, but you can contact me via private message)

User Group Affiliation:

I regularly attend the following user groups:

Summary:

(This round asks for getting and displaying information from a website.)

This is very simple example code to display a satellite image for a give location on the front panel.

The code contains three landmarks in Austin relevant to NI Week. It can easily be expanded by the programmer.

Function:

The program composes a simple URL based on the inputs and displays the resulting image.

Steps to execute code:

  1. Open the attached project.
  2. Run one of the two toplevel programs

Screenshots:

Main Front Panel:

MadnessWebFP.png

Main Block Diagram:

MadnessWebBD.png

VI attached below

A version in LabVIEW 2010 and LabVIEW 8.2 is attached.

Download All
Comments
FraggerFox
Active Participant Active Participant
Active Participant
on

How is this one different from what is posted here:

http://decibel.ni.com/content/docs/DOC-7983

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
altenbach
Knight of NI Knight of NI
Knight of NI
on
  • The code is much nicer. Compare the simple formatting with the spaghetti pile of string operations in the other example.
  • There is no race condition due to misuse of local variables.
  • It is an atomic example, and not a full application. (This is an example contest, not an application showcase!)
  • ...

Sorry, I wasn't aware of the above quoted document. I did see a much earlier versions a couple of years ago somewhere on the UAV forum, though.

peter_smith
Member
Member
on

It's really much nicer, easy to understand how the example works, and it does not use Google's API.

However I don't see the data harvesting part... This example does nothing with data from website.

G-Money
NI Employee (retired)
on

The other document and many other examples like it on the community use the Google Maps API and need an API key to use. Altenbach's uses url parsing to just interact with maps.google.com directly. Nice work!

altenbach
Knight of NI Knight of NI
Knight of NI
on

peter_smith wrote:                       

This example does nothing with data from website.

I agree, but I don't think the problem description was that specific. It does get information from the web and displays it.

Initially, I had in mind to submit code to display realtime data from my solar panels connected to a TED 5000, but I decided to keep the URL private in order not to flood my connection and also for privacy and security reasons. Also, the mapping example had a few more features that I stripped out in the last iteration to keep the example focused. Distilling a programming concept to the bare essentials is important when writing a good coding example. This is not an application contest, IMHO.

peter_smith
Member
Member
on

To make it clear: what I wanted to say is the task in this round was to harvest data from a public site and display it in LV. Your code does not get/harvest any information not even data from any web site or network connection.

In fact it uses ActiveX. The ActiveX object gets the data, and it is the one displaying it, it is responsible for receiving, processing and displaying the data. LabVIEW code never ever "meets" or "sees" the data coming from the network.

By the way if you would have made a connection to the URL via DS or HTTP Client VIs, grab the image from Google by parsing some HTML and display it in a picture control, I did not say a word.

After all I don't want to say your code is not good, becuse it is good. It's straightforward, easy to understand and I'm pretty sure it is very useful for many users.

" This is not an application contest, IMHO. ", even though each and every entry was an application.

LeahE1
Member
Member
on

Dear Altenbach,

 

Thank you for this example - your code is very elegant. It still works like a dream despite changes Google have made since 2010, if you change the url root to 'http://maps.googleapis.com/maps/api/staticmap?'.

 

However, I am struggling to understand why it always prompts me to save an image when I first open the vi. (See below screenshot.) This happens before I even click 'run'.

download_static_map.PNG

I am guessing it is something to do with IwebBrowser2 and tried using 'property browser' to set Silent=true (which should prevent dialogue boxes), but on reopening the download prompt still appears.

 

silent_true.PNG

It is the same unsolved problem as in the thread https://forums.ni.com/t5/LabVIEW/IWebBrowser2-load-last-content-without-execution/td-p/3314457 .

 

Do you experience this also? And do you know how I can prevent the download prompt? Any advice would be much appreciated. 

 

Best regards,

Leah

Leah Edwards - CLD
kienle99
Member
Member
on

Dear Leah Edwards,

I can't not run this example. Please help me. I changed the URL

kienle99_0-1608222836775.png

 

Contributors