[Shake-dev] bug fix for high-resolution shakemaps, template changes

Bill Gustafson billg at ess.washington.edu
Fri Sep 28 19:50:48 GMT 2007


Hi All,

Another little (and big) niggling task that I've been saying "I'll get 
around to that". 

We have implemented a high-resolution version of shakemap for the 
Seattle area.  You can see an example at:

http://www.pnsn.org/seashake/shake/0102281854/intensity.html

To do this, there was one bug fix that had to implemented, and I changed 
some template files (both for the high-resolution version and the 
low-resolution version so that they link to one another on our local 
webpages).

The bug fix involved the clickmaps, because they assumed that the 
margins for the postscript output was always one inch, even though there 
is an option in mapping.conf for a varying x and y origin, and width.  
This information is passed from mapping to genex using a file called 
geometry_map.txt, but it wasn't being used in genex to adjust the 
margins for the html output.  This caused the clickmaps to be off for 
the high-resolution version, because it is a fixed dimension, and it is 
tall and narrow relative to the default for shakemap.

The file that I modified is $SHAKEHOME/perl/lib/Genex/ClickMaps.pm.  
Here is a diff of the changes, and I've attached the changed file as 
well.  I don't think that this should affect the regular shakemaps, as 
it's just using the information that is already present in the mapping.conf.

[watson][39] diff ClickMaps.pm ClickMaps.pm.new
37c37,38
<   $height = $height_ps + $JPG_MARGIN{bottom} + $JPG_MARGIN{top};
---
 > #  $height = $height_ps + $JPG_MARGIN{bottom} + $JPG_MARGIN{top};
 >   $height = $height_ps + $geom->{'yo'} + $JPG_MARGIN{top};
43,44c44,47
<     $x += $JPG_MARGIN{'left'};
<     $y += $JPG_MARGIN{'bottom'};
---
 > #    $x += $JPG_MARGIN{'left'};
 > #    $y += $JPG_MARGIN{'bottom'};
 >     $x += $geom->{'xo'};
 >     $y += $geom->{'yo'};
68,69c71,74
<   $x += $JPG_MARGIN{'left'};
<   $y += $JPG_MARGIN{'bottom'};
---
 > #  $x += $JPG_MARGIN{'left'};
 > #  $y += $JPG_MARGIN{'bottom'};
 >     $x += $geom->{'xo'};
 >     $y += $geom->{'yo'};

The only thing that is a little odd, is that I believe 'yo' refers to 
the top margin, and replaces the margin that refers to the bottom 
margin, but I don't think that there is a corresponding margin setting 
available in mapping.conf.

I will just list the templates I changed to make the web pages link back 
and forth between the high-res and low-res version. 

In both the high-res and low-res installations I changed these files:

In $SHAKEHOME/lib/genex/web/template/shake/event

header.html
products_header.html
spectral_header.html

In the high-res installations I also changed this file, although it just 
adds the word Seattle to the title:

In $SHAKEHOME/lib/genex/web/template/shake

index.html

On all our installations I changed this file:

In $SHAKEHOME/lib/genex/web/template/shake/event

imagemap.html

to add those cool mouseovers that the USGS version of the shakemaps has.

Bill

-- 
Bill Gustafson          Res Eng/Sr Comp Spc
KSRSL/PNSN              Phone: (206)685-8266/(206)543-8928
Dept. of Earth and Space Sciences
Box 351310, UW, Seattle, WA  98195-1310
http://alumnus.caltech.edu/~billg/bill.htm


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ClickMaps.pm.new
Url: http://geohazards.usgs.gov/pipermail/shake-dev/attachments/20070928/a19b08be/attachment.pl 


More information about the Shake-dev mailing list