~ubuntu-branches/ubuntu/wily/grass/wily

« back to all changes in this revision

Viewing changes to display/drivers/HTMLMAP/description.html

Tags: 7.0.0~rc1+ds1-1~exp1
* New upstream release candidate.
* Repack upstream tarball, remove precompiled Python objects.
* Add upstream metadata.
* Update gbp.conf and Vcs-Git URL to use the experimental branch.
* Update watch file for GRASS 7.0.
* Drop build dependencies for Tcl/Tk, add build dependencies:
  python-numpy, libnetcdf-dev, netcdf-bin, libblas-dev, liblapack-dev
* Update Vcs-Browser URL to use cgit instead of gitweb.
* Update paths to use grass70.
* Add configure options: --with-netcdf, --with-blas, --with-lapack,
  remove --with-tcltk-includes.
* Update patches for GRASS 7.
* Update copyright file, changes:
  - Update copyright years
  - Group files by license
  - Remove unused license sections
* Add patches for various typos.
* Fix desktop file with patch instead of d/rules.
* Use minimal dh rules.
* Bump Standards-Version to 3.9.6, no changes.
* Use dpkg-maintscript-helper to replace directories with symlinks.
  (closes: #776349)
* Update my email to use @debian.org address.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
 
<HTML>
3
 
<HEAD>
4
 
 <TITLE>HTMLMAP driver</TITLE>
5
 
 <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
6
 
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
7
 
</HEAD>
8
 
<BODY bgColor=white>
9
 
 
10
 
<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>
11
 
 
12
 
<H2>NAME</H2>
13
 
 
14
 
<EM><B>HTMLMAP driver</B></EM> - driver to create HTML image maps.
15
 
<BR><EM>(drivers)</EM>
16
 
 
17
 
<H2>DESCRIPTION</H2>
18
 
 
19
 
The HTMLMAP driver allows the generation of HTML image maps
20
 
for area vector data. HTML image maps are used in conjunction with images to 
21
 
provide unique URL targets for different portions of an image. The HTMLMAP 
22
 
driver can create both client-side image maps embedded into HTML files, or 
23
 
server-side image maps used by web server software. 
24
 
<P>
25
 
Note that GRASS display commands that require the MOUSE will not work 
26
 
correctly (or at all!) 
27
 
<P>
28
 
Polygons can at most have 100 vertices (this limit imposed by HTML image map 
29
 
formats, see <B>GRASS_HTMLMAXPOINTS</B> below.) The driver will attempt to 
30
 
trim polygons that have more that 100 
31
 
vertices by removing vertices with the least amount of angle to the next 
32
 
vertice. Also, any polygon that is entirely bounded by another polygon will be 
33
 
discarded. 
34
 
<P>
35
 
Text written to the driver before polygons are used as the HREF tag for all 
36
 
subsequent polygons written. All polygons that exist in a vector map will have 
37
 
the same HREF tag. 
38
 
<P>
39
 
The only GRASS display commands that should be used with this driver are: 
40
 
<UL>
41
 
  <LI><a href="d.text.html">d.text</A> 
42
 
  - pass href information for resulting image maps.</LI>
43
 
  <LI><a href="d.vect.html">d.vect</A> 
44
 
  - draw polygons from a vector map.</LI>
45
 
</UL>
46
 
 
47
 
<H2>USAGE</H2>
48
 
 
49
 
<H3>Environment variables</H3>Several environment variables effect the operation 
50
 
of HTMLMAP. 
51
 
 
52
 
<UL>
53
 
  <LI><B>GRASS_WIDTH=xxx</B><BR>
54
 
    the width of the image map (default is 640).
55
 
  </LI>
56
 
  <LI><B>GRASS_HEIGHT=yyy</B><BR>
57
 
    the height of the image map (default is 480).
58
 
  </LI>
59
 
  <LI><B>GRASS_HTMLTYPE=type</B><BR>
60
 
    the type of image mape to create (default is CLIENT): 
61
 
    <DL>
62
 
      <DD><TT><B>CLIENT</B></TT> &nbsp;&nbsp; Netscape/IE client-side image map. 
63
 
        (NAME="map")<BR>
64
 
      <DD><TT><B>APACHE</B></TT> &nbsp;&nbsp; Apache/NCSA server-side image 
65
 
        map.<BR>
66
 
      <DD><TT><B>RAW</B></TT> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Raw url 
67
 
        and polygon vertices ( <I>url&nbsp; x1&nbsp; y1&nbsp; x2&nbsp; y2&nbsp; 
68
 
          ..... </I>), suitable for conversion to CERN server format, or any other 
69
 
        format with user supplied conversion program.</DD>
70
 
    </DL>
71
 
  </LI>
72
 
  <LI><B>GRASS_HTMLFILE=filename</B><BR>
73
 
    specifies the resulting file to store 
74
 
    the html image map, default is <tt>htmlmap</tt>. Files without absolute path 
75
 
    names are written in the current directory where the driver was started. 
76
 
    <BR>
77
 
    <em>Any existing file of the same name is overwritten without 
78
 
      warning.</em>
79
 
  </LI>
80
 
  <LI><B>GRASS_HTMLMINDIST=n</B><BR>specifies the minimum distance in pixels
81
 
  that a point must change from the previous point to keep in the list of
82
 
  vertices for a polygon.  The default is <tt>2</tt>, which means that a
83
 
  point's x and y difference from the previous point must change by a number
84
 
  of pixels greater than this value.  This parameter helps to eliminate
85
 
  closely spaced points.
86
 
  </LI>
87
 
  <LI><B>GRASS_HTMLMINBBOX=n</B><BR>specifies the minimum bounding box
88
 
  dimensions to record a polygon as a clickable area.
89
 
  The default is <tt>2</tt>, which means that a polygon with a bounding box
90
 
  of less than this value is not included. This parameter helps to eliminate
91
 
  polygons than are a point or line.
92
 
  </LI>
93
 
  <LI><B>GRASS_HTMLMAXPOINTS=n</B><BR>specifies the maximum number of
94
 
  vertices included in a polygon's clickable area.
95
 
  The default is <tt>99</tt>.  Some browsers can only accommodate polygons of
96
 
  100 vertices or less.  The HTMLMAP driver automatically ensures that a
97
 
  polygon is closed by making the last point the same as the first
98
 
  point.</LI>
99
 
</UL>
100
 
 
101
 
<H3>Typical usage</H3>
102
 
<UL>
103
 
  <LI>Start up the driver
104
 
<DIV class="code"><PRE>
105
 
d.mon start=HTMLMAP
106
 
</PRE></DIV>
107
 
  </LI>
108
 
  <LI>Display text strings (HREF's) and polygons
109
 
<DIV class="code"><PRE>
110
 
echo "http://www.no-such-place.net/area51/" | d.text
111
 
d.vect map=area51
112
 
echo "http://www.roswell-nm.net/little/green/men.html" | d.text
113
 
d.vect map=roswell
114
 
</PRE></div>
115
 
  <LI>Stop the driver when all polygon have been displayed. This will cause a file 
116
 
    named 'htmlmap' to be created in your current directory.
117
 
<DIV class="code"><PRE>
118
 
d.mon stop=HTMLMAP
119
 
</PRE></DIV>
120
 
  <LI>You will also want to create an image for your image map. Use the PNG 
121
 
    driver and other utilities to create .gif or .jpg files.
122
 
    <i>The following example is somewhat out of date and refers to options
123
 
      available in GRASS 5.</i>
124
 
<DIV class="code"><PRE>
125
 
# using previous GRASS_WIDTH &amp; GRASS_HEIGHT
126
 
d.mon start=PNG
127
 
d.mon select=PNG
128
 
d.rast map=terrain
129
 
d.vect map=area51  fillcolor=white  linecolor=blue
130
 
d.vect map=roswell fillcolor=yellow linecolor=blue
131
 
d.vect map=states  color=green
132
 
d.vect map=roads   color=black
133
 
d.mon stop=PNG
134
 
<!-- ????  FIXME -->
135
 
# make the region the same as the newly created cell for ppm export
136
 
g.region save=saved.reg
137
 
g.region raster=D_cell
138
 
r.out.ppm -q input=D_cell output=alien.ppm
139
 
 
140
 
# use the netpbm utilities to create a gif (quantize if needed)
141
 
ppmquant 128 &lt;alien.ppm |  ppmtogif &gt;alien.gif 
142
 
 
143
 
# assemble some html with the image and the image map
144
 
echo '&lt;html&gt;&lt;body&gt;&lt;img src="alien.gif" usemap="#map"&gt;' &gt;alien.html
145
 
cat htmlmap                                           &gt;&gt;alien.html
146
 
echo '&lt;/body&gt;&lt;/html&gt;'                                 &gt;&gt;alien.html
147
 
        
148
 
# don't forget to reset your region
149
 
g.region region=saved.reg
150
 
 
151
 
# take a look and test it out
152
 
netscape file:`pwd`/alien.html &amp;
153
 
</PRE></DIV>
154
 
  </LI>
155
 
</UL>
156
 
 
157
 
<H2>NOTES</H2>
158
 
 
159
 
HTMLMAP was adapted from the CELL driver in GRASS 4.3. 
160
 
Point-in-polygon test code was lifted from Randolph Franklin's web page, see 
161
 
<UL>
162
 
  <LI><a href="http://www.ecse.rpi.edu/Homepages/wrf/">http://www.ecse.rpi.edu/Homepages/wrf/</A></LI>
163
 
  <LI><a href="http://www.ecse.rpi.edu/Homepages/wrf/research/geom/pnpoly.html">http://www.ecse.rpi.edu/Homepages/wrf/research/geom/pnpoly.html</A></LI>
164
 
</UL>
165
 
 
166
 
<P>
167
 
If you create an HTML file with two or more images and image maps, you will 
168
 
need to edit the map names. The HTMLMAP driver creates its map with the name 
169
 
<tt>map</tt>. A small sed script can easily change the map name:
170
 
 
171
 
<PRE>
172
 
  sed -e 's/NAME="map"/NAME="foomap"/' &lt; htmlmap &gt; foomap.html
173
 
</PRE>
174
 
 
175
 
<H2>SEE ALSO</H2>
176
 
 
177
 
<EM>
178
 
  <a href="displaydrivers.html">Display drivers</a>
179
 
  <br>
180
 
  <a href="pngdriver.html">PNG driver</A>,
181
 
  <a href="psdriver.html">PostScript driver</A>,
182
 
  <a href="xdriver.html">XDRIVER</A>
183
 
  <BR>
184
 
  <A href="d.mon.html">d.mon</A>,
185
 
  <a href="d.text.html">d.text</A>, 
186
 
  <a href="d.vect.html">d.vect</A>
187
 
</EM> 
188
 
 
189
 
<p>
190
 
<i>Last changed: $Date: 2010-01-20 14:26:08 +0100 (Wed, 20 Jan 2010) $</i>