Graphs on the fly - advice sought

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
This ng seems almost to have died, but I live in hope ...

I currently have a very successful web-page which enables UK citizens
to align a terrestrial TV aerial towards a given transmitter.  Here's
an example of it in action:

Once loading has completed, and the relevant buttons enabled, there
three available visual components to help align the aerial and predict
the likely usefulness of the signal:
    A Google map for finding a landmark to point the aerial towards
    A UK Ordnance Survey map showing the signal path
    A vertical signal profile showing potential obstructions

It is the last of these, which is obtained by pressing the Signal
Profile button at the bottom of the form and is displayed at the
bottom of the page beneath the two maps, that is of concern, because
currently it uses a service deprecated by Google that will retire next

Currently, the page sends Google a link of the following form
(obviously this is very long and will break through line wrapping in a
newsgroup post, but if required you should be able to see the
resulting image by fixing that manually) and gets back the image
displayed in the example page above.,8,20,25&cht=lc&chd=e:-mCO,-m.u.3.u.l.T.B-v-d-L9x9W878g8G7r7Q6s6b535c444e363f272Y191Z0.0Sz3zTywyMxxxFwqv9vau2uStutLsnr6rgqzqPpjpIobnvnLmel7lOkzj-jjiuiThdgxgNfge9eHdjc3cTbda6aEZhYrX-XSWlV5VDUfTqS9SIRbQlP5PDOFNYMaLtKvJ5IyH8G1F2EU,-m.B-v-d-L9x9W878g8G7i7Q6s6J5u5K4v4M3o3E2q2G1r0.0k0AzTy5yMxxxFwqv9viu2ubtutUsnr6rgqzqYpspIoboBnUmwmElpk8kQjsi.ilh4hUgogEfXe0eHdac3cKbma6aWZpZGYZX1XAWcVwU6UWTqTGSRRtRAQUPnO6OONhMsL.LSKdJwI7IOHYGsFtE4Do,-m8y7r61535K4V3o2z2G1Q0tz3zCyexoxFwPvru2uStms5sMrpq8qGpjo2oSnmnCmNlyk8kZjsjIichvhLgfgEfXe0eHdjc3ccbvbMafZyZYYrYHXbXAWTVwVMUoT8TYS0SRRtRJQlQCPeO6OXNzNYMsMILkLAKmKCJeI7IgH8HhG-GjF.FcFBEmELDoDWC7CgCOB8B0,-m8G6s5u4e3o2q10020JzLyexowqv9vIubtmtCsMrgqqqGpRotn4nCmelplFkZj1i.ichvhLgWfyfFeZd1dJclb4bVaoaEZYY9YQXtXAWTV5VMUoUFThS0SZRtRSQlQCPeO6OgNzNYM0MRLtLSKvKUJwJMIyIOHzHQG1GRF2FcFBEmELDwDWC7CgCOB8BrBZBQA-A-BH,10v0k8hUe0d1aWVnQlKdNqU6XJV5XJV5VwUfPwMRL.DwBZBZBiBiBiBrBrBrBrDEB8EmFTFKJ5OxQ3SiRtRtQuNzLSCFCFCFCFCFCFCFCFCFCFCFC

This URL is produced by a self-coded Python GGI script using SRTM
elevation data, and is returned to the calculator page along with
numerical profile data for use elsewhere.  The above example was
produced by a call to the script similar to:

As this is the second time that Google have broken this page by
arbitrarily deciding to retire things after persuading us all to rely
on them, I am anxious to have my own, stable permanent solution to
this graphing problem.

Can anyone suggest a free tool or program that I can put on my server
to draw a similar image from the SRTM data to send back to the page?
Please always reply to ng as the email in this post's
header does not exist.  Or use a contact address at:

Re: Graphs on the fly - advice sought

Quoted text here. Click to load it

I don't remember the exact script, but I recall looking for exactly such  
a solution via CPAN for a perl-based solution: There definitely exists  
such a beast - searching via  
perl -MCPAN -e shell
at the server command prompt.  

I know that's not super helpful, but wanted to let you know that such a  
beastie does indeed exist :)


Re: Graphs on the fly - advice sought

Thanks, I'll make a note of that ...

On Fri, 13 Jun 2014 00:09:14 -0500, Marc Bissonnette
Quoted text here. Click to load it
Please always reply to ng as the email in this post's
header does not exist.  Or use a contact address at:

Re: Graphs on the fly - advice sought

On Friday, June 13, 2014 7:39:44 AM UTC-7, Java Jive wrote:
Quoted text here. Click to load it

Just code it up!

Here's a PI chart script I wrote years ago...

Usage:  pie.php?helpful= (1..100) &relevant= (1..100) & label=chart label



$hits = $_GET['helpful'] * 3.6;

$rel = $_GET['relevant'] * 3.6 + $hits;

$label = $_GET['label'];

$image = imagecreatetruecolor(240, 200);

$white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);

$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);

$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);

$navy = imagecolorallocate($image, 0x00, 0x00, 0x80);

$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);

$red = imagecolorallocate($image, 0xFF, 0x00, 0x00);

$darkred = imagecolorallocate($image, 0x90, 0x00, 0x00);

$yellow = imagecolorallocate($image, 0xFF, 0xFF, 0x00);

$darkyellow = imagecolorallocate($image, 0x90, 0x90, 0x00);

$green = imagecolorallocate($image, 0x00, 0xFF, 0x00);

$darkgreen = imagecolorallocate($image, 0x00, 0x90, 0x00);

for ($i = 110; $i > 100; $i--) {

imagefilledarc($image, 120, $i, 160, 80, 0, $hits, $darkgreen, IMG_ARC_PIE);

imagefilledarc($image, 120, $i, 160, 80, $hits, $rel , $darkyellow, IMG_ARC_PIE);

imagefilledarc($image, 120, $i, 160, 80, $rel, 360 , $darkred, IMG_ARC_PIE);


imagefilledarc($image, 120, 100, 160, 80, 0, $hits, $green, IMG_ARC_PIE);

imagefilledarc($image, 120, 100, 160, 80, $hits, $rel , $yellow, IMG_ARC_PIE);

imagefilledarc($image, 120, 100, 160, 80, $rel, 360 , $red, IMG_ARC_PIE);

// Write the string at the top left

imagestring($image, 5, 10, 10, $label, $white);

$xval = cos($hits/57.2957795/2);
$yval = sin($hits/57.2957795/2);

imagestring($image, 3, 105+$xval*95, 95+$yval*60, 'HELPFUL', $white);

$xval = cos((360-$rel)/57.2957795/2);
$yval = sin((360-$rel)/57.2957795/2);

imagestring($image, 3, 100+$xval*95, 100-$yval*60, 'NO MATCH', $white);

$xval = cos(($rel+$hits)/57.2957795/2);
$yval = sin(($rel+$hits)/57.2957795/2);

imagestring($image, 3, 105+$xval*95, 95+$yval*60, 'RELEVANT', $white);

header('Content-type: image/png');




Needed a copy myself actually for !

Site Timeline