Point Image Object (PIO)
Online Demo:
The purpose of this online demo is to show the following JShape features:
- Render a point into a .gif or .jpg image object.
- Change the transparency, outlook color, size or appearance of the Point
Image Object (PIO).
Since the above features are only supported in JShape 2.x, users need to have
Java 1.1+ enabled browsers (like IE 4.0+, NetScape 4.06+, Lotus Notes 4.6+,
or HotJava) to view it.
The Populations of Japan Cities (PIO)
JShape parameters and files used in the online demo:
JShape Applet Parameters:
<applet code="jshape.class" width=560 height=460 archive="jshape.zip">
<param name="project" value="The Populations of Japan Cities (PIO)">
<param name="unzoomratio" value="2">
<param name="cmdfile" value="menu/japan.cmd">
<param name="piofile" value="menu/japan.pio">
<param name="external" value="japan">
<param name="mbcolor" value="black">
<param name="status" value="5">
<param name="list" value="1,3">
<param name="layer1" value="menu/city.shp">
<param name="info1" value="menu/city.dbf">
<param name="title1" value="Cities">
<param name="fcolor1" value="green">
<param name="lcolor1" value="green">
<param name="size1" value="8">
<param name="thematic1" value="menu/citypio.tmt">
<param name="tmenable1" value="off">
<param name="pio1" value="1">
<param name="layer2" value="menu/latlong.shp">
<param name="info2" value="menu/latlong.txt">
<param name="title2" value="Latlong">
<param name="fcolor2" value="cyan">
<param name="lcolor2" value="cyan">
<param name="layer3" value="menu/japan.shp">
<param name="title3" value="Japan">
<param name="fcolor3" value="red">
<param name="bcolor3" value="transparent">
<param name="size3" value="2">
</applet>
PIO Definition File : japan.pio
# ImageFile,TransparentColor,ForegroundColor,BaseSize A line starts with '#' is a comments line.
# PIO=1
pio1.gif,white,black,8
# PIO=2
pio2.gif,white,black,8
# PIO=3
pio3.gif,white,black,8
Image Files :
: pio1.gif
: pio2.gif
: pio3.gif
Thematic Information Definition File : citypio.tmt
# thematic infomation field A line starts with '#' is a comments line.
2
# description,criteria,foreground-color,background-color,size,PIO-number-(optional)
>= 5000000,>= 5000000,red,null,8,3
>= 2000000,>= 2000000 and < 5000000,magenta,null,8,2
>= 1000000,>= 1000000 and < 2000000,cyan,null,8,1
< 1000000,< 1000000,blue,null,8,0
Detail Discussion
- At line 5 in JShape Applet Parameters : specifies JShape to load the PIO definition file "japan.pio".
- At line 19 in JShape Applet Parameters : The "pio1" parameter specifies JShape to use the "pio1.gif" as the Point Image Object.
- In the Thematic Information Definition file "citypio.tmt", the PIO-number field is optional.
If no value is specified in the PIO-number field, JShape will take the default value '0' instead.
This means at the line 8 in "citypio.tmt", users can also specify it in the following way:
< 1000000,< 1000000,blue,null,8
- PIO supports any .gif or .jpg image icons.
- JShape has the special function to handle the transparency of image icons, so users
don't need to convert a regular .gif icon to a transparent background .gif in advance.
- "pio1.gif", "pio2.gif", and "pio3.gif" are black & white pictures. Based the definition of "japan.pio",
JShape does not print any white pixels from icons, and convert any black pixels to the foreground color
pixels to the map.
- The BaseSize in the PIO definition file is used to scale the size of an icon image. For example,
there is an icon "bird.jpg", which is 20 pixel wide and 20 pixel height. Users can set the BaseSize parameter
to be 10 in the PIO definition file as following :
bird.gif,white,black,10
If users execute "SIZE=5" command later, JShape will display 10 (20 * 5 / 10)
pixel x 10 (20 * 5 / 10) pixel bird icon image on the map.
If users execute "SIZE=15" command later, JShape will display 30 (20 * 15 / 10)
pixel x 30 (20 * 15 / 10) pixel bird icon image on the map.
');
document.write('');
// document.write('');
document.write('');
document.write('');
if (document.cookie.indexOf('fcseenpop') == -1) {
pop_domain = document.domain.substring(document.domain.indexOf('.'));
expiry_date = new Date(new Date().getTime() + 86400000).toGMTString(); // 24 hours
document.write('');
document.cookie = 'fcseenpop=1; path=/; domain=' + pop_domain + '; expires=' + expiry_date;
}
}
}
// -->