A apresentação está carregando. Por favor, espere

A apresentação está carregando. Por favor, espere

Transformações vetor x raster

Apresentações semelhantes

Apresentação em tema: "Transformações vetor x raster"— Transcrição da apresentação:

1 Transformações vetor x raster
Geoprocessamento Transformações vetor x raster

2 Transformações Ponto vetor x ponto raster Linha vetor x linha raster
Polígono vetor x polígono raster (algoritmo point in polygon) No IDRISI estas transformações são feitas sobre imagem já existente Esta imagem pré-existente pode ser composta por zeros Muitas vezes é necessário criar esta imagem com INITIAL

3 Transformação Vetor - raster
Transformação de pontos Pontos vetoriais podem ser transformados em pontos raster Inicia com grade vazia Tipos de transformações Registra a presença de 1 ou mais pontos numa célula (0 ou 1) Conta a freqüencia de pontos dentro de uma célula Assume o valor do ponto vetorial na célula Registra o valor da soma dos identificadores dos pontos Utilidade: semente para delimitação de bacia é um ponto; estrada vetorial somente pode ser considerada em uma análise de caminho ótimo se for rasterizada

4 Transformação ponto vetor x ponto raster
Crie um raster vazio adequado (use Initial) Extremos xmin, xmax, ymin, ymax Resolução Faça a operação vector to raster


6 Linha vetor x linha raster

7 Conversão de polígonos

8 Conversão Vetor - Varredura

9 O algoritmo Point in polygon
Conversões vetor x raster Responder perguntas como: Este posto pluviométrico está dentro da bacia? Este ponto em que foi identificado o mosquito da dengue está dentro do município? Este ponto de captação de água está na bacia A ou B? Quantos dos pontos do conjunto X estão dentro da região Y?

10 Point in polygon Point-In-Polygon Algorithm — Determining Whether A Point Is Inside A Complex Polygon ©1998 Darel Rex Finley.  This complete article, unmodified, may be freely distributed for educational purposes.

11 Figure 1 demonstrates a typical case of a severely concave polygon with 14 sides. The red dot is a point which needs to be tested, to determine if it lies inside the polygon. The solution is to compare each side of the polygon to the Y (vertical) coordinate of the test point, and compile a list of nodes, where each node is a point where one side crosses the Y threshold of the test point. In this example, 8 sides of the polygon cross the Y threshold, while the other 6 sides do not. Then, if there are an odd number of nodes on each side of the test point, then it is inside the polygon; if there are an even number of nodes on each side of the test point, then it is outside the polygon. In our example, there are 5 nodes to the left of the test point, and 3 nodes to the right. Since 5 and 3 are odd numbers, our test point is inside the polygon. (Note: This algorithm does not care whether the polygon is traced in clockwise or counterclockwise fashion.)

12 Polígonos complexos Figure 2 shows what happens if the polygon crosses itself. In this example, a 10-sided polygon has lines which cross each other. The effect is much like "exclusive or", or XOR as it is known to assembly-language programmers. The portions of the polygon which overlap cancel each other out. So, the test point is outside the polygon, as indicated by the even number of nodes (2 and 2) on either side of it.

13 Interseção coincide com pontos
In Figure 3, the 6-sided polygon does not overlap itself, but it does have lines that cross. This is not a problem; the algorithm still works fine.

14 Interseção coincide com segmento
Figure 5 shows the case of a polygon in which one of its sides lies entirely on the threshold. Simply follow the rule as described concerning Figure 4. Side c generates a node, because it has one endpoint below the threshold, and its other endpoint on-or-above the threshold. Side d does not generate a node, because it has both endpoints on-or-above the threshold. And side e also does not generate a node, because it has both endpoints on-or-above the threshold.

15 Conversão polígono vetorial – polígono raster no Idrisi
Raster vazio (apenas zeros) Crie um raster vazio adequado (use Initial) Extremos xmin, xmax, ymin, ymax Resolução Faça a operação vector to raster

16 Conversão polígono vetorial – polígono raster no Idrisi

17 Sobreposição perfeita!!!

18 Sobreposição perfeita???

19 Reversibilidade das transformações
Transformações vetor x raster são reversíveis? Sim. Existem as operações inversas, mas parte da informação é perdida no caminho.

20 Operação inversa Raster x vetor Linhas não são iguais!
Experimente criar uma linha vetorial e transformar para um raster e depois transformar de volta para um vetor. O resultado são duas linhas diferentes!!

21 Operação inversa para polígonos

22 Polígono x vetor Transforme para vetor (polígono)
Transforme de volta para raster Verifique diferenças Arquivo raster Towns

23 Medição de distância de caminhos sobre arquivos raster
Da figura ao lado pode-se ver que, embora seja boa a aproximação, a distância ao longo da linha preta é maior, porque ela é mais sinuosa. Isto ocorre sempre!

Adriano Rolim da Paz*; Walter Collischonn; Alfonso Risso; Carlos André Bulhões Mendes Instituto de Pesquisas Hidráulicas, Universidade Federal do Rio Grande do Sul, Caixa Postal 15029, Porto Alegre, RS, CEP , Brazil. address: *Corresponding author: tel.: ; fax: Abstract Length of river reaches is one of the most important characteristics of stream networks when applying hydrological or environmental simulation models. A common method of obtaining estimates of river lengths is based on deriving flow directions, accumulated area and drainage lines from raster digital elevation models (DEM). This method leads to length estimates with variable accuracy, which depends on DEM horizontal resolution, flatness of terrain, DEM vertical accuracy, the algorithm used to obtain flow directions and the way by which distances are calculated over raster structures. We applied an automatic river length extraction method for eight river reaches in the River Uruguay basin ( km2), in Southern Brazil, and compared its results to the lengths obtained from drainage vector lines digitalized over satellite images. Our results show that relative errors can be higher than 30% in flat regions with relatively low DEM resolution. Preprocessing of DEM by the method known as stream burning greatly improves results, reducing errors to the range 1.9% to 7.4%. Further improved estimates were obtained by applying optimized values for the length of orthogonal and diagonal steps called Distance Transforms, reducing the errors to the range -2.0% to 3.3%. A ser publicado em Computers and Geosciences

25 Distance calculations over raster DEMs are normally done step-by-step, accumulating Euclidean distances which depend on the size of the cells and on the travel direction between cells. The distance of a step connecting two orthogonal cells is considered equal to the cell size, while a diagonal step is considered to have a distance equal to (square root of 2) times cell size (Burrough and McDonnel, 1998; Fairfield and Leymarie, 1991; Kennedy, 2006). The distance from cell B2 to cell E4 in the example shown in Figure 1-a is calculated by adding the distances of step B2 to C2, plus C2 to D3, plus D3 to E3, plus E3 to E4. If the cell size is 100 m than the total length would be (21/2) , or nearly 441 m.

26 As pointed out by De Smith (2004), this ordinary way of calculating length or distance leads to errors, even when using a high-resolution raster. Consider the three examples shown in Figure 1-b. The line from cell A6 to cell A1 follows an orthogonal direction on the raster grid and for this reason is perfectly approximated by the raster structure. The line from cell A6 to cell F1 follows a diagonal direction (45o) and can also be correctly approximated by the raster structure. In the case of the line connecting cell A6 to cell F4, however, the best approximation one can obtain is the sinuous path shown by the dashed segments connecting cell centers. Length will be calculated without error for line segments A6-A1 and A6-F1. If we consider a cell side of 1 unit, then the line segment A6-F4, which correct length is close to 5.38 units, will be calculated as having a length of 3+2.(21/2), or close to 5.83 units. In this case, an error of about 8% in calculated length would have been made.

27 Falar de Distance transforms


29 Tema interessante para trabalho:
Caminhos de mínima distância em polígonos vetoriais

30 Shortest Path Through A Concave Polygon With Holes ©2006 Darel Rex Finley.  This complete article, unmodified, may be freely distributed for educational purposes.

31 The shortest path between two points inside a polygon may be a straight line: Or, it may have to go around an obstacle: Often, the shortest path will hug the wall of the polygon for part of its journey: In fact, the shortest path will always consist of the startpoint and the endpoint, connected by a list of corners from the polygon.  (The above examples use 0, 1, and 4 corners of their polygons, respectively.)

32 If the polygon has "holes" — interior polygons of exclusion — then the shortest path may have to dodge them: Note that in this example, the shortest path is not the simplest.  The green line represents a simpler way through the obstacles, but the blue path is shorter. How can we find the shortest path for any polygon (with or without holes) and any startpoint and endpoint?  As far as I know, an exhaustive search is required.  However, the search can be optimized a bit so that it doesn't take as long as testing every possible path.

33 The technique used in the below code sample is to grow a spanning tree of points, starting at the startpoint, where every point in the tree is connected back to the startpoint by the shortest possible path.  When this tree reaches the endpoint, the solution is found. Each tree-growing step adds not the closest connectible point, but rather the point that can be connected back to the startpoint by the shortest possible total path.  For example, the red point is closer to the tree than the green point, but the green point gives a shorter total path back to the startpoint.  Adding nodes to the spanning tree in this manner ensures that every point is connected back to the startpoint by the shortest possible path, and therefore that when we reach the endpoint, we will have reached it by the shortest possible path.

Carregar ppt "Transformações vetor x raster"

Apresentações semelhantes

Anúncios Google