1. What is raster data and what is vector data?
In GIS, for the classification of data format, we usually divide it into two types: raster data and vector data. Raster data is a cell that considers space as discrete and is expressed by a two-dimensional array or other data organization. Vector data, on the contrary, regards space as continuous, with features (points, lines, polygons) to express.
We summarize the characteristics of raster data and vector data as follows:
(1) The raster data is discrete and the vector data is continuous. So raster data is organized in two-dimensional arrays (rows, columns). Vector data can be understood as a vector, which is organized using the ordered geometry of planar coordinates (X, Y).
(2) The smallest unit of raster data is pixels, and the smallest unit of vector data is the feature.
(3) The properties of the raster data are represented by the pixel values of the pixels, and the attributes of the vector data are represented by the attributes of the feature.
(4) The topological relationship is based on vector data.
2. Inference arising from the theory
First, I would like to ask a few questions first:
(1) In Webgis, is the topographic map itself raster or vector data?
(2) When the user needs to interact with the layer, such as the need for the layer to respond to the Click event, return the attribute at the click, when the layer is displayed with the data of the grid, or vector data?
(3) It is necessary to determine the topological relationship of two layers, such as determining which houses in the house layer fall in green space in the map layer, and whether this is a raster layer or a vector layer?
Wait a minute.
To answer the first question, we explained the tile acquisition in the front, and explained how to make a complete topographic map at the end of the front, and it is obvious that the topographic map here is a picture of PNG or other format. The image itself is composed of discrete pixels in a two-dimensional direction, and this is how the raster data is organized, so the topographic map we get in Webgis is understood as a raster layer.
The second problem is that the mouse clicks somewhere on the layer and needs to return to the properties at the point where you clicked. In the first section we have already mentioned that raster data is represented by a pixel value, so it does not meet the needs of the user. Here, we can only use vector layers to accomplish this requirement. So how do you finish it? In general, there are two ways to meet the requirements of the foreground and the background. The implementation principle is given in the subsequent vector layer design.
The third problem is that only vector layers can be selected to complete the requirements. The topological relationship is judged only by the vector layer that can be used.
With the above three questions, we can summarize the following two inferences:
(1) in Webgis, topographic maps and other basemaps are made up of raster layers. They themselves are not able to perform complex front-end interactions with users.
(2) vector layer can meet the various needs of users, in the characteristics of features, topological relations and other related requirements, it is the perfect choice.
3. How vector layers are represented in Webgis
We already know that the raster layer in Webgis is our map image, so what is the vector layer in Webgis?
When we open a polygon layer (vector layer) in a shape format with ArcMap, we have a lot of faces in the display box, which we can choose to indicate with different colors, and the faces will react accordingly when we click on those faces. Similarly, we want to achieve the same effect in Webgis, so how do we do that?
First, the ability to respond to mouse click events is most easily implemented by inheriting the UIComponent class.
Second, it can be expressed in different colors and can be drawn in different shapes. Inherits the UIComponent class, itself has the graphics property, on the graphics can freely draw the want to draw the color and the shape.
As a result, it is possible to conclude that vector layers in Webgis are represented by classes that inherit uicomponent.
But here I am going to tell you that this conclusion is in fact only half the point. The real conclusion is that the feature is represented by a class that inherits from UIComponent, and the vector layer is represented as a canvas of the feature as a children.
Here, let me ask you one more question:
In UIComponent, if we want to draw the shape of a feature, we must first get the coordinate set of the feature, and how do we get the coordinate set of the feature? I will also devote a chapter to this question in the following section.
4. Summary
In this chapter, we talk about the display of raster layers and vector layers in Webgis, and starting with the next chapter, we'll really start exploring how to design and implement raster layers and vector layers. Next chapter: The design and optimization of raster layers, stay tuned.
We conclude this chapter with a map of the Webgis, raster data and vector data that exist at the same time:
Write a few words to give me a good friend:
For different reasons, we have had a desperate moment, think of a thorough escape, the incomparable expectation of time can quickly turn to the next page, turn to our mature or even old. We know that these things will be a nightmare, you may be a long time can not get rid of, but experienced these, your friends, to the end are slowly good, life is working, things, although not good, but certainly not as bad as you think. My Brother,you has many beautiful things,they would never leave you.
-----Welcome reprint, but retain the copyright, please indicate the source in obvious place: HTTP://WWW.CNB Logs.com/naaovegis