In OpenWebGIS a new function has been created to manipulate images.
- Vector layer (consisting of squares the number of which is equal or less than a number of pixels - it all depends on the settings you specify);
The brief description of the heights calculation in "Extrude image" function:
The luminance of each pixel is calculated based on the red, green and blue components of a pixel color. In modern scientific and engineering practice the terms Luma and Luminance are distinguished. In OpenWebGIS in order to calculate the pixel luminance (Y), the following formula is used: Y = 0.299*R + 0.587*G + 0.114*B. If users of OpenWebGIS have a different opinion, it is possible to add in the interface the ability to calculate the luminance using other formulas, for example:
Y = 0.2126*R + 0.7152*G + 0.0722*B;
Before the calculations the users specify the height interval (in meters) that in their opinion corresponds to the height interval of objects that are on the image (relief, buildings, etc.). The calculation is performed by the formula:
H = ((Math.abs (Yi- minUserH) * (maxUserH-minUserH)) / (maxY-minY)) + minUserH;
where: Yi is the luminance value of analyzed pixel , maxUserH- maximum height defined by the user, minUserH - minimal height defined by the user, minY - minimum luminance of Image pixels, maxY- maximum luminance of Image pixels, Math.abs -return the absolute value of a number; This way calculated height is used to create a vector layer as a set of squares with the appropriate attributes, also layer of 2.5D columns the height of which is equal to calculated heights. Later the user can create 3D view of objects on the base of the vector layer.
Take a satellite photo of the Alps region of Google maps. The area covered by the image is limited by the coordinates: lower left longitude: 5.6537292421837; lower left latitude: 45.20171303181052; upper right longitude: 8.400311273051333; upper right latitude: 46.35103284714349. The photo is shown in Figure 1.
With the menu item "Edit-> Extrude Image" open the pop-up window with options for extrusion (see Figure 4) and set extrusion options such as shown in Figure 5. The height is set from zero to 4809 meters (this is the height of the highest mountain in the Alps - Mont Blanc) If you activate the option "create color legend:" you will get the vector layer with color legend (style) which fully complies with the colors of the image, but this calculation can take a long time. Let`s perform the calculation without this option for now - click "OK-extrude" button.
Let's change the color legend of a layer, as shown in Figure 8. In order not to specify parameters for each height value, use the button "Set automatically". Different variants of the layer style are shown in Figure 9.
In order to feel approximately the spatial dimension of relief (terrain), you can activate the newly created layer "2_5DExtrude". For comparison, Figure 10 shows a satellite image of an area and the same area depicted by a 2.5D columns that are based on the luminance of image pixels.
In order to create the 3D map you must click on the button:
here. Set other 3D options as shown in Figure 11 and click "Ok".
The result of 3D modeling of photo`s part is shown in Figure 14.
The map shown in Figure 14 with 3D view and a height layer of 2.5D columns can be downloaded here: download Map 4 (13 MB)