A.6 Advanced Styles
Advanced styles are structured styles made from simple styles.
Advanced styles are used primarily for thematic mapping. The core advanced style is the bucket style (BucketStyle
), and every advanced style is a form of bucket style. A bucket style is a one-to-one mapping between a set of primitive styles and a set of buckets. Each bucket contains one or more attribute values of features to be plotted. For each feature, one of its attributes is used to determine which bucket it falls into or is contained within, and then the style assigned to that bucket is applied to the feature.
Two special types of bucket styles are also provided: color scheme (described in Color Scheme Styles) and variable (graduated) marker (described in Variable Marker Styles).
Other advanced styles are dot density (described in Dot Density Marker Styles), bar chart (described in Bar Chart Marker Styles), collection (described in Collection Styles), and variable pie chart (described in Variable Pie Chart Styles).
A.6.1 Bucket Styles
A bucket style defines a set of buckets, and assigns one primitive style to each bucket. The content of a bucket can be either of the following:
-
A collection of discrete values (for example, a bucket for all counties with a hurricane risk code of 1 or 2, a bucket for all counties with a hurricane risk code of 3, and so on).
-
A continuous range of values (for example, a bucket for all counties with average family income less than $30,000, a bucket for all counties with average family income from $30,000 through $39,999, and so on). In this case, the ranges of a series of buckets can be individually defined (each defined by an upper-bound value and lower-bound value) or equally divided into an overall range.
The following code excerpt shows the basic format of a bucket style:
<?xml version="1.0" ?> <AdvancedStyle> <BucketStyle> <Buckets> . . . </Buckets> </BucketStyle> </AdvancedStyle>
In contrast with the other (primitive) styles, an advanced style always has a root element identified by the <AdvancedStyle>
tag.
For bucket styles, a <BucketStyle>
element is the only child of the <AdvancedStyle>
element. Each <BucketStyle>
element has one or more <Buckets>
child elements, whose contents vary depending on the type of buckets.
Parent topic: Advanced Styles
A.6.1.1 Collection-Based Buckets with Discrete Values
If each bucket of a bucket style contains a collection of discrete values, use a <CollectionBucket>
element to represent each bucket. Each bucket contains one or more values. The values for each bucket are listed as the content of the <CollectionBucket>
element, with multiple values delimited by commas. The following example defines three buckets.
<?xml version="1.0" ?> <AdvancedStyle> <BucketStyle> <Buckets> <CollectionBucket seq="0" label="commercial" style="10015">commercial</CollectionBucket> <CollectionBucket seq="1" label="residential" style="10031">residential, rural</CollectionBucket> <CollectionBucket seq="2" label="industrial" style="10045">industrial, mining, agriculture</CollectionBucket> </Buckets> </BucketStyle> </AdvancedStyle>
In the preceding example:
-
The values for each bucket are one or more strings; however, the values can also be numbers.
-
The name of the style associated with each bucket is given.
-
The label attribute for each
<CollectionBucket>
element (commercial, residential, or industrial) is used only in a label that is compiled for the advanced style. -
The order of the
<CollectionBucket>
elements is significant. However, the values in theseq
(sequence) attributes are informational only; the map visualization component determines sequence only by the order in which elements appear in a definition.
Although not shown in this example, if you want a bucket for all other values (if any other values are possible), you can create a <CollectionBucket>
element with #DEFAULT#
as its attribute value. It should be placed after all other <CollectionBucket>
elements, so that its style will be rendered last.
To apply label styles to collection-based buckets with discrete values, see Specifying a Label Style for a Bucket.
Parent topic: Bucket Styles
A.6.1.2 Individual Range-Based Buckets
If each bucket of a bucket style contains a value range that is defined by two values, use a <RangedBucket>
element to represent each bucket. Each bucket contains a range of values. The following example defines four buckets.
<?xml version="1.0" ?> <AdvancedStyle> <BucketStyle> <Buckets> <RangedBucket high="10" style="10015"/> <RangedBucket low="10" high="40" style="10024"/> <RangedBucket low="40" high="50" style="10025"/> <RangedBucket low="50" style="10029"/> </Buckets> </BucketStyle> </AdvancedStyle>
For individual range-based buckets, the lower-bound value is inclusive, while the upper-bound value is exclusive (except for the range that has values greater than any value in the other ranges; its upper-bound value is inclusive). No range is allowed to have a range of values that overlaps values in other ranges.
For example, the second bucket in this example (low="10" high="40"
) will contain any values that are exactly 10, as well as values up to but not including 40 (such as 39 and 39.99). Any values that are exactly 40 will be included in the third bucket.
As with the <CollectionBucket>
element, the style associated with each <RangedBucket>
element is specified as an attribute.
To apply label styles to individual range-based buckets, see Specifying a Label Style for a Bucket.
Parent topic: Bucket Styles
A.6.1.3 Equal-Ranged Buckets
If a bucket style contains a series of buckets that contain an equally divided range
of a overall range, you can omit the use of <RangedBucket>
elements,
and instead specify in the <Buckets>
element the overall upper-bound
value and lower-bound value for the overall range, the number of buckets in which to divide
the range, and a list of style names (with one for each bucket). The following example defines
five buckets (nbuckets=5
) of equal range between 0 and 29:
<?xml version="1.0" ?> <AdvancedStyle> <BucketStyle> <Buckets low="0" high="29" nbuckets="5" styles="10015,10017,10019,10021,10023"/> </BucketStyle> </AdvancedStyle>
In the preceding example:
-
If all values are integers, the five buckets hold values in the following ranges: 0 to 5, 6 to 11, 12 to 17, 18 to 23, and 24 to 29.
-
The first bucket is associated with the style named
10015
, the second bucket is associated with the style named10017
, and so on.
The number of style names specified must be the same as the value of the nbuckets
attribute. The buckets are arranged in ascending order, and the styles are assigned in their specified order to each bucket.
Parent topic: Bucket Styles
A.6.2 Color Scheme Styles
A color scheme style automatically generates individual color styles of varying brightness for each bucket based on a base color. The brightness is equally spaced between full brightness and total darkness. Usually, the first bucket is assigned the brightest shade of the base color and the last bucket is assigned the darkest shade.
You can include a stroke color to be used by the color style for each bucket. The stroke color is not part of the brightness calculation. So, for example, if a set of polygonal features is rendered using a color scheme style, the interior of each polygon is filled with the color (shade of the base color) for each corresponding bucket, but the boundaries of all polygons are drawn using the same stroke color.
You can include an opacity value (0 to 255, for transparent to opaque) for the base color (using the basecolor_opacity
attribute) and for the stroke color (using the strokecolor_opacity
attribute).
The following example defines a color scheme style with a black stroke color and four buckets associated with varying shades of the base color of blue.
<?xml version="1.0" ?> <AdvancedStyle> <ColorSchemeStyle basecolor="blue" strokecolor="black"> <Buckets> <RangedBucket label="<10" high="10"/> <RangedBucket label="10 - 20" low="10" high="20"/> <RangedBucket label="20 - 30" low="20" high="30"/> <RangedBucket label=">=30" low="30"/> </Buckets> </ColorSchemeStyle> </AdvancedStyle>
Note:
For the following special characters, use escape sequences instead.
For <
, use: <
For >
, use: >
For &
, use: &
Parent topic: Advanced Styles
A.6.3 Variable Marker Styles
A variable marker style generates a series of marker styles of varying sizes for each bucket. You specify the number of buckets, the start (smallest) size for the marker, and the size increment between two consecutive markers.
Variable marker styles are conceptually similar to color scheme styles in that both base buckets on variations from a common object: with a color scheme style the brightness of the base color varies, and with a variable marker style the size of the marker varies.
The following example creates a variable marker style with four buckets, each associated with different sizes (in increments of 4) of a marker (m.circle
). The marker for the first bucket has a radius of 10 display units, the marker for the second bucket has a radius of 14 display units, and so on. This example assumes that the marker named m.circle
has already been defined.
<?xml version="1.0" ?> <AdvancedStyle> <VariableMarkerStyle basemarker="m.circle" startsize="10" increment="4"> <Buckets> <RangedBucket label="<10" high="10"/> <RangedBucket label="10 - 20" low="10" high="20"/> <RangedBucket label="20 - 30" low="20" high="30"/> <RangedBucket label=">=30" low="30"/> </Buckets> </VariableMarkerStyle> </AdvancedStyle>
Parent topic: Advanced Styles
A.6.4 Dot Density Marker Styles
A dot density advanced marker style, when applied to an area feature such as states or counties, randomly draws a set of dots inside the area. The number of dots drawn inside each area is determined by the count value associated with the area. When you define a dot density style, you must specify a marker style that will be used for each of the dots.
The following example shows the XML definition of a simple dot density style:
<?xml version="1.0" ?> <AdvancedStyle> <DotDensityStyle MarkerStyle="M.STAR" DotWidth="8" DotHeight="8"> </DotDensityStyle> </AdvancedStyle>
In the preceding example, the marker style M.STAR is used for each dot, and the size of each dot is 8 pixels wide and high.
When you use a dot density style, you should "scale" the count value to a proper range. For example, if you want to apply a dot density style based on the population count for each county, you would not want to use the population count directly (one dot for each person), because this will result in an unacceptable number of drawn dots (for example, if a county has 15,000 people). Instead, supply a scaled down value or expression, such as population/1000
, when you define the styling rules for the theme. (The map visualization component does not perform any scaling-down internally, so you must do it at the SQL query level.)
Parent topic: Advanced Styles
A.6.5 Bar Chart Marker Styles
A bar chart advanced marker style is similar to a pie chart style, except that it draws a bar graph for each feature to which it is applied. The following example shows the XML definition of a bar chart style:
<?xml version="1.0" ?> <AdvancedStyle> <BarChartStyle width="30" height="25" show_x_axis="true"> <Bar name="1990" color="#FF0000" /> <Bar name="1995" color="#FFC800" /> <Bar name="1998" color="#0000FF" /> <Bar name="2000" color="#00FF00" /> <Bar name="2002" color="#00FFFF" /> </BarChartStyle> </AdvancedStyle>
In the preceding example, width and height specify the overall size of the bar chart, including all individuals bars within it.
When a bar chart is drawn on a feature based on a set of values associated with that feature, the height of each bar can be determined by either of two approaches: locally scaled or globally scaled. A locally scaled bar chart determines the height of each bar only from the associated values for that feature; and thus, for example, you cannot compare the second bar of one chart to the second bar on another chart on the same theme. A globally scaled bar chart uses the same bar scale for all charts on the map; and thus, for example, you can compare the second bar of one chart to the second bar on another chart on the same theme.
So, if you want to compare bars not only within the same chart, but also among all the charts showing on the map, you must use globally scaled bar chart style by specifying share_scale="true"
in the definition of the bar chart style, as shown in the following example:
<?xml version="1.0" ?>
<AdvancedStyle>
<BarChartStyle width="40" height="30" share_scale="true"
min_value="0.0" max_value="100">
<Bar name="1990" color="#FF0000" />
<Bar name="1995" color="#FFC800" />
<Bar name="1998" color="#0000FF" />
<Bar name="2000" color="#00FF00" />
<Bar name="2002" color="#00FFFF" />
</BarChartStyle>
</AdvancedStyle>
When the bar chart style in the preceding example is applied to a theme, the map visualization component considers the global range of values of all features in that theme, and then determines the height of each bar based on where a specific value falls in the global range from the minimum value to the maximum value.
Parent topic: Advanced Styles
A.6.6 Collection Styles
A collection advanced style is simply a collection of other types of styles that are applied together to a feature. This can result in faster rendering of a collection theme compared to using multiple themes based on different styles.
For example, a bar chart style, when applied to a county, draws only the bar chart somewhere inside the county, but the county itself (its boundary and interior area) is not drawn. However, you probably want to see the underlying boundaries of the counties, to see which bar chart belongs to which county. To do this without a collection style, you would have to define a second theme in which each county is being associated with a color or area style. This approach would result in two rendering passes (because two themes are involved) for essentially the same group of features.
However, by using a collection style in this example, you can define a single style that refers to both the bar chart and the color or area style, and then apply the collection style to the theme for the counties. This theme, when rendered by the map visualization component, will show both the bar charts and the boundaries on the map.
Another typical use of a collection style is for rendering collection type topology features, each of which can contain multiple types of geometries, such as polygons (areas), points, and lines. In such cases, a collection style can include styles that are most appropriate for each type of geometry in a collection topology feature.
The following example shows the XML definition of a collection style:
<?xml version="1.0" standalone="yes"?> <AdvancedStyle> <CollectionStyle> <style name="C.COUNTIES" shape="polygon" /> <style name="L.PH" shape="line" /> <style name="M.CIRCLE" shape="point" /> </CollectionStyle> </AdvancedStyle>
Parent topic: Advanced Styles
A.6.7 Variable Pie Chart Styles
A variable pie chart generates a series of pie circles of varying sizes for each bucket. You specify the pie slice information, the start (smallest) radius size for a pie circle, and the radius size increment between two consecutive circles.
Variable pie chart styles are conceptually similar to variable marker styles. With a variable marker style the base marker size varies, whereas with the variable pie chart style the circle radius varies.
The following example creates a definition for a variable pie chart style with four buckets, each associated with different sizes (in increments of 4) of a circle with start radius of 5. The circle radius for the first bucket has a radius of 5 display units, the circle for the second bucket has a radius of 9 display units, and so on.
<?xml version="1.0" ?>
<AdvancedStyle>
<VariablePieChartStyle startradius="5" increment="4">
<PieSlice name="WHITE" color="#FFFFFF"/>
<PieSlice name="BLACK" color="#000000"/>
<PieSlice name="HISPANIC" color="#FF0000"/>
<Buckets>
<RangedBucket seq="0" label="0 - 6194757.2" low="0" high="6194757.2" />
<RangedBucket seq="1" label="6194757.2 - 1.23895144E7" low="6194757.2" high="1.23895144E7"/>
<RangedBucket seq="2" label="1.23895144E7 - 1.85842716E7" low="1.23895144E7" high="1.85842716E7"/>
<RangedBucket seq="3" label="1.85842716E7 - 2.47790288E7" low="1.85842716E7" high="2.47790288E7"/>
<RangedBucket seq="4" label="2.47790288E7 - 3.0973786E7" low="2.47790288E7" high="3.0973786E7"/>
</Buckets>
</VariablePieChartStyle>
</AdvancedStyle>
Parent topic: Advanced Styles
A.6.8 Heat Map Styles
A heat map style can be used to generate a two-dimensional (2D) color map of any point-type data set. The colors represent the distribution density or pattern of the points or events across the region. Internally, the map visualization component creates a 2D matrix and assigns a value to each grid cell based on the result of a distance-weighted algorithm run against the point data set.
You can create a heat map style using the Map Builder tool, and assign it as the rendering style for a point-type geometry theme. You can then add this theme to a base map, or add it as a theme-based FOI layer to an interactive Oracle Maps application. Figure A-3 shows a map displayed using a theme based on a heat map style. This map shows the concentration of pizza restaurants: red areas have the highest concentration of pizza restaurants, with concentrations progressively lower for orange, yellow, dark green, lighter green, pale green, and white areas.
Figure A-3 Heat Map Showing Pizza Restaurant Concentration

Description of "Figure A-3 Heat Map Showing Pizza Restaurant Concentration"
The following example creates a definition for a heat map style.
<?xml version="1.0" ?>
<AdvancedStyle>
<HeatMapStyle>
<color_stops num_steps="200" alpha="128">
FFFFFF,00FF00, FFC800,FF0000
</color_stops>
<spot_light_radius>75.0mile</spot_light_radius>
<grid_sample_factor>2.5</grid_sample_factor>
<container_theme>THEME_DEMO_STATES</container_theme>
</HeatMapStyle>
</AdvancedStyle>
The preceding example defines these essential aspects of the heat map:
-
Color stops. Color stops are used to generate a color gradient. In this example, the color gradient will go from white (maps to grid cells with a zero value) to green, to orange, and finally to full red (maps to grid cells with highest values). The gradient will have 200 colors that span these 4 color stops. All the colors will have an alpha value of 128 (half transparent, where 0 would be fully transparent and 255 would be opaque).
-
Spot light radius. The spot light radius defines the radius around each grid cell where events or points within this radius will be contributing to the final aggregated value of that cell. The contribution of each point decreases as its distance from the cell center increases, and becomes zero beyond this radius.
You can specify the radius in pixels or in a real ground unit such as
mile
. When you specify the radius in pixels (the default if you do not specify a unit), the mapping from the color gradient to the grid cells will vary as the user zooms in and out on the map. This occurs because the number of points fall within the radius is constantly changing as the user zooms in and out. To achieve a fixed heat map regardless of map scale, you must specify the spotlight radius in a ground unit such asmeter
,km
, ormile
. The preceding example usesmile
. -
Grid sample factor. The grid sample factor is used to sample the current map window size when creating the internal matrix or grid for heat map calculation. For example, a sample factor of 4 means that the internal heat map grid will be one-fourth (0.25) the actual map window size. So, if the map is 1000x1000 pixels, the internal heat map grid is 250x250. Thus, the lower the grid sample factor value, the larger the internal heat map grid will be; and the higher the value, the smaller the internal heat map grid will be.
The grid sample factor value probably has more effect on heat map rendering performance than any other attribute, because a large internal heat map grid (resulting from a low grid sample factor value) will significantly increase the overall computation time. A good general guideline is to specify a grid sample factor value high enough so that the internal heat map grid will be 512x512 pixels or smaller.
-
Container theme name. The container theme name specifies the name of a theme (predefined geometry theme in the same database schema) that defines the boundary of the map for the heat map theme. For example, if you are generating a heat map for a point data set that scatters all over the entire United States of America, choose a theme that represents the US national boundary or all the states as its container theme.
The specified container theme does not affect how the heat map itself is calculated (which is solely based on the point distribution and the spotlight radius). Instead, the container theme it masks out all colored cells that are outside the boundary of the study region. This helps to ensure a "clean" look for the heat map.
After you create a heat map style, you can create a theme for point data and assign the new heat map style as the rendering style for the theme.
Unlike other types of advanced styles, heat map styles do not require any attribute or value columns.
Labels are not supported for themes rendered using heat map styles.
Parent topic: Advanced Styles