Map Size and Scale

2-62 Oracle Fusion Middleware Users Guide for Oracle MapViewer theme name=theme_us_parks min_scale=5 max_scale=0 theme name=theme_us_highways min_scale=5 max_scale=0 theme name=theme_us_streets min_scale=0.05 max_scale=0 map_definition Each theme in a base map can be associated with a visible scale range within which it is displayed. In Example 2–43 , the theme named theme_us_streets is not displayed unless the map request is for a map scale of 0.05 or less and greater than 0 in this case, a scale showing a great deal of detail. If the min_scale and max_scale attributes are not specified, the theme is displayed whenever the base map is displayed. For more information about map scale, see Section 2.4.1 . The display order of themes in a base map is the same as their order in the base map definition. In Example 2–43 , the theme_us_states theme is rendered first, then theme_us_parks, then theme_us_highways, and finally if the map scale is within all specified ranges theme_us_streets.

2.4.1 Map Size and Scale

Map size is the height of the map in units of the map data space. For example, if the map data is in WGS 84 geographic coordinates, the map center is -120.5, 36.5, and the size is 2, then the height of the map is 2 decimal degrees, the lower Y latitude value is 35.5 degrees, and the upper Y value is 37.5 decimal degrees. Map scale is expressed as units in the users data space that are represented by 1 inch on the screen or device. Map scale for MapViewer is actually the denominator value in a popular method of representing map scale as 1n, where: ■ 1, the numerator, is 1 unit 1 inch for MapViewer on the displayed map. ■ n, the denominator, is the number of units of measurement for example, decimal degrees, meters, or miles represented by 1 unit 1 inch for MapViewer on the displayed map. For example: ■ If 1 inch on a computer display represents 0.5 decimal degree of user data, the fraction is 10.5. The decimal value of the fraction is 2.0, but the scale value for MapViewer is 0.5. ■ If 1 inch on a computer display represents 2 miles of user data, the fraction is 12. The decimal value of the fraction is 0.5, but the scale value for MapViewer is 2. ■ If 1 inch on a computer display represents 10 miles of user data, the fraction is 110. The decimal value of the fraction is 0.1, but the scale value for MapViewer is 10. The min_scale and max_scale attributes in a theme element describe the visible scale range of a theme. These attributes control whether or not a theme is displayed, depending on the current map scale. The default scale value for min_scale is positive infinity, and the default value for max_scale is negative infinity or in other words, by default display the theme for all map scales, if possible given the display characteristics. ■ min_scale is the value to which the display must be zoomed in for the theme to be displayed. For example, if parks have a min_scale value of 5 and if the current map scale value is 5 or less but greater than the max_scale value, parks will be included in the display; however, if the display is zoomed out so that the map scale value is greater than 5, parks will not be included in the display. MapViewer Concepts 2-63 ■ max_scale is the value beyond which the display must be zoomed in for the theme not to be displayed. For example, if counties have a max_scale value of 3 and if the current map scale value is 3 or less, counties will not be included in the display; however, if the display is zoomed out so that the map scale value is greater than 3, counties will be included in the display. A high min_scale value is associated with less map detail and a smaller scale in cartographic terms, while a high max_scale value is associated with greater map detail and a larger scale in cartographic terms. Note that the MapViewer meaning of map scale is different from the popular meaning of cartographic map scale. The min_ scale value for a theme should be larger than the max_scale value. Example 2–43 in Section 2.4 includes min_scale and max_scale values. You also assign scale values for theme labels, to enable the showing or hiding of labels with values different from the base theme scales, by using the theme label scale parameters label_min_scale and label_max_scale. These parameters are similar to the min_scale and max_scale parameters, but the labels are shown if the map scale is in the visible range defined by label_min_scale and label_max_ scale. The label scale values are ignored if the theme is not in the visible scale range defined by min_scale and max_scale. The following is a theme definition with label scale values; the labels will be shown when the map scale is between 5 and 2, but the theme features will be shown when the map scale is between 10 and 0: theme name=theme_us_states min_scale=10 max_scale=0 label_min_scale=5 label_max_scale=2 To determine the current map scale for a map returned by MapViewer, first find the map size, namely the height vertical span of the map in terms of the coordinate system associated with the map data. For example, assume that a map with a height of 10 miles, meters, decimal degrees, or whatever unit of measurement is associated with the data is requested, and that the map is drawn on a device with a size of 500 by 350 pixels, where 350 is the height. MapViewer assumes a typical screen resolution of 96 dpi. Because 96 pixels equals 1 inch, the height of the returned map is 3.646 inches 35096 = 3.646. In this example, the size of the map is 10, and therefore the map scale is approximately 2.743 103.646 = 2.743. Alternatively, you can request a map using a map scale value without specifying a unit, such as 50000 for a scale of 1:50000, by specifying the scale_mode theme attribute value as ratio. If the scale_mode theme attribute value is screen_inch, the scale refers to a unit. To use a scale defined without a unit, request the map specifying the center and ratio scale. To find the equivalent MapViewer screen inch scale for a ratio scale, follow these steps: 1. Find the numerical fraction of a meter associated with one screen pixel. For example, if the screen resolution is 96 dpi dots per inch, the number of meters on the screen for each screen pixel is 0.000265 that is, 0.025496. 2. Find the map scale for one screen pixel the mapdotScale value, as follows: ■ For projected data meters, multiply the result of step 1 by the ratio scale. For example, if the ratio scale is 50000 50 thousand and the screen resolution is 96 dpi, the result is 13.25 meters for each pixel 50000 0.000265. ■ For geodetic data degrees, multiply the result of step 1 by the number of meters on the surface of the Earth for each degree. This number will depend on the coordinate system associated with the data. For example, if one degree = 111195 meters and if the screen resolution is 96 dpi, the result is 29.466675 meters for each pixel 111195 0.000265. 2-64 Oracle Fusion Middleware Users Guide for Oracle MapViewer ■ For data using any other unit, use the approach for projected data using meters. 3. Because the MapViewer scale is per screen inch instead of per screen pixel, multiply the result of step 2 by the dpi value. For example, if the result of step 2 is 13.25 meters at 96 dpi, the number of meters for each screen inch is 1272 13.25 96.

2.4.2 Map Legend