Search This Blog

Tuesday 13 October 2015

Mona Lisa on the map of OpenWebGIS and QGIS - Art and GIS together


The article "Extrude image to 2D vector, 2.5D and 3D layers on the map" describes the OpenWebGIS function called "Extrude Image". How can this function be used in addition to what was described in the article? For example, you can put your photo on the map and see how it would look like if it is extruded (that means to calculate the height of each pixel depending on its luminance). It can be fun.
 
And let`s put on a map the famous painting titled Mona Lisa. It is a half-length portrait of a woman by the Italian artist Leonardo da Vinci, which has been acclaimed as «the best known, the most visited, the most written about, the most sung about, the most parodied work of art in the world». Take a photo of the painting from Wikipedia and save on your hard disk- see Figure 1.


Figure 1
Put the painting to the map by using the menu item "Layers-> New Layer from Image file" of OpenWebGIS. For example, set the coordinates: lower left longitude: -41.4597656243041; lower left latitude: -0.41015632552055414; upper right longitude: -16.93828125271782; upper right latitude: 29.866050040550537. The result of adding this picture is shown in Figure 2.
Figure 2
The interactive map with the added picture is available at this link.
Then we apply the function "Edit->Extrude image". If you specify options for this function as it is shown in Figure 3 (be sure to activate the "create color legend:", then rectangles (squares) of vector layer will be painted in the real pixel colors of the image), then the result will be as shown in    Figure 4.
Figure 3

Figure 4
If zoom in it to some extent it will look like in Figure 5. The interactive map with the results shown in Figure 5 you can see at this link. Pay attention that loading this map can take a long time (it depends on the power of your computer).
Figure 5
Vector Layer will better reflect the contents of the picture, if in the option "step by: pixels" the step of calculating pixel will be reduced from 3 to 1. In this case every pixel of the picture will be analyzed, but the calculation time will increase greatly. 
The results of the painting translation in vector format can be explored as a 3D view. Click the appropriate 3D button in the upper right corner of the map, in the pop-up window that appears specify the options such as shown in Figure 6
Figure 6
The results shown in Figure 7. If you rotate the 3D view and zoom it you will see what is shown in the Figures 8, 9, 10.
Figure 7
Figure 8
Figure 9
Figure 10
Try to work with the 3D view on the interactive map available here

The results of your work you can open in QGIS

Create a vector layer using the new option of function "Extrude image". This option called "attribute for color legend:" has been added directly at the time of this article writing. You can now automatically create a color legend not only on the basis of values of calculated height, but other attributes, for example, such as a value of "luminance". So create a new vector layer based on the painting by using the options shown in Figure 11.

Figure 11
Next, select the layer name "ImageExtrude2" in the list "Editable Layer" and export, for example to GML format via the menu item "Layers-> Export Layer to GML format".
Then export the legend of this layer in the SLD file. Learn what file it is, and how to do it in this article: "Layer Styling, SLD file, OpenWebGIS and QGIS".
To download a ready gml file (2.63 MB), follow this link, and the color legend in the form of sld file (1.7 MB) can be downloaded from this link.
And with a standard possibilities of QGIS and instructions in this article add the gml and sld file into a new project QGIS . The result will be as shown in Figure 12
Figure 12
Ready project file (9.24 MB) for QGIS version 2.10.1-Pisa can be downloaded here.



No comments:

Post a Comment