2-68 Oracle Fusion Middleware Users Guide for Oracle MapViewer
be processed for that data source. Each additional renderer requires only a small amount of memory, so the main potential disadvantage of specifying a large number
of renderers such as 100 is that the underlying CPU resource might be strained if too many map requests are allowed to come through, thus affecting the performance of
the entire MapViewer server.
Each data source has its own internal metadata cache. The metadata cache holds the definitions of all accessed styles, as well as of all predefined themes that originate from
the data source. This eliminates the need to query the database repeatedly for the definition of a style or predefined theme whenever it is needed.
2.6 How a Map Is Generated
When a map request arrives at the MapViewer server, the server picks a free renderer associated with the master data source in the request. This section describes the
process that the MapViewer server follows to generate a map. In brief, MapViewer performs the following steps:
1.
Parse and process the incoming XML map request.
2.
Prepare the data for each theme executed in parallel.
3.
Render and label each theme.
4.
Generate final images or files. Each map generated by MapViewer results from its receiving a valid XML map
request. If you use the JavaBean-based API, the request is automatically converted to an XML document and passed to the MapViewer server. The XML map request is
parsed and its content is validated. MapViewer then creates any dynamic styles specified in the XML request. It builds a theme list from all themes included in the
base map if a base map is specified, as well as any specified predefined or JDBC themes. All individual features in the request are grouped into a single temporary
theme. In other words, after parsing the incoming request, all data that must be shown on the map is presented in a list of themes to the MapViewer rendering engine.
The ordering of the themes in the list is important, because it determines the order in which the themes are rendered. All themes included in the base map when present
are added to the list first, followed by all specified themes predefined or JDBC. The theme that contains all the individual features is added as the last theme on the list.
Any other requested features of a map such as legend, map title, or footnote, are created and saved for rendering later.
For each theme in the request, MapViewer then creates a separate execution thread to prepare its data, so that preparation of the themes takes place in parallel. For a
predefined theme, this means formulating a query based on the themes definition and any other information, such as the current map request window. This query is sent to
the database for execution, and the result set is returned. MapViewer creates individual renderable objects based on the result set.
■
For predefined themes that are fully cached, no query is sent to the database, because all renderable objects are readily available.
■
For JDBC themes, the query supplied by the user is either executed as is when the asis attribute value is TRUE in the JDBC theme definition or with a spatial filter
subquery automatically applied to it. The spatial filter part is used to limit the results of the user’s query to those within the current requested window.
■
For themes that already have renderable features such as the one containing all individual features in a request, there is no need to create renderable objects.
MapViewer Concepts 2-69
After all themes for the map request have been prepared and all necessary data has been collected, MapViewer starts to render the map. It creates an empty new
in-memory image to hold the result map, and paints the empty image with the necessary backgrounds color or image. It then renders all of the themes in the theme
list.
For each theme, features are rendered in an order determined internally by MapViewer. The rendering of each feature involves invoking the drawing methods of
its rendering style. After all themes have been rendered, the labeling process starts. For each theme whose features must be labeled with text, MapViewer invokes algorithms
to label each feature, with the specific algorithm depending on the type of feature such as polygon or line.
After all themes have been rendered and when needed labeled, MapViewer plots any additional map features such as a legend on the internal map image. MapViewer
then converts that image into the desired format such as PNG or GIF specified in the original map request; however, for SVG maps, instead of using an internal image,
MapViewer initially creates an empty SVG map object, then creates an SVG document as a result of the rendering process, and inserts it into the map object.
2.7 Cross-Schema Map Requests