Caro-COOPS Bulletin Board Forum Index Caro-COOPS Bulletin Board

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   CalendarCalendar   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

creating graphics

 
Post new topic   Reply to topic    Caro-COOPS Bulletin Board Forum Index
   -> Tools, Links & documentation
View previous topic :: View next topic  
Author Message
jcothran



Joined: 24 Feb 2003
Posts: 189
Location: Columbia, SC

PostPosted: Thu Apr 08, 2004 4:43 pm    Post subject: creating graphics Reply with quote

From the README.txt file in the attached graphic.tar file:

This is sample code showing how to create some nice graphical dials and gauges as displayed on the carocoops website

Home page
http://www.carocoops.org/
mouse over the 'FRP2' or FRP3' to see the smaller dials and gauges displayed in the left hand sidebar

Details page
http://www.carocoops.org/carocoops_website/buoy_detail.php?buoy=buoy3
can also be accessed by clicking on FRP2 or FRP3 from the home page map

using

perl (version 5.8.0)
graphical templates (thanks to Susanna King for creating these)
gmt (version 3.4.3) (thanks to Tom Cook for the initial gmt scripts and help
with gmt) http://gmt.soest.hawaii.edu/
imagemagick (version 5.5.7) http://www.imagemagick.org/

The graphical templates are included in the 'graphics' directory. There are many more graphical templates that have been created than are shown below or demonstrated in the code.

The gmt scripts used are in the 'gmt' directory.

The various .gif, .jpg, .png files are samples of the output that will be
succcssfully generated when running

perl createGraphics.pl

The things which will need to be configured to your environment are the directory settings in createGraphics.pl. $working_dir, $graphics_dir and $gmt_dir can be left as their default, but the $imagemagick_dir should reference the location of your imagemagick bin.

Also the perl scripts in the included gmt directory need to have the directory references to the gmt and imagemagick bins pointing to the correct places.

Generally this could be extended for other graphic types and templates - the format of the function call is create_graphic(graphic_type, input_graphic_template, output_filename,
graphic_settings,...)

GMT was used for the dial hand elements as is produces the cleanest vector arrows for overlaying. GMT requires a 'basemap' which approximately overlays the underlying template graphic(close enough). I tried using imagemagick's rotate functions, but they leave a lot of visual artifacts behind and are unsuitable. I do use imagemagick exclusively for the gauges as this is just a simple superposition of a few graphical layers.

The choice of .gif, .jpg or .png is experimental - some image types are better suited to certain transformation steps or browser display than others.



salinity_bot.png
 Description:
 Filesize:  28.19 KB
 Viewed:  6124 Time(s)

salinity_bot.png



home_watertemp.jpg
 Description:
 Filesize:  3.92 KB
 Viewed:  6124 Time(s)

home_watertemp.jpg



temperature_bot.png
 Description:
 Filesize:  8.65 KB
 Viewed:  6124 Time(s)

temperature_bot.png



home_current_knots_bottom.gif
 Description:
 Filesize:  15.4 KB
 Viewed:  6124 Time(s)

home_current_knots_bottom.gif



current_bot_knots.png
 Description:
 Filesize:  28.19 KB
 Viewed:  6124 Time(s)

current_bot_knots.png



graphic.tar
 Description:

Download
 Filename:  graphic.tar
 Filesize:  1.19 MB
 Downloaded:  1162 Time(s)

Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Caro-COOPS Bulletin Board Forum Index
   -> Tools, Links & documentation
All times are GMT - 5 Hours
Page 1 of 1

 
Jump to: 
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by php BB © 2001, 2002 php BB Group